Ive been trying to figure this one out and keep getting errors
I have an automation with a trigger being a motion sensor.
Id like to be able to send a notification via pushbullet which will tell me which one of 2 sensors has triggered, im failing:
- alias: Intruder
trigger:
- platform: state
entity_id: sensor.lounge_sensor_node_pir, sensor.bedroom_sensor_node_pir
to: 'motion detected'
from: 'standby'
condition:
- condition: state
entity_id: input_select.home_mode
state: 'Away'
action:
- service: notify.pushbullet
data:
message: {{ trigger.from_state.attributes.friendly_name }} has been triggered
title: Intruder at Home!!
It gives me an error in the log along the lines of ‘trigger is not defined’?
Ive also tried the above but altering the trigger to
- alias: Intruder
trigger:
- platform: state
entity_id:
- light.first_light
- light.second_light
to: 'motion detected'
from: 'standby'
Bumping instead of starting anew. This post helped me get trigger data passed, thank you!
Is the only way to get trigger data from an automation to a script by passing it via a data_template? I’m just learning scripts and the like and will have about a dozen or so automations which I’d like to call a script which will format a Discord message of trigger data (think info level logs).
Is there an inherent way, when a script is called, to pull the information about what called it (if the above way is pushing the information)? Should I be listening for an event or something else to get this?