#Ring Motion Trigger

1 messages · Page 1 of 1 (latest)

past shadow
#

I currently use the Ring provided binary sensor to turn on a light during motion detection, and then back off 5 minutes after it clears. This has worked well but the binary sensor is being deprecated

triggers:
  - trigger: state
    entity_id:
      - binary_sensor.front_door_motion
    from: null
    to: "on"

I tried to recreate the binary sensor as a template, however I found this only updates once a minute:

{{ now() - states('sensor.front_door_last_motion') | as_datetime < timedelta(minutes=3) }}

Is there a better way to achieve this, either in the automation trigger or the helper template?

bold jolt
#

I don’t have Ring, but I assume that sensor is a timestamp and only changes when motion is detected. If that is true, you don’t have a way to know when motion is cleared. So you can only trigger on motion detected, and ‘x’ minutes after motion is detected.

triggers:
  - trigger: state
    entity_id:
      - binary_sensor.front_door_motion
    not_from:
      - unavailable 
      - unknown

For 5 minutes after motion was detected, you can use

triggers:
  - trigger: state
    entity_id:
      - binary_sensor.front_door_motion
    not_from:
      - unavailable 
      - unknown
    for:
      minutes: 5
past shadow
#

Yeah, the last motion is just a timestamp.

The problem is the existing binary sensor is being removed by Ring, but the template I made to replace it only updates once a minute

So if motion is detected at 07:01:05, the template won't refresh until 07:02:00

hollow turret
bold jolt
#

I meant to use sensor.front_door_last_motion instead of binary_sensor.front_door_motion in my code above.

But Michael is right, you should convert over to using events instead.

But for motion cleared I wouldn’t use a delay in your automation, I would still use the for: option for 5 minutes.