I have the following issue.
I had an automation which is triggered by sunset.
Sometimes it gets darker earlier when dark clouds gather.
Therefore I set up the trigger: If illuminance is below 200lx.
My problem is now i.e. I want to start looking a film and turn off all lights.
Unfortunately I am not able to turn them off, because my automation kicks in.
How do you handle this topic?
I’ve just recently been dealing with this question (reverse case - turn lights on if it gets too dark inside during the day). For now, I ended up with a template binary sensor, which turns on if attribute „daylight“ is true. The sensor’s state is used as condition in my automation.
I have an input_boolean called “lightning_night_mode” which is turned on when it is getting dark. I have an automation which reacts to the state changing to on. This automation uses the Choose action, to do the logic. So for example - if I am away from home, all that happens is one light turns on in the livingroom - the rest will activate with motion detectors - for the dog.
If you have a device that you are watching the movie on, that Home assistant can see the state of, then you can simply use it in the conditions of the choose (I use NOT to cover all the bases: NOT playing or off). If you don’t have a device like this, just create an input_boolean like “livingroom_media_override” which you can then use in the condition. So if the state is on, that part of the choose action returns false and the automation doesn’t do anything.
In the UI Automation editor, you can do this for multiple rooms, by simply adding a Choose action under default actions and then that Choose block will be run after the one above it, each time you do this, another default actions block will appear at the bottom of the automation, so you can do it again.
I have multiple things that can trigger the automation, eg - turning on a light in the livingroom will set the brightness level of the light to the input_number slider. That should still be able to happen, if at the same time something else triggers the script - for instance, turning on ALL the lights in the livingroom will trigger the script 3 times. If I had it set to single only the first light to trigger would set it’s brightness after turning on. If I had it set to restart - only one light would set it’s the brightness. Parallel allows the automation to run multiple times at once.
Put another way to make it easy to visualise:
Single: If the script is ALREADY running, it won’t run again.
Parallel: The script will run every time it is triggered, even if it was already running.
Restart: If the script was already running, it will be killed and restarted with the latest trigger.
Do you have any way for HA to know if you are watching a film?
If not then the only way that I know to handle it is to create an input boolean (helper) and turn that on when you don’t want the automation to run. then you can put that being off as a condition in the automation.
Sorry for not answering… I have some new and bigger problems with my Smart Home now.
I like your ideas. I will also combine it in conditions “if Television is running”.