I setup HA automation to trigger when a ping binary sensor goes from On to Off. When I setup the automation.yaml with static text in the message field the trigger generates an e-mail.
This configuration works:
- alias: MonitorDevice
trigger:
- platform: state
entity_id: binary_sensor.samsung_printer
from: 'on'
to: 'off'
action:
- service: notify.email_greg
data:
message: "Device"
title: "Device"
When I change data to data_template so I can pass in the entity name, the e-mail fails to be sent
- alias: MonitorDevice
trigger:
- platform: state
entity_id: binary_sensor.samsung_printer
from: 'on'
to: 'off'
action:
- service: notify.email_greg
data_template:
message: "{{ trigger.entity_id }}"
title: "Device"
This error is in the log:
Invalid service data for notify.email_greg: required key not provided @ data['message']. Got None
Any ideas? I’m running HA 0.62.1 on a Pi3 using raspbian