Get temperature of next day

Hello,

I would like to create an automation for my floor heating. I don’t want it to heat during the night if the maximum temperature is above 20C the next day.
I can get the following information via the weather service:

temperature: 14.8
humidity: 53
pressure: 1012.8
wind_bearing: 71
wind_speed: 7.4
visibility: 35.6
forecast:
  - datetime: '2022-04-12T00:00:00Z'
    condition: partlycloudy
    temperature: 22
    templow: 13
    precipitation: 0
    wind_bearing: 82.25
    wind_speed: 3.09
    wind_gusts: 6.69
    precipitation_probability: 4
  - datetime: '2022-04-13T00:00:00Z'
    condition: sunny
    temperature: 23
    templow: 10
    precipitation: 0
    wind_bearing: 133.42
    wind_speed: 2.06
    wind_gusts: 5.66
    precipitation_probability: 10

Unfortunately, the field with the date changes daily. Since I am relatively new, I do not know exactly how to implement this. Can someone explain me how I can always read the temperature of the next day?

Thanks a lot

Normally, the first item in the forecast list (the zeroth list index) contains the weather forecast for today and the second item (the first list index) contains the forecast for tomorrow.

Copy-paste this template in the Template Editor and change the entity to match your weather entity. It should report the temperature for tomorrow (23 for the example data you posted).

{{ state_attr('weather.your_weather', 'forecast')[1].temperature }}
2 Likes

Perfect! That’s exactly what I needed. Thanks a lot

1 Like