Amcrest Motion Automation Issues

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

amcrest:
host: 192.168.1.xxx
username: myusername
password: mypassword
scan_interval: 3
sensors:
- motion_detector
- sdcard
switches:
- motion_detection
- motion_recording

When posting YAML code please follow the instructions at the top of the page so that it formats correctly. As you can see from your post it’s very difficult to read.

But I think your problem is that the sensor’s states are 'True' and 'False', not 'true' and 'false'.

Also note that the scan_interval configuration variable is broken and has no effect. The sensor will update every 10 seconds no matter what you set for scan_interval. I’m looking into a way to fix that; see Issue #16050 for more details.

Wow, I can’t believed I miss that! Thanks so much!