HI am trying to turn off an hvac device when a window is open, I want to turn the hvac back on in it’s previous mode when the window is closed again. how do I store the original HVAC mode to use it later.
I am using the room’s light switch here so I can test it without being in the room / house
Create a snapshot scene. Your intended application (storing/restoring states when a window is opened/closed) is the subject of an example in the documentation.
Thank you, it kind of works. It works if the HVAC mode wasn’t “full auto” (heat) If it was full auto then it does get reset to full auto (heat) but immediately changes to “temporary manual” (fan only) I think this is the thermostat itself deciding there has been a manual entry. but IDK
I don’t know if you are aware of it but the repeat loop you have created is repeatedly executing the Device Action as fast as your host machine allows for it. In other words, it’s sending a rapid, continuous stream of commands to your thermostat.
At a bare minimum, add a delay statement, set to 10 or 15 seconds, just after the Device Action. It will make each iteration run at 10 second intervals (instead of every few milliseconds or microseconds).
BTW, I assume you’re using a repeat to ensure that if someone attempts to turn the thermostat back on, while the window is open, it will be promptly turned off again.
Thanks, yes in the live automation it is set to 30 seconds. this automation was a prototype that I resurrected to try and not have the resultant hvac mode hardcoded like in the live automation. And yes, it’s to stop the HVAC being turned back on and overriding the automation
thank you that has the same functionality but it also fails at the same place. When turning the thermostat back on in HEAT (full auto) mode it sets the mode to FAN ONLY (temporary manual)
the scene_id before seems to be changed at light off / window closed … before changed to 29 March 2023 at 17:27
Bedroom changed to Fan only triggered by automation window test 2 triggered by state of Bedroom light
17:27:12 - In 1 second
window test 2 triggered by state of Bedroom
17:27:12 - In 1 second
Bedroom changed to Heat triggered by automation window test 2 triggered by state of Bedroom light
17:27:12 - In 1 second
before changed to 29 March 2023 at 17:27 triggered by automation window test 2 triggered by state of Bedroom light
17:27:10 - Now
window test 2 triggered by state of Bedroom light
17:27:10 - Now
Bedroom light turned off
17:27:10 - Now
That blueprint monitors the window’s state but not the thermostat’s state. So if someone turns the thermostat back on while the window is open, it won’t turn the thermostat back off.
But not good enough to be the solution. Apparently ‘sets the helper when the mode is changed, but condition it to NOT be “Off”’ is all you needed to do to solve it?
so is there a way to replace heat with a variable = original state? or do scenes have properties like scene.state I can reference instead of whole scene, like scene.before.hvac_mode ?
That’s a Device Action and it doesn’t support templating (i.e. none of its options can be assigned a variable’s value or some other entity’s value).
However, a service call, like the climate.set_hvac_mode service call I used in my example above, does support templates. So if you have stored the thermostat’s original state in an Input Text (let’s call it input_text.small_bedroom) then you can reference its value like this: