I want to add a motion sensor to my dog door that will turn on the lights (for 5 minutes) when the dog goes outside between sunset and sunrise.
I have the automation working, but the problem is that if the dog comes back inside the motion sensor is triggered and the lights come on again.
What might I be able to add to the automation to prevent this.
Here is my current automation.
####################################################
# DOG DOOR LIGHTS OFF 02Nov2021 #
####################################################
- id: "74a2e07a-5a3b-44a8-8a91-ed805da6ea7c"
alias: "Lights - Patio Lights OFF"
description: Patio Lights OFF
trigger:
- entity_id: binary_sensor.wyze_dog_door
for: 00:05:00
platform: state
to: "off"
from: "on"
condition: []
action:
- entity_id: switch.patio_light
service: switch.turn_off
mode: single
####################################################
# DOG DOOR LIGHTS ON 02Nov2021 #
####################################################
- id: "5a0de454-4035-4364-9770-d14d73291aac"
alias: "Lights - Patio Lights ON "
description: Patio Lights ON
trigger:
- entity_id: binary_sensor.wyze_dog_door
platform: state
to: "on"
from: "off"
condition: []
action:
- entity_id: switch.patio_light
service: switch.turn_on
mode: single
####################################################
# END OF CONFIGURATION FILE #
####################################################