What I’m trying to achieve:
if the light is on, and no motion detected in the past xx seconds, turn off the light.
This is my “scene” in Fibaro HC2 which does exactly this:
If light == on for 90s
and
sensor != detected for 90s
then
turn off the light
Doesn’t matter if the light is turned on by another automation or manually, as long as there is no motion detected in the past 90 seconds, the light will turn off.
My config in HA:
The motion sensor goes to “clear” after 60 seconds no motion detection. This automation works fine except if I turned the light on manually without triggering the sensor and trigger the sensor after 60 seconds, the light will simply stay on indefinitely.
Difference between Fibaro and HA automation:
It seems Fibaro automation is constantly running as long as the state of the light is on.
HA automation only runs once when the state of the light goes from off to on.
I’m sure with the flexibility of HA, this is achievable, any help or tips would be highly appreciated.
Correct. The automation’s trigger detect state-changes. In this case, it detects when the sensor changes to off.
If you simply want the light to turn off after 90 seconds, even if the motion sensor is never triggered, then why bother monitoring the motion sensor’s state? Just create an automation to turn off the light after 90 seconds.
Problem is I don’t want it to turn off if motion is detected during the 90 seconds.
Is it possible to reset the 90s countdown whenever motion is detected?
It is stating that the motion sensor must remain off for at least 90 seconds in order for the trigger to activate. Think of it as a timer that must count to 90 seconds. If the motion sensor’s state changes to on while the timer is counting, it causes the timer to restart counting from 0.