I’m trying to improve my jinja2 coding. It’s slow!
I have the below script that I’m trying to generalise. When a camera detects a person, I want to send a message to my phone and the message indicate which camera detected the person.
I’ve tried everything I can think of and looked here for other posts, but can’t get it to work. Where the trigger.id is in the message just comes up blank.
alias: Person is detected road while away
description: ""
triggers:
- type: turned_on
device_id: fd7f30c91a2fd03d
entity_id: 146255844bcb84
domain: binary_sensor
trigger: device
id: Road
- type: turned_on
device_id: 4442601d6a03e490
entity_id: 40b1f3fcbe9a510409
domain: binary_sensor
trigger: device
id: Balcony
conditions:
- condition: state
entity_id: input_boolean.home_status
state: "off"
actions:
- action: script.send_notification_to_multiple_devices
data:
devices:
- mobile_app_matts_phone
- mobile_app_matts_ipad_air
title: {{ trigger.id }}
message: Person detected by {{ trigger.id }} Camera
sound: Sherwood_Forest.caf
mode: single
I would appreciate any guidance.