Hope someone can help with this…
I’m particularly having trouble with the ‘{{ trigger.to_state.attributes.friendly_name }} triggered’, I’m really bad with templates… struggled in home assistant but I thought I would give Node-red a go and now I’m stuck.
Basically if a sensor has triggered and we are not home I want a notification with which sensor triggered (friendly name)
- alias: 'Actionable notification when devices triggered'
trigger:
- platform: state
entity_id: binary_sensor.study_motion, binary_sensor.wir_motion_sensor, binary_sensor.downstairs_bath_motion_occupancy, binary_sensor.ensuite_motion_occupancy, binary_sensor.kitchen_motion_sensor, binary_sensor.stairs_motion_occupancy
to: 'on'
condition:
condition: or
conditions:
- condition: state
entity_id: alarm_control_panel.ha_alarm
state: armed_away
action:
- service: alarm_control_panel.alarm_trigger
entity_id: alarm_control_panel.ha_alarm
- service: notify.mobile_app_sal_iphone
data_template:
message: '{{ trigger.to_state.attributes.friendly_name }} triggered'
data:
title: "Door or Motion sensor triggered"
message: Security Breach
data:
push:
category: "camera"
entity_id: camera.blueiris_all_cameras