The only entity available from the met.no integration is weather.forecast_home, there is no other entity created, however it seems the hourly forecast data is available, because I can display it with the forecast_type=hourly in lovelace.
My goal is to get the hourly forecast on an e-ink and therefore I need to get access to the data, I could not find an api call or entity that returns the data. Checking github issues or this forum yields some suggestions with a second _hourly entity however that is not present in my HA, restarting HA and reinstalling met.no did not help either.
Home Assistant 2023.9.2
Supervisor 2023.09.2
Operating System 10.5
Frontend 20230911.0 - latest
I canāt get this to work. Do I have to copy the code from you into a template helper or into the configuration YAML. I always get the message that forecast is not defined.
Does this work in the latest HA? I tried the same template (with my met.no sensor name) but it does not work.
Running it in dev tools returns āāhourlyā is undefinedā.
Iām just looking for the hourly forecast in a similar way it was previously available in a separate sensor.
That was last month.
weather.get_forecast has changed to weather.get_forecasts
At the time of writing, the following config is now working for me
template:
###### to call weather forecast service to get hourly into a new entity Dec 2023 #####
- trigger:
- platform: time_pattern
hours: "/1"
action:
- service: weather.get_forecasts
data:
type: hourly
target:
entity_id: weather.forecast_home
response_variable: hourlyforecast
sensor:
- name: "Forecast Home Hourly"
unique_id: bis202312041810
icon: mdi:weather-cloudy-clock
state: "{{ now().isoformat() }}"
attributes:
forecast: "{{ hourlyforecast['weather.forecast_home']['forecast'] }}"
The new call now returns a list of forecasts, and the id contains a ā.ā, hence the need for the more complex [ - ] referencing to get at the values.
Thank you, Iāve got it working now. Iām sure thereās a good reason for the change, but for this specific case it made things unnecessarily complicated just to get the forecast.
Just a note to all of you (or my future self that rediscovers this thread) -
When you edit your YAML files and add the trigger/sensors, they refresh at the top of the hour. Put differently - if you add the sensor and then restart HA donāt expect it to populate hourly forecast data until the top of the hour if your hours value is set to /1.
After troubleshooting this and finally putting it down in frustration I came back after the top of the our and BOOM there are the values.