Openweathermap - how to get High/low Temp of the current day?

Hello,

i tried with openweathermap to get the highest temperature and the lowest temperature of TODAY.

but it seems that its not possible?

temperature: 21.7
humidity: 63
pressure: 1015
wind_bearing: 149
wind_speed: 6.98
forecast:
  - datetime: '2022-06-29T12:00:00+00:00'
    precipitation: 0.28
    precipitation_probability: 29
    pressure: 1015
    wind_speed: 2.51
    wind_bearing: 123
    condition: rainy
    clouds: 86
    temperature: 21.7

or gives another integration where this is provided?

Hi, I had exactly the same question. I use the “meteorologisk institutt (met.no)” integration. That integration has the minimum and maxiumum temperatures, but unfortunately only in the forecast.

So, I developed the following solution.

  1. Create sensors that take the min/max values for tomorrow from the Met.no integration
    (in configuration.yaml)
template:
  - sensor:
      - name: "weather_home_min_temp_tomorrow"
        state: >
          {{ state_attr('weather.home_met_no', 'forecast')[0].templow }}
        device_class: temperature
        state_class: measurement
        unit_of_measurement: °C
      - name: "weather_home_max_temp_tomorrow"
        state: >
          {{ state_attr('weather.home_met_no', 'forecast')[0].temperature }}
        device_class: temperature
        state_class: measurement
        unit_of_measurement: °C
  1. Create helpers to store the values for today’s min/max
    (in configuration.yaml)
input_number:
  weather_home_min_temp_today:
    name: "home minimum temperature today"
    min: -30
    max: 50
    step: 0.1
    unit_of_measurement: °C

  weather_home_max_temp_today:
    name: "home maximum temperature today"
    min: -30
    max: 50
    step: 0.1
    unit_of_measurement: °C
  1. Create an automation that transfers the min/max values for tomorrow to the min/max today helpers (eg. just before midnight)
    (in automations.yaml)
- alias: "At 23:00 transfer forecast minimum and max temperature to today sensor"
  id: '39c677d6-5f19-4dbe-93cd-40c21cbf893b'
  description: ""
  trigger:
  - platform: time
    at: '23:00'
  condition: []
  action:
    - service: input_number.set_value
      data_template:
        value: >
          {{ states('sensor.weather_home_min_temp_tomorrow') | float() }}
      target:
        entity_id: input_number.weather_home_min_temp_today
    - service: input_number.set_value
      data_template:
        value: >
          {{ states('sensor.weather_home_max_temp_tomorrow') | float() }}
      target:
        entity_id: input_number.weather_home_max_temp_today        
  mode: single

Result: you now have today’s min & max temperatures in the helpers: input_number.weather_home_min_temp_today
input_number.weather_home_max_temp_today

Hope this helps.

2 Likes

Sorry to open up an older thread, but if you enable the ‘Hourly’ entity for it, it will show the high/low for the day in the card.

square: false
columns: 1
type: grid
cards:
  - show_current: true
    show_forecast: true
    type: weather-forecast
    entity: weather.yourhaname_hourly

of course you need to change the ‘yourhaname’ for yours…

1 Like

I’m not sure I totally understand this. How do you enable the hourly function?
Do you create a new sensor? But how?
And you are talking of Openweathermap right? Why are you using weather.yourhaname_hourly.
what integration is that from?
Thanks

its a disabled sensor you can enable
image

1 Like

Anyone noticed that met.no seems to have stopped providing the daily lows?
(edit: they show in the integration but they’re not coming through in Node Red for some reason…)

EDIT: Answer over here: Get Temperature from weather.home in Node red? - #12 by Biscuit