Thanks for taking the time to reply.
I’ve made some progress, thanks to your helpful hint about helpers. It took me awhile to figure out how to create a helper, but I’ve done the following.
I eliminated scenes completely. Instead, I have 3 automation scripts, Thermostat Off, Thermostat Cool, and Thermostat Heat. At the end of each automation run, a helper value called HVAC_Preset is set to 0,1 or 2.
0 = off
1 = heat
2 = cool
** It should be noted that all the thermostats will always be in the same HVAC preset. I have the scripts setup as a dashboard card and trigger the preset change from there.
This way, I can simply look back at HVAC_Preset and see what mode the thermostat was previously in.
Now onto handling the door opening situation. Each thermostat controls an HVAC unit dedicated to a single room. Each room has two doors. With the newly discovered functionality of helpers, I created an script for each room. When a door device switches from a closed state to an open state, a helper input number for that room is incremented by 1. The input number has a minimum value of 0 and a max of 2. Now I can track if there are any open doors for each room.
The next challenge. I need to have some type of delay on the door. I imagine the thermostat nor Honeywell will appreciate getting sent off/on commands hundreds of times a day. I’d like to implement some type of delay timer. I created another helper, a timer, and set the duration to 5 mins or 300 seconds.
As I am still learning Home Assistant, I think timers only work in a countdown manner. I gather what should happen is that I have one automation script that when the door sensor is trigger open, it begins the countdown timer for that room. Then another automation script that when the countdown timer reaches below value 1, set the corresponding HVAC preset to Off.
** It’s worth noting that I’m trying to only turn off the HVAC if the any of the doors are left open longer than X amount of time.
I have a few questions about the timer:
-
There are two doors, but I imagine there is no reason to reset the timer if a second door opens after the first one. That makes the logic pretty straight forward. But I assume that if a timer counts down from 300 seconds, my condition to set the HVAC to off should be when the timer is BELOW 1 second correct?
-
I assume timers need to be reset. So assuming I have the HVAC_OFF and both doors have just closed. I should have another automatic script that checks my door count helper, making sure it sees a value of 0, then it should reset my door timer, and then finally checks my HVAC_Preset helper to return the thermostat to its original preset.
Am I think about timers correctly?
I’ll probably need to add a timer in for the door close, as well.
Finally, I’m getting a lot of automation scripts for each room. Which I guess is fine, but is this a best practice? Or should I be trying to merge things together?