I want to receive an alert when a car comes down the drive but not when a car leaves. I have a camera by the gate, and a PIR ~10 yards / metres nearer to the house - the coverages do not overlap.
I think the easiest way to achieve this would be the following flow of activities…
WHEN binary_sensor.gate_motion changes from off to on
AND within 10 seconds BEFORE switch.gate_pir changes from off to on
Activate Call Service
How might I encode the AND within 10 seconds BEFORE part in the follow automation code?
Many thanks!
description: ""
mode: single
trigger:
- platform: state
entity_id:
# This is the motion sensor within the camera
- binary_sensor.gate_motion
from: "off"
to: "on"
condition: []
trigger:
- platform: state
entity_id:
# This is the motion sensor within the PIR sensor
- switch.gate_pir
from: "off"
to: "on"
condition: []
action:
- service: notify.mobile_app_iphone
data:
message: Car coming down the drive
title: Drive Activity