'weather.get_forecast' is deprecated

Hello all,

since HA version 2023.12.X I get these Warnings in my log:

2023-12-19 10:30:13.908 WARNING (MainThread) [homeassistant.components.weather] Detected use of service 'weather.get_forecast'. This is deprecated and will stop working in Home Assistant 2024.6. Use 'weather.get_forecasts' instead which supports multiple entities
2023-12-19 10:30:13.928 WARNING (MainThread) [homeassistant.components.weather] Detected use of service 'weather.get_forecast'. This is deprecated and will stop working in Home Assistant 2024.6. Use 'weather.get_forecasts' instead which supports multiple entities

These warnings are pretty self explained. Therefore I changed my template from this:

template:
  - trigger:
      - platform: state
        entity_id: weather.openweathermap_hourly
    action:
      - service: weather.get_forecast
        data:
          type: hourly
        target:
          entity_id: weather.openweathermap_hourly
        response_variable: hourly
    sensor:
      - name: Weather Forecast Hourly
        unique_id: weather_forecast_hourly
        state: "{{ now().isoformat() }}"
        attributes:
          forecast: "{{ hourly.forecast }}"
  - trigger:
      - platform: state
        entity_id: weather.openweathermap
    action:
      - service: weather.get_forecast
        data:
          type: daily
        target:
          entity_id: weather.openweathermap
        response_variable: daily
    sensor:
      - name: Weather Forecast Daily
        unique_id: weather_forecast_daily
        state: "{{ now().isoformat() }}"
        attributes:
          forecast: "{{ daily.forecast }}"

to this

template:
  - trigger:
      - platform: state
        entity_id: weather.openweathermap_hourly
    action:
      - service: weather.get_forecasts
        data:
          type: hourly
        target:
          entity_id: weather.openweathermap_hourly
        response_variable: hourly
    sensor:
      - name: Weather Forecast Hourly
        unique_id: weather_forecast_hourly
        state: "{{ now().isoformat() }}"
        attributes:
          forecast: "{{ hourly['weather.openweathermap_hourly'].forecast }}"
  - trigger:
      - platform: state
        entity_id: weather.openweathermap
    action:
      - service: weather.get_forecasts
        data:
          type: daily
        target:
          entity_id: weather.openweathermap
        response_variable: daily
    sensor:
      - name: Weather Forecast Daily
        unique_id: weather_forecast_daily
        state: "{{ now().isoformat() }}"
        attributes:
          forecast: "{{ daily['weather.openweathermap'].forecast }}"

Sadly these warnings are still shown and doesn’t disappear.

I also searched for any automation or template which is using this deprecated service ‘weather.get_forecast’, but I can’t find it.

Is it possible that this warning is buggy or is there any problem on my site?

1 Like

Did you try restarting Home Assistant instead of reloading templates?

Yes, I also restarted the complete HA OS.

Try searching your entire config directory (VSCode is good for this).

Just did a search through the files.

As you can see, the only matching results are already updated to “weather.get_forecasts”

image

1 Like

Could be.

If it’s designed to simply search for the string weather.get_forecast then it will find a match in weather.get_forecasts.

1 Like

Please report this as a new issue here:

Done: ‘weather.get_forecast’ is deprecated - false warning inside the ha log · Issue #106097 · home-assistant/core · GitHub

1 Like

@tom_l Thank you for your time. I found the issue on my system.

It seems like, that the “Studio Code addon” didn’t saved my file changes.