Automation with DarkSky Help

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 }}

in the dev tools does notify.me show as a valid service??

It is. I do use it in other automations also so I think that’s working correctly.

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?

@pnbruckner Yeah that’s a copy paste error. I don’t see any errors in the error log and nothing seems to happen when I manually trigger it.

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.

@pnbruckner It was the percent sign. Tricky symbols. Works now when I manually trigger, thanks for your help.

1 Like