#Meteorologisk institutt (Met.no) integration for weather forecast hourly template

5 messages · Page 1 of 1 (latest)

earnest furnace
#

Hi all,
I'm using the Meteorologisk institutt (Met.no) integration for weather forecast.
The hourly forecast can be seen within the frontend but not using the attribute template anymore.
Few months ago I could extract the maximum temperature using the below template.

state: "{{ [state_attr('weather.forecast_home_hourly','forecast')[0].temperature|round(1), state_attr('weather.forecast_home_hourly','forecast')[1].temperature|round(1), state_attr('weather.forecast_home_hourly','forecast')[2].temperature|round(1), state_attr('weather.forecast_home_hourly','forecast')[3].temperature|round(1),state_attr('weather.forecast_home_hourly','forecast')[4].temperature|round(1), state_attr('weather.forecast_home_hourly','forecast')[5].temperature|round(1), state_attr('weather.forecast_home_hourly','forecast')[6].temperature|round(1), state_attr('weather.forecast_home_hourly','forecast')[7].temperature|round(1), state_attr('weather.forecast_home_hourly','forecast')[8].temperature|round(1), state_attr('weather.forecast_home_hourly','forecast')[9].temperature|round(1) ] | map('float') | max }}"

Unfortunately, this is not working anymore.
I would appreciate any help you can give me.

waxen drift
earnest furnace
#

Thanks.
It is very sad that it doesn't have it anymore.
Can I ask that in the next versions it will appear?
If not, do you have a suggestion on how to retrieve the maximum temperature for the day and also the amount of precipitants (for another automation)?

waxen drift
#

The attribute will likely not come back.
At the bottom of the docs are examples how to create a template sensor in yaml extracting something from the forecast response. You would have to look at the responses in the dev tools to see, what met.no provides.

earnest furnace
#

Hi Jorg,
Thanks for the answer.
I put the following into the config. yaml in order to have two sensors (1st for the next hour (as in your webpage, and the 2nd for the max temperature for the upcoming 9 hours).
the 1st seems to be working, however, the 2nd is not retrieving any data.
what am I missing?

  - trigger:
      - trigger: time_pattern
        hours: /1
    action:
      - action: weather.get_forecasts
        data:
          type: hourly
        target:
          entity_id: weather.forecast_home
        response_variable: hourly
    sensor:
      - name: Temperature forecast next hour
        unique_id: temperature_forecast_next_hour
        state: "{{ hourly['weather.forecast_home'].forecast[0].temperature }}"
        unit_of_measurement: °C
      - name: max_temperature_for_today
        unique_id: "max_temperature_for_today"
        unit_of_measurement: "°C"
        state: "{{ [hourly['weather.forecast_home'].forecast[0].temperature|round(1), hourly['weather.forecast_home'].forecast[1].temperature|round(1), hourly['weather.forecast_home'].forecast[2].temperature|round(1), hourly['weather.forecast_home'].forecast[3].temperature|round(1), hourly['weather.forecast_home'].forecast[4].temperature|round(1), hourly['weather.forecast_home'].forecast[5].temperature|round(1), hourly['weather.forecast_home'].forecast[6].temperature|round(1), hourly['weather.forecast_home'].forecast[7].temperature|round(1), hourly['weather.forecast_home'].forecast[8].temperature|round(1), hourly['weather.forecast_home'].forecast[9].temperature|round(1) ] | map('float') | max }}"
        ```
How can I check the template from the dev tools in case that the hourly response_variable is only internal to the action that is running?