Hi guys
So I’m struggling on the logic to turn my bedside light on and off with a single motion PIR.
I’ve used the PIRs to turn lights on and then off after a duration before but I can’t figure out how to use the same PIR unit to turn on and off the same light by moving my hand over it.
Below is the code I’ve used to turn the light on:
- alias: Auto Turn on Bedside Light Between 19:00 - 06:30
initial_state: 'on'
trigger:
platform: state
entity_id: binary_sensor.Other_Sensor
to: 'on'
condition:
condition: time
after: '13:00:00'
before: '06:30:00'
action:
service: switch.turn_on
entity_id: switch.bedside_light
The problem I’m having is that I turn the motion sensor back to it’s off state after 2 seconds and then I need to use the lights “on” state combined with the motion state reading “on” to trigger the light off but then both the light on and light off automation trigger.