OpenWeatherMap version 3.0

In the Netherlands we mostly use debit cards. I have money on the bank :wink: Up front.
I also build weather stations . With a LilyGO T5 4.7 inch e-paper display, ESP32 based. Connected to HA or/and stand alone. They still work for now.

Also build one for a person with a mental disorder. Who is ‘over the moon’ happy with the device. Weerstation named in Dutch.
The e-paper display is translated to Dutch. Also the moon phases names.

So hopefully there is a alternative way to pay for a subscription.
Maybe I drop Open Weather a mail or other kind of message.
Or switch to another api provider.

Is there a way to see and/or easily adjust the rate at which the HA integration makes API calls to OpenWeatherMap?

3 Likes

For italians: we can use the MeteoNetwork open data, but it requires some tricks.

Here is explained how (I’m not the author, I’ve only found it). It works, but there are NO FORECASTS. Only current parameters for your location. I suggest using the average for the location that MeteoNetwork provides as an API.

Yeah, changing providers, here. Definitely NOT putting my CC# into their system. BTW, anyone else see “OpenWeatherMap” and assume (like I did for YEARS) that it was “open source, aka free”? Nah, it’s the api interface they’re talking about being “open and callable”. Plenty of other providers out there that truly are free and I’m not running a weather channel, so I don’t need thousands of calls a day.

Did you ever get an answer to this? I would hate to hit the 1000 call limit at 6PM. One call every 3 or 5 minutes would be OK here.

Never mind…

Not yet, but I must admit that I haven’t taken the time to look deeply into the settings, myself.

I wonder if OWM would change the no-charge API conditions to a lower limit and so start charging some of those using it free of charge today.

Forecasts are gone?

I’m seeing this too! Current conditions are showing but all ‘forecast’ entities are ‘unavailable’.

Yes that happened to me as well. I posted another question about this on this forum and someone said they moved to a different sensor object but… that’s not working either

I just did a direct API call, and the word “forecast” does not appear anywhere in the resulting JSON.

Time to abandon OpenWeatherMap I think……

I personally don’t have any issues with the forecast entities, they’re all working fine, but I do see weird behaviour on the temperature entity:

No idea if that’s related to 3.0, or my location, or the HA integration? It was like this on both 2024.6 and 2024.7, and using different api keys (in case that made a difference, which it did not).

Forecast sensors where specifically implemented in the OWM integration. When the whole get_forecasts shenanigans started (main reason being reduction of state size that is transferred to the frontend), someone also deemed these forecast-sensors to be obsolete (which they 100% are not in my opinion).

Long story short after an hour or two I came up with template sensors that basically are a super complicated custom way of recreating the nice default sensors from before. I only need two (min and max temp forecast), so I only added these two template sensors to my yaml:

template:
  - trigger:
      - platform: time_pattern
        minutes: /15
      - platform: homeassistant
        event: start
      - platform: event
        event_type: event_template_reloaded
    action:
      - service: weather.get_forecasts
        target:
          entity_id: weather.openweathermap
        data:
          type: daily
        response_variable: forecast_result
      - variables:
          forecast_today: "{{ forecast_result['weather.openweathermap'].forecast[0] }}"
    sensor:
      - name: Openweathermap Forecast Temperature
        unique_id: openweathermap_forecast_temperature
        state: "{{ forecast_today.temperature }}"
        attributes:
          timestamp: "{{ forecast_today.datetime }}"
        icon: mdi:thermometer
        unit_of_measurement: "°C"
        device_class: temperature

      - name: Openweathermap Forecast Temperature Low
        unique_id: openweathermap_forecast_temperature_low
        state: "{{ forecast_today.templow }}"
        attributes:
          timestamp: "{{ forecast_today.datetime }}"
        icon: mdi:thermometer
        unit_of_measurement: "°C"
        device_class: temperature

weather.openweathermap is the entity id of my OWM weather entity and needs to be replaced with whatever yours is.

As you can see removing those obsolete sensors and replacing them with dozens of lines of yaml code is super easy, barely an inconvenience… :unamused:

1 Like

Thanks @chammp - my sensor was very similar (and it didn’t work) so I’ll make the changes you suggest and try again.

