I have an automation that is working correctly but I can’t seem to figure out the correct syntax to get the states of the sensors included in the notification message.
- alias: 'Door Minder'
trigger:
platform: state
entity_id: device_tracker.rpitera_rpitera
from: 'home'
to: 'not_home'
condition:
condition: or
conditions:
- condition: state
entity_id: binary_sensor.front_door
state: 'on'
- condition: state
entity_id: binary_sensor.side_door
state: 'on'
action:
service: notify.pushbullet
data:
message: 'Robert, you left one of the entry doors open. Front Door is {{ states.binary_sensor.front_door }}. Side Door is {{ states.binary_sensor.side_door }}. '
The resulting notification looks like this:
Home Assistant
Robert, you left one of the entry doors open. Front Door is <state binary_sensor.front_door=on; battery_level=100.0, friendly_name=Front Door, sensor_class=opening @ 2016-10-26T11:47:20.130007-04:00>. Side Door is <state binary_sensor.side_door=off; battery_level=100.0, friendly_name=Side Door, sensor_class=opening @ 2016-10-25T19:02:30.464786-04:00>.
when really all I want is:
Home Assistant
Robert, you left one of the entry doors open. Front Door is on. Side Door is off.
Or even better:
Home Assistant
Robert, you left one of the entry doors open. Front Door is on.
But I can’t seem to get it to work