I’ve recently started looking at automation.
First thing I enabled is check presence sensor and turn ON/OFF lights.
However this is in living area and I want lights to be off if I’m playing a movie (just an example)
Can I declare some sort of toggle state in HA and use that as condition for automation? (Basically add small button in UI - if toggled ON automation does something, otherwise automation continues)
Scenes do not have a state you can check. Their state is only the date & time they were last activated.
The way I get around this is to use an input_select helper and an automation.
Whenever the input select option is changed (automatic / watch movie / manual / etc…) the automation triggers and runs the scene associated with the selected option.
You can then use the state of the input select in conditions.
Also when activating scenes in my automations I do it by setting the input_select rather than running the scene directly. That way everything stays in sync.
Finally I don’t actually use scenes. I use scripts. The difference is that instead of just specifying the state of an entity and letting HA call the required service to set that state I specify service. The advantage is that scripts can do a lot more than scenes. They can do anything the actions of an automation can do, if/then, delays, etc… so your script “scenes” can be a lot more dynamic.
Sorry got busy and this went on back burner.
Revisiting it again now.
To clarify requirement:
I don’t want lights to turn on if someone just wants to relax (current automation checks presence and turns on lights)
So I’m looking to provide user controllable condition to automation.
I’ll check scripts
this helped:
Created a toggle ManualOverride
. Now automation works only if override is ON