I am trying to create an automation based on the “Amcrest Camera_Motion Detected” entity to turn on a porch light after a certain time. I am lost as to why this this automation is not working. Any advice?
automation:
-
alias: Motion Sensor Lights On
trigger:
platform: state
entity_id: sensor.amcrest_camera_motion_detected
to: ‘true’
condition:
condition: time
after: ‘07:30’
before: ‘23:30’
action:
service: homeassistant.turn_on
entity_id: light.corner_light
data:
transition: 15 -
alias: Motion Sensor Lights Off
trigger:- platform: state
entity_id: sensor.amcrest_camera_motion_detected
to: ‘false’
for:
minutes: 15
action: - service: homeassistant.turn_off
entity_id: light.corner_light
- platform: state
amcrest:
host: 192.168.1.xxx
username: myusername
password: mypassword
scan_interval: 3
sensors:
- motion_detector
- sdcard
switches:
- motion_detection
- motion_recording