Door sensors to shut down AC?

Do you have a similar routine that will work with Nexia XL1050 thermostats? I’m looking to turn heat or AC off if a window sensor is open. I use ST as my automations hub. Thx!