How can I prevent my motion triggers to start the timer before the light gets turned off?
Few of my lights get turned on by a motion detector and then turned off after 5 minutes if no activity.
Before (in openHAB) I had a dummy switch I could use as a measurement, if the value was ON, then the turn off command could not run.
I don’t know if it makes sense, but I used the switch to turn on the light and when turned on, even if the motion got triggered, then after 5 minutes the if statement wasn’t true because the light switch was still ON and not OFF.
- alias: '[Hobbyroom] Motion/Lux Turn On Gateway LED'
trigger:
platform: state
entity_id: binary_sensor.motion_sensor_xxxxxxxxxxxxx
from: 'off'
to: 'on'
condition:
condition: numeric_state
entity_id: sensor.illumination_xxxxxxxxxxxxxxxxxx
below: 100
action:
- service: light.turn_on
entity_id: light.gateway_light_34ce0088ed14
data:
brightness: 5
color_name: red
- alias: '[Hobbyroom] Motion/Lux Tun Off Gateway LED'
trigger:
platform: state
entity_id: binary_sensor.motion_sensor_xxxxxxxxxxxxxxxx
from: 'on'
to: 'off'
for:
minutes: 5
action:
- service: light.turn_off
entity_id: light.gateway_light_xxxxxxxxxxxxxxxxxxxxxxxxxx
I guess if you have seperate automations that you want to be able to control seperately, then yes. Otherwise you can use the same boolean to disable them all.
Hmm that will give me some small problems, because I would need more than one switch. I was hoping that I could create more booleans. One for each room where I would need it.
So both to prevent the motion trigger but also to just turn on the light on or off if manually pressed.
Sorry, I thought that’s what I was saying. You can have as many booleans as you want. However, I’m not sure if there’s a good way to tell if the light was manually switched on or turned on by your automation. It would be very dependent on your setup.