- alias: Bathroom Main Lights off
hide_entity: true
trigger:
- platform: state
entity_id: binary_sensor.motion_sensor_158d00022548e0
to: 'off'
for:
minutes: 3
condition:
- condition: state
entity_id: binary_sensor.motion_sensor_158d0000ef8616
state: 'off'
for:
minutes: 3
action:
service: switch.turn_off
entity_id: switch.BathLights
This what I currently have and get no errors in check config, however now the light refuses to automatically turn off. If I removed the condition section then it will turn off after one the 1st sensor detected no movement for 3 minutes however I need it to be off when both sensors detect no movement.
Any Jedi masters of the Home Assistant world got any better ideas?
You Sirs are a legend. Although after some testing it was already working with my code but I am certainly going to use your code because it is cleaner.
In your code does the template state need to be changed to off? I think it does.
Then you should also rename it to “no movement” because it is just the opposite binary sensor. However, too many negatives will make you go crazy so I suggest to just stick with the “movement” sensor and test for it going to “off”.