Can you elaborate on what you mean by “my OWM weather entity” - not sure where that name is specified (outside this template)

It’s the entity_id of the open weather map entity that is created by the open weather map integration. Left is the weather entity in the dashboard, right is the config view of that entity where you get the entity id.

Thanks @chammp - your suggested template seems to work. Thank you for creating it!

I added some more (wind, uv etc ) →

      - platform: time_pattern
        minutes: /15
      - platform: homeassistant
        event: start
      - platform: event
        event_type: event_template_reloaded
     action:
      - service: weather.get_forecasts
        target:
          entity_id: weather.openweathermap
        data:
          type: daily
        response_variable: forecast_result
      - variables:
          forecast_today: "{{ forecast_result['weather.openweathermap'].forecast[0] }}"
     sensor:
      - name: Openweathermap Forecast Temperature
        unique_id: openweathermap_forecast_temperature
        state: "{{ forecast_today.temperature }}"
        attributes:
          timestamp: "{{ forecast_today.datetime }}"
        icon: mdi:thermometer
        unit_of_measurement: "°C"
        device_class: temperature

      - name: Openweathermap Forecast Temperature Low
        unique_id: openweathermap_forecast_temperature_low
        state: "{{ forecast_today.templow }}"
        attributes:
          timestamp: "{{ forecast_today.datetime }}"
        icon: mdi:thermometer
        unit_of_measurement: "°C"
        device_class: temperature

      - name: Openweathermap Forecast Condition
        unique_id: openweathermap_forecast_condition
        state: "{{ forecast_today.condition }}"
        attributes:
          timestamp: "{{ forecast_today.datetime }}"

      - name: Openweathermap Forecast Cloud Coverage
        unique_id: openweathermap_forecast_cloud_coverage
        state: "{{ forecast_today.cloud_coverage }}"
        attributes:
          timestamp: "{{ forecast_today.datetime }}"
        unit_of_measurement: "%"  

      - name: Openweathermap Forecast Wind Speed
        unique_id: openweathermap_forecast_wind_speed
        state: "{{ forecast_today.wind_speed }}"
        attributes:
          timestamp: "{{ forecast_today.datetime }}"
        icon: mdi:weather-windy
        unit_of_measurement: "km/h"
        device_class: wind_speed        
      
      - name: Openweathermap Forecast Wind Bearing
        unique_id: openweathermap_forecast_wind_bearing
        state: "{{ forecast_today.wind_bearing }}"
        attributes:
          timestamp: "{{ forecast_today.datetime }}"

      - name: Openweathermap Forecast UV Index
        unique_id: openweathermap_forecast_uv_index
        state: "{{ forecast_today.uv_index }}"
        attributes:
          timestamp: "{{ forecast_today.datetime }}"

      - name: Openweathermap Forecast Precipitation Probability
        unique_id: openweathermap_forecast_precipitation_probability
        state: "{{ forecast_today.precipitation_probability }}"
        attributes:
          timestamp: "{{ forecast_today.datetime }}"

      - name: Openweathermap Forecast Precipitation
        unique_id: openweathermap_forecast_precipitation
        state: "{{ forecast_today.precipitation }}"
        attributes:
          timestamp: "{{ forecast_today.datetime }}"  
        icon: mdi:weather-pouring
        unit_of_measurement: "mm"
        device_class: precipitation

      - name: Openweathermap Forecast Humidity
        unique_id: openweathermap_forecast_humidity
        state: "{{ forecast_today.humidity }}"
        attributes:
          timestamp: "{{ forecast_today.datetime }}"  
        icon: mdi:weather-fog
        unit_of_measurement: "%"
        device_class: humidity
1 Like

Hello,

I have already subscribed to the API v3, but it is still not working. When I try to make the API call, I get the following error:

{"cod":401, "message": "Please note that using One Call 3.0 requires a separate subscription to the One Call by Call plan. Learn more here https://openweathermap.org/price. If you have a valid subscription to the One Call by Call plan, but still receive this error, then please see https://openweathermap.org/faq#error401 for more info."}

How long does it take to become available?