You were right, it was just because I was missing one choose statement. Now the automation works correctly when corrected as below. Thanks for doing the proofreading I failed at:
- id: someone_through_gate
alias: someone_through_gate
initial_state: 'true'
trigger:
platform: state
entity_id: binary_sensor.person_inside_gate
to: 'on'
action:
- choose:
- conditions:
- condition: and
conditions:
- condition: template
value_template: '{{ (as_timestamp(now()) - as_timestamp(states.automation.person_in_front.attributes.last_triggered | default(0)) | int > 600)}}'
- condition: state
entity_id: device_tracker.sean_s_iphone_12
state: 'home'
sequence:
service: notify.mobile_app_sean_s_iphone_12
data:
title: "Person Coming Through Gate"
message: "Looks like someone is going to or coming from the front gate to the front door"
data:
push:
category: camera
thread-id: "security"
entity_id: camera.front_stream
clickAction: /lovelace/4
- choose:
- conditions:
- condition: and
conditions:
- condition: template
value_template: '{{ (as_timestamp(now()) - as_timestamp(states.automation.person_in_front.attributes.last_triggered | default(0)) | int > 600)}}'
- condition: state
entity_id: device_tracker.alena_s_iphone
state: 'home'
sequence:
service: notify.mobile_app_alena_s_iphone
data:
title: "Person Coming Through Gate"
message: "Looks like someone is going to or coming from the front gate to the front door"
data:
push:
category: camera
thread-id: "security"
entity_id: camera.front_stream
clickAction: /lovelace/4
- choose:
- conditions:
- condition: and
conditions:
- condition: template
value_template: '{{ (as_timestamp(now()) - as_timestamp(states.automation.person_in_front.attributes.last_triggered | default(0)) | int > 600)}}'
- condition: state
entity_id: device_tracker.sean_s_iphone_12
state: 'home'
sequence:
- service: mqtt.publish
data:
topic: !secret genesys_5490_notify_topic
payload: !secret genesys_5490_someone_through_gate_notification