Having a stupid problem that seems like it should be simple, and I know its possible.
I have a presence sensor turning on lights when I enter a room (Aqara FP2). But, using the blueprints from a few people I can only see a way of turning the light back OFF after an amount of time. So my lights turn off after the set time, then a few seconds later they turn back on, because I am still in the room. There must be a way to keep them on as long as there is presence in the room, without them turning off first.
Seems like a basic function, but I’m not doing something correctly. What am I missing?
I would just do it manually without a blueprint. Here is how I approach it. I set the automation to trigger on any change in the presence sensor (detected > not detected or the other way around).
I then set my automation to restart if there is a change to the presence sensor. More on this later.
Most of my automations are done in this way with a Chooser. Remember, the delay will be cancelled if presence is re-detected and the light will stay on.
Took me a minute to wrap my head around that, but I followed your amazing instructions, and it seems to be working great. You taught me some new ‘commands’ in HA which I never even realized I could do. This changes so much for me. Thank you so much, time to go play with more automations
- platform: state
entity_id: binary_sensor.your_motion_sensor_here # change this
to: 'off'
for:
minutes: 2 # adjust as necessary
There is no need to use restart mode, single mode will do, as the trigger gets triggered ‘on’ if motion is detected within the 2 minutes of ‘off’.
If you decide to use a delay (which I do myself, as I have a stateless motion detector (which only turns on, never off), then you should use restart mode