I see a lot of automation examples to turn lights on and off based on a motion sensor using 2 automations (1 for ON and one for OFF)
Is there a way to address the on / off automation by assessing in the trigger just a change of status (regardless if it goes from occupancy to clear or vice versa) and in the action turning on or off the lights based on that status change?
For a motion sensor example, try this…
The example below I use in my kitchen. You’ll note that the sensor only triggers to turn on the light, not off.
The off comes later on when there is a wait for trigger. If no motion is detected for 5 minutes, then the lights go off, otherwise it just waits there indefinitely until it is sent a motion clear event.
The other option is to use 2 triggers, one for on, one for off, and use trigger id’s to then decide what to do later on using either an if or choose condition.
I use this in another automation but this should give you the idea:
After testing several option I decided to opt for an intermediate solution given an extra variable.
I realized that when the shower curtain is close while showering the light turns off because the sensor on the ceiling does not register any movement.
So the option of showering with the curtain open or change it to one transparent is not that appealing.
I decided to add a motion sensor on the roof of the shower working in tandem with the bathroom one.
I let any sensor to trigger any event and then I used the and and or operator in the action using the ´choose’ action based on the sensors status.
In essence if the two sensor are both off —> turn the light off
If any of the sensors is on —-> keep or turn the light on.
To the next challenge
Cheers
Giancarlo
In this way the automation is triggered only by the sensor change status and nobody has gets the soap in the eyes.
Have you group both sensors into a binary sensor group and treated them as a single entity, or are you checking each one individually ? (both options work).