I have been using home assistant for a few months and slowly learning and bringing more of my home devices onboard.
I worked out motion sensors, groups, light illuminance levels to trigger for lights to only turn on if motion detected and lilluminance below x. Also solved the TV viewing and keeping lights on by use of my Harmony Remote and activity use.
However, specifically in my Study, I can be sat and working as we move from daylight into darkness, but as my sensors in the Study Sensor group keep detecting motion, it never runs unless i move out of the room for a few minutes to allow lights off to run and stop detecting motion. Now it runs again upon motion checks the condition that the light level is below and turns on the light.
Is there any way to get the light to turn on when light level drops even if motion is detected?
I have found creating a second automation to check if light illuminance drops below 60 and condition that study group detects motion, then turn on study light.
This has made me realise some of my zones may be in use when light changes to require lights and due to lack of change in sensor to trigger, the light would stay off.
So, do I need to make two variants of the turn on light scripts, or Is there a neater way to do this?
I use the script below for one of my rooms, which seems to work well. Its triggered by EITHER the occupancy changing, or the illuminance level changing.
I then use an if condition in the actions to determine if the room is actually occupied, AND the room is dark enough, AND the light isnt already on. If so, the light is turned on.
I then wait for 30 seconds of occupancy NOT being detected then turn off the light. I use mode: restart which means if its triggered again, its basically, continually refreshing the 30 second check, so the lights dont go out when I dont want them to.