Im new to HomeAssistant… Trying to set a automation. I have a Reolink camera so whenever motion is detected I want the entrance light to turn on, so I have a timer and it all seem to work except when timer runs out motion is triggered and light turns back on.
Not sure if the code helps to see what could be wrong or if I paste pictures of ui instead?
alias: Detection Entré Light On
description: “”
trigger:
- type: motion
platform: device
device_id: c3c29f6964cf3e3594ed0c913b74f5bf
entity_id: e2cdcee3b0ca15feab4d856e5f0ea8b9
domain: binary_sensor
for:
hours: 0
minutes: 0
seconds: 0
id: Motion detected - platform: event
event_data:
entity_id: timer.light_timer
id: Timer finished - Light off
enabled: true
event_type: timer.finished
condition: - condition: time
after: sensor.sun_next_setting
before: sensor.sun_next_rising
weekday:- sun
- sat
- fri
- thu
- wed
- tue
- mon
action:
- choose:
- conditions:
- condition: trigger
id:- Motion detected
enabled: true
sequence:
- Motion detected
- type: turn_on
device_id: 2dd03e650081fd8d7db4219ae76d3844
entity_id: 5977e1ff3014bff578a5cbc3b6290730
domain: switch
enabled: true - service: timer.start
data: {}
target:
entity_id: timer.light_timer
- condition: trigger
- conditions:
- condition: trigger
id:- Timer finished - Light off
enabled: true
sequence:
- Timer finished - Light off
- service: switch.turn_off
data: {}
target:
entity_id: switch.entrance_tvattstuga_on_off
mode: single
- condition: trigger
- conditions: