I’m trying to make HA send me an notification as soon as a specific sensor value changes.
The sensor I’m using is the IMAP Email Content sensor.
So I would like to send an HTML5 notification as soon as the state changes (new email arrives), and the notification should include
Subject
state (body from email)
Date
I tried building an automation based on state_changed event, but it wont pass config check
- id: automation 66
alias: 'New Email'
trigger:
platform: event
event_type: state_changed
entity_id: 'sensor.martikainen87gmailcom'
action:
service: notify.html5
data:
message: 'New email: Subject, body, date ata bla bla'
target: 'mattias'
Of course this automation needs some data_template fix, but the big issue is finding out how i can trigger an automation as soon as the sensor updates it’s values, on regular notifications i can always use the change state from “on” to “off” etc, but this state is always different since it contains the body from the email.