Sorry can i ask you a question about this.
My implementation
is basically the same but the “daily” forecast for today (i also pull from *.forecast[0]) seems to be very inconsistent and very low in the morning and very high at noon, for Example:
- get_forecast at 1am: temperature = 17°C
- get_forecast at 5pm: temperature = 23°C
I would have expected the daily forecast to give me (nearly) the same values throughout the whole day but this seems to change drastically
I always try to gather todays max temperature at 1am in the morning to de/activate all automations related to todays temperature
So my current guess is, that this is not the max temperature of the day, but some sort of mean temperature?
What i will check next
- Get an hourly forecast
- Extract the max temperature of the coming 24 values/hours
Taken from the examples above (AND NOT YET TESTED) i think about something like this:
template:
- trigger:
- platform: time_pattern
hours: /1
- platform: event
event_type: event_template_reloaded
action:
- variables:
w: weather.home
- service: weather.get_forecasts
data:
type: hourly
target:
entity_id: '{{ w }}'
response_variable: r
sensor:
- name: 'Temperature Max'
unique_id: 'temperature_max'
unit_of_measurement: '°C'
device_class: temperature
state: >
{{ r[w].forecast[:24] | map(attribute='temperature')
| reject('string') | max }}
My Question
So my basic question is, what exactly did i not understand about the daily forecast of met.no. I am guessing that i did not understand what daily forecast[0] really is
Thank you
EDIT:
From what i saw here : Definitive guide to Weather integrations - Community Guides - Home Assistant Community
The met.no service anyways returns only 24 values for a whole day
So i can use the unchanged example (without [:24]) and will get my expected result.
I think the bottomline is:
Use the HOURLY weather report to get the DAILY max-temp as posted above
This was what confused me in the first place i think
See the quote above? The HOURLY weather forecast is used, but the temperature_max returned is DAILY
Am i right?