I’ve been trying for a week to to get the days forecasted high from accuweather for automations. I’ve read all the post (most out of date) and tried all the code and tweaks I could find but nothing works.
1- Accuweather shows you the forecasted high for the next five days in graphic form but of the 167 entities none of them are forecasted high. There is a real feel max but I want the unadjusted temp.
2- with the most current code I keep getting variable undefined error.
template:
- trigger:
- platform: time_pattern
hours: /1
action:
- action: weather.get_forecasts
data:
type: daily
target:
entity_id: weather.accuweather
response_variable: high temp
sensor:
- name: forecasted high
unique_id: temperature_forecast_high
state: "{{ high temp['weather.accuweather'].forecast[0].temperature }}"
unit_of_measurement: °F
There has got to be an easier way to do this.
I’ve also called the service (action) and get this response.
weather.accuweather:
forecast:
- datetime: "2024-08-22T14:00:00+00:00"
cloud_coverage: 10
precipitation_probability: 0
uv_index: 9
wind_bearing: 210
condition: sunny
temperature: 90
apparent_temperature: 92
templow: 54
wind_gust_speed: 26.47
wind_speed: 9.2
precipitation: 0
humidity: 35
- datetime: "2024-08-23T14:00:00+00:00"
cloud_coverage: 2
precipitation_probability: 1
uv_index: 9
wind_bearing: 209
condition: sunny
temperature: 85
apparent_temperature: 88
templow: 53
wind_gust_speed: 22.99
wind_speed: 9.2
precipitation: 0
humidity: 39
- datetime: "2024-08-24T14:00:00+00:00"
cloud_coverage: 0
precipitation_probability: 1
uv_index: 9
wind_bearing: 216
condition: sunny
temperature: 84
apparent_temperature: 87
templow: 56
wind_gust_speed: 19.57
wind_speed: 8.08
precipitation: 0
humidity: 38
- datetime: "2024-08-25T14:00:00+00:00"
cloud_coverage: 0
precipitation_probability: 0
uv_index: 9
wind_bearing: 257
condition: sunny
temperature: 91
apparent_temperature: 97
templow: 62
wind_gust_speed: 14.98
wind_speed: 5.78
precipitation: 0
humidity: 28
- datetime: "2024-08-26T14:00:00+00:00"
cloud_coverage: 0
precipitation_probability: 0
uv_index: 9
wind_bearing: 241
condition: sunny
temperature: 97
apparent_temperature: 101
templow: 58
wind_gust_speed: 17.27
wind_speed: 5.78
precipitation: 0
humidity: 22
What’s listed as temperature is in fact the forecasted high for the day.
what you said is, i believe correct. the forecasted high is labeled as temperature… unadjusted.
so i think your code is generally correct. i’m not positive what issue you are having… but one guess is that maybe you’re not waiting for the top of the hour? you have your time pattern to be /1. which means it only queries at the top of the hour.
if that’s the issue, you could add:
- platform: homeassistant
event: start
as a trigger then reboot home assistant, and then it’ll query after it’s started…
I am not 100% sure but I guess it is the ‘space’ between high and temp…try to use a underscore in both locations?