I am new to the home assistant. I am trying to create an automation to turn the light on using a sonoff switch when the motion is detected but only when the blink is armed. If the switch turns on then turn it off after 10 minutes. I am not able to find how to check the state of the system.
- id: '1588172004740'
alias: Front Door Light Turns On When Motion Detected
description: Front Camera Motion Detected Front Door Light Turn on
trigger:
- entity_id: binary_sensor.blink_front_motion_detected
from: 'off'
platform: state
to: 'on'
condition:
- condition: state
entity_id: binary_sensor.blink_front_camera_armed
state: 'on'
action:
- data: {}
entity_id: switch.sonoff_100057c411
service: switch.turn_on
- delay: 00:00:10
- data: {}
entity_id: switch.sonoff_100057c411
service: switch.turn_off
Can an experience person tell me where i am wrong.