I’ve been trying to get this automation working for a few weeks and I’m having no luck. Any chance someone can take a peek and let me know what I’m doing wrong?
- alias: 'Proactive Future Rain Notification'
trigger:
- platform: state
entity_id: binary_sensor.gonna_rain
from: "off"
to: "on"
action:
- service: notify.me
data_template:
title: "Storm nearby"
message: "Percipitation Probability is at {{states.sensor.dark_sky_precip_probability.state}}%. Nearest storm is {{states.sensor.dark_sky_nearest_storm_distance.state}} miles away."
The binary sensor looks like this and does work when I’ve checked it (when it’s raining the sensor is on)
- platform: template
sensors:
gonna_rain:
friendly_name: "Is it Going to Rain?"
value_template: >-
{{ states.sensor.dark_sky_nearest_storm_distance.state|float < 9 and states.sensor.dark_sky_precip_probability.state|float > 80 }}
Are you getting any errors related to this automation? If you’ve copied it exactly as it is entered in your YAML file, then you’ve got an indentation error. It should be:
- alias: 'Proactive Future Rain Notification'
trigger:
- platform: state
entity_id: binary_sensor.gonna_rain
from: "off"
to: "on"
action:
- service: notify.me
data_template:
title: "Storm nearby"
message: "Percipitation Probability is at {{states.sensor.dark_sky_precip_probability.state}}%. Nearest storm is {{states.sensor.dark_sky_nearest_storm_distance.state}} miles away."
If, however, that was just a copy and paste error, and it’s entered correctly in your YAML file, then you can check the action part by manually triggering the automation. If you manually trigger it, do you get the notification?
Sounds like either you notification system isn’t set up correctly, or there’s something about the message it doesn’t like. I seem to recall recently where someone had an issue where if the message had a particular character in it, it wouldn’t work. It was very strange. I’d suggest you try getting the notification to work from the Services page. Also, just for grins, try removing the percent sign.