I have a set of lights out the front, and recently had an idea to have them turn on in dim mode at sunset and turn off around 11pm.
Then on top of that I have a motion sensor that will cause the lights to turn to full brightness for 5 minutes between sunrise and sunset.
Then thirdly, I want to be able to manually switch the lights on (which will will override the motion off, or evening mode)
Looking through this, was going to be quite complex to do with automations, probably alot required because of the different state changes. What would be the best way to approach this?
Mostly worked this out, the trickiest part is the light switch, its coming through an MQTT gateway, and I can’t tell if its been manually switched, or its been switched on by automation (via my sunset rules).
The turn on and off automation has a line to check if the light is on already so the automation doesn’t fire up if the light is on manually, thus creating an override for the script, as you suggested, right? Also there is another line that checks again if the light had been switched of manually in between the automation run just before the final switch off command.
After that, I’ve created a couple of automatons for sunset and sunrise, so I can disable the automation itself if there is light outside. Working with on/off automation makes it simple:
i know this is a old post, but I hope somebody could point me in the right direction.
Im trying to use the above code for 2 motion sensors i have in my living room and dining room.
I dont want the dim screen to come on if the light.flower_lamp is on and after testing that part is working good.
but if the dim script is activated my lights wont turn off again, what am I missing?