Precipitation_Probability with .get_forecasts

Hi,

First time asking for help here, so go gentle on me!

Trying to do something which I’d have thought would be super simple but having no luck at all. I’m trying to get the probability it will rain tomorrow (or otherwise) in order to inform wether to run an automated watering system or not.

I’ve modified a template from the official docs at Weather - Home Assistant (Example template sensor using get_forecasts) and come up with the following:

  - trigger:
      - platform: time_pattern
        hours: /1
    action:
      - action: weather.get_forecasts
        data:
          type: daily
        target:
          entity_id: weather.forecast_home
        response_variable: daily
    sensor:
      - name: Rain Probability Tomorrow
        unique_id: rain_probability_tomorrow
        state: "{{ daily['weather.forecasthome'].forecast[1].precipitation_probability }}"
        unit_of_measurement: "%"

This continutes to report ‘unknown’ pretty much however I tweak it or change it, and I can’t really see anything wrong.

So questions 2 really:

  1. what have I got wrong? if it’s glaringly obvious to anyone
  2. how can I sensibly go about debugging this, is there an obvious place in the logs which will show when this template runs what data is being returned (or otherwise) in the ‘daily’ response variable or report what’s not working correctly.

Thanks for all your help, I’m still getting my head around a lot of this stuff.

Mark

target:
  entity_id: weather.forecast_home
----------------------------^^^

but

state: "{{ daily['weather.forecasthome'].forecast[1].precipitation_probability }}"
--------------------------------^^^

Hi,

Fairly sure that was just a typo when putting back the last thing I tried (which didn’t work) before copying into the forum, but will correct that now and check it.

As expected, that’s not made any difference (although as you say it definitely wouldn’t have worked like that) - any other ideas?

Thanks,

Mark