Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Where do I find the forecasts after update to the current version? #77

Closed
slecram opened this issue Sep 22, 2023 · 6 comments
Closed

Where do I find the forecasts after update to the current version? #77

slecram opened this issue Sep 22, 2023 · 6 comments

Comments

@slecram
Copy link

slecram commented Sep 22, 2023

Version of home_assistant

2023.9.2

Where do I find the forecasts after update to the current version?

image

@arboeh
Copy link

arboeh commented Sep 22, 2023

I have the same problem with Home Assistants 'Clock Weather Card'. It doesn't work any more, because the forecast attribute is missing.

@FL550
Copy link
Owner

FL550 commented Sep 22, 2023

Unfortunately it had to be removed due to changes in HA: Forecast Attribute

I primarily suggest, that you inform the developer of your custom card to adapt as well. However I could provide the forecast as a separate sensor if requested.

@FL550
Copy link
Owner

FL550 commented Sep 22, 2023

I reopen this for reference until most of the weather cards have been updated.

@heikone
Copy link

heikone commented Sep 28, 2023

The forecast attribute was a very useful feature for me.
I've used this by the following code:

template:
  - sensor:
      - name: "Temperatur DWD Waltrop Heute Min"
        unique_id: temperatur_dwd_waltrop_forecast_0_temp_min
        state: "{{state_attr('weather.waltrop_abdinghof','forecast')[0]['templow'] | float(0) }}"
        unit_of_measurement: "°C"
        device_class: temperature

Could anybody supply a code example, how to get current day's min and max expected temperature from DWD prediction?

Greetings
Heiko

@slecram
Copy link
Author

slecram commented Sep 29, 2023

template:
  - trigger:
      - platform: time_pattern
        hours: "/1"
      - platform: homeassistant
        event: start
      - platform: event
        event_type: event_template_reloaded
    action:
      - service: weather.get_forecast
        data:
          type: daily
        target:
          entity_id: weather.salzuflen_bad_salzuflen_bad
        response_variable: forecast
    sensor:
      - name: wetter_temp_vorhersage_heute_max
        unique_id: wetter_temp_vorhersage_heute_max
        state: "{{ forecast.forecast[0].temperature}}"
        unit_of_measurement: "°C"
      - name: wetter_temp_vorhersage_heute_min
        unique_id: wetter_temp_vorhersage_heute_min
        state: "{{ forecast.forecast[0].templow}}"
        unit_of_measurement: "°C"

Sorry for the code format but the "code" function doesn't work for me...?

Edit Now it works. First paste the code and after that mark it as code ;-)

@heikone
Copy link

heikone commented Sep 29, 2023

Thanks a lot. That works!

Here, you can find the code:

template:
    - trigger:
          - platform: time_pattern
            hours: "/1"
          - platform: homeassistant
            event: start
          - platform: event
            event_type: event_template_reloaded
        action:
          - service: weather.get_forecast
            data:
              type: daily
            target:
              entity_id: weather.dwd_waltrop_abdinghof
            response_variable: forecast
        sensor:
          - name: "DWD Waltrop-Abdinghof Vorhersage Heute Max"
            unique_id: dwd_waltrop_abdinghof_forecast_today_max
            state: "{{ forecast.forecast[0].temperature}}"
            unit_of_measurement: "°C"
          - name: "DWD Waltrop-Abdinghof Vorhersage Heute Min"
            unique_id: dwd_waltrop_abdinghof_forecast_today_min
            state: "{{ forecast.forecast[0].templow}}"
            unit_of_measurement: "°C"

Greetings,
Heiko

@FL550 FL550 closed this as completed Oct 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants