Platinum Weather Card support

It’s not the card that needs to change though, you need to sort out your weather integration.

Thanks for the pointer Dave. I removed the “Entity Forecast Icon 1” entity in the “Daily Forecast Section” and it all worked again.

Is anyone using this card with OpenWeathermap Integration? After updating HA, my card no longer displays, but I can get it to display by removing the forecast icon 1 entity - however my 5 day forecast section no longer displays anything at all. I’ve been reading through various threads on here about the weather forecast attribute deprecation, but struggling a little to figure out exactly what I need to set up in terms of a new weather sensor (trigger) to give me the 5 day forecast to use with this card? I can call the weather.get_forecasts service from the Developer Tools section against the weather.openweathermap entity, and it successfully returns the full 7 day forecast in the response - I’m just not sure how to store this data (I believe as a forecast attribute in a new sensor) and reference it with this card to display just the 5 days forecast of condition and min/max temp like I was doing before the update. Can anyone help please?

1 Like

What should such a definition look like?
That’s not how it works
weather.get_forecast_icon_1: weather.openweathermap

Samer here. Card disapeared. After new configuration, forecast doesnt work anymore.

Hi @jhandschick @Scoff
In case you haven’t come across the 2024.4 change, HA no longer provides “forecast” as an attribute in the weather entity. All weather integrations are suppose to be updated in a way that they can continue to provide forecast data (using service calls or subscribe methods), its just that forecast data will no longer be provided as an attribute of the weather entity. Similarly all weather based Lovelace cards are suppose to be updated so that they can get forecast data using new methods. The PWC however has not been updated for this. So if you have PWC configured with weather.xxxxx for anything regarding forecast, then things will no longer work. This has been an issue for several months now when HA announced they were going to do this.

However, from what I know, there are 3 possible options:

  1. a) Create your own “trigger” based template sensors that contain the forecast information. There are several Forum Threads on how to do this. Here is an example (ignore the stuff about rounding forecast data) . This will create a sensor that contains the forecast data (as an attribute) for multiple days.
    b) PWC can NOT use this sensor directly. In order to use PWC, then for a given forecast item, say condition, you have to create multiple template sensors from the sensor you created in 1a), one for each day’s “condition”, and give each sensor the same name, but ending with a numerically increasing number such as 1,2,3,4,5 for five days worth of weather forecast conditions (example: sensor.forecast_condition1, sensor.forecast_condition2, … and then configure PWC with the first one and it will go looking for the next ones).

  2. Create your own template sensor same as 1a), and then create a template weather entity from this sensor. A Template weather entity appears to be an exception to the rule that it still supports forecast as an attribute, although it is specific to daily (or hourly or twice daily) forecasts. This may or may not work as the Template Weather entity may no like the format of the data.

  3. If all else fails, you are welcome to try out my forked version of the PWC which supports the new methods for getting forecast data. I don’t plan on supporting/maintaining it (as I hope the original author of PWC will be able to update his original), but like I said, you’re welcome to try it out.

7 Likes

Hi all
I’ve been using Platinum Weather Card (combination of BOM and local personal weather station for sensors) for a while but over last month or so I have ONE problem that I’d appreciate suggestions to fix please
ie ICON displays (main and days forecast)
a. If I follow the setup for main (Overview Section) day forecast, system shows generic yellow missing icon. ie ‘entity_forecast_icon: sensor.bangalow_mdi_icon_0

But if I replace that entry with the generic BOM ‘entity_forecast_icon: weather.bangalow’ it displays correctly.

Daily Forecast Icons likewise are not being displayed (just generic yellow !), correctly (I think) set as ‘entity_forecast_icon_1: sensor.bangalow_mdi_icon_1

Its got to be something simple no doubt - but solution eludes me & hope someone can nudge me in right direction please?

@wmaker - Thank you very much for that explanation - I finally understand what needs to be implemented now, after reading various other threads and still being left a little confused. I’m going to go with option 1. I was on the right lines and created a trigger based sensor already which works, but my attributes: forecast section is simply:

attributes:
  forecast: "{{ daily['weather.openweathermap'].forecast }}"

This gives the trigger based sensor attributes in the exact same format as the response when the weather.get_forecasts service is called manually against the Openweathermap entity:

Will this work OK for creating my various daily template sensors as per 1.b above? Or should I change my attributes section to match the example that you linked to, i.e

attributes:
  forecast: >
    {% set ns = namespace(forecast=[]) %}
    {% for d in daily[entity_id]['forecast'] %}
    {% set ns.forecast = ns.forecast +
    [{
      "condition": d.condition,
      "datetime": d.datetime,
      "wind_bearing": d.wind_bearing,
      "temperature": d.temperature | round(0, default=-99),
      "templow": d.templow | round(0, default=-99),
      "wind_speed": d.wind_speed | round(0, default=-99),
      "precipitation": d.precipitation,
      "humidity": d.humidity
    }] %}
    {% endfor %}
    {{ ns.forecast }}

It looks like the above was mainly suggested for the rounding of certain values (which you mentioned to disregard). If it makes any difference, I will be looking to create template weather for condition, high temp and low temp, just for the purpose of this PWC, for the next 5 days.

[EDIT] For step 1b), when using sensors in a PWC configuration, PWC primarily uses the sensor’s state and not its attribute, so it won’t use the sensor’s forecast as an attribute.

See if this post above helps explain things.

Thanks a ton for forking and fixing this card! I finally have my weather card back to how I had/wanted it months ago; I’d just about given up on using it.

Have you reached out to the original author to look at rolling your fixes/updates into the original or considered actively maintaining your fork? I’m just now seeing it hasn’t been updated for 2 years (I could have sworn it had a more recent update). It’d be a shame for this card to just die if there’s a future breaking-change.

1 Like

Hi.
Could you give an example of creating multiple template sensors described in point 1b?

In my case I don’t use template sensors anymore, but I think it would be something like the following (try it and see if it works for you):

Let’s say you created a template sensor using 1a) that shows in the developer’s tools as:

sensor.weather_forecast_daily
w. attributes:

friendly_name: Weather Forecast Daily
forecast: 
- detailed_description: >-
    We could see an early morning shower, otherwise look out for patchy fog this
    morning.  We'll be mostly cloudy for much of the day, but we could see some
    peeks of sun later this afternoon.  Highs in the upper 70s to lower 80s.For
    the night: Mostly cloudy and turning cooler. Our southern counties could see
    showers this evening.  Lows fall into the low 50s.
  wind_bearing: 0
  precipitation_probability: 20
  datetime: '2024-04-20T06:00:00-04:00'
  condition: cloudy
  temperature: 75
  templow: 52
  wind_speed: 9

  ... this is a list so it repeats for the forecasts for the next several days...

Then for 1b) you can create several sequential forecast sensors representing the next several days and you can add your own attributes to each sensor. Using configuration.yaml, it might look something like:

template:   
  - sensor:
     - name: "my forecast details1"
       unique_id: 2377501
       state: "{{ states.sensor.weather_forecast_daily.attributes.forecast[0]['condition'] }}"        
       attributes:
         text: >
           {{ states.sensor.weather_forecast_daily.attributes.forecast[0]['detailed_description'] }}
     - name: "my forecast details2"
       unique_id: 2377502
       state: "{{ states.sensor.weather_forecast_daily.attributes.forecast[1]['condition'] }}"        
       attributes:
         text: >
           {{ states.sensor.weather_forecast_daily.attributes.forecast[1]['detailed_description'] }}
     - name: "my forecast details3"
       unique_id: 2377503
       state: "{{ states.sensor.weather_forecast_daily.attributes.forecast[2]['condition'] }}"        
       attributes:
         text: >
           {{ states.sensor.weather_forecast_daily.attributes.forecast[2]['detailed_description'] }}  

        etc.etc.....

In the PWC Card editor, for a particular config, you simply select sensor.my_forecast_details1, and PWC will find the others.

I’ve downloaded the forked PWC, and also tried setting up 1b) so that I have template sensors for condition, temperature, and min temperature for the next 5 days. All this information is pulling through to the new template sensors from my trigger sensor fine:

I’m not able to utilise the attributes from these new sensors in the forked PWC, unless I’m doing something wrong? I can only use the states, so I am getting the condition for each day, but trying to use the attributes for min/max temp results in NaN displaying, as I can only specify the sensor and not the sensors attributes for each config field in the card.

image

Should attributes be able to be used in this card in this way, like in the examples template sensors above, or do I need to create a sensor with a state for each item I want to target, rather than attributes?

I think my answer to you above was misleading/incorrect. When using sensors in a PWC configuration, PWC almost always uses the state of the sensor. There are a couple of configs where you can configure PWC to use attributes of a sensor instead of state, but otherwise it only uses state, so sorry for being incorrect about that, so I will edit my answer above.

BTW, you don’t need the forked PWC to use sensors.

Ah I see, thanks for clarifying. In that case I’ll add to my new sensors and create more new ones, each with a state only, and no attributes, so that i can use each sensor for each piece of data. I will have a sensor for tomorrow’s condition, one for tomorrow’s low temp, and one for tomorrow’s high temp, and the repeat for each of the 5 days that i need. Seems like a lot of new sensors, but if that’s what is needed to continue to use this card then so be it!

OK. I’ve created all of the new template sensors, so that I have a sensor for the condition, min temp and max temp for each of the 5 days that I get data for in my weather forecast. These sensors are getting state values correctly.

    - name: "forecast condition 1"
      unique_id: 1234561
      state: "{{ states.sensor.weather_daily_forecast.attributes.forecast[0]['condition'] }}"

    - name: "forecast temp high 1"
      unique_id: 1234562
      state: "{{ states.sensor.weather_daily_forecast.attributes.forecast[0]['temperature'] }}"

    - name: "forecast temp low 1"
      unique_id: 1234563
      state: "{{ states.sensor.weather_daily_forecast.attributes.forecast[0]['templow'] }}"

    - name: "forecast condition 2"
      unique_id: 1234564
      state: "{{ states.sensor.weather_daily_forecast.attributes.forecast[1]['condition'] }}"

    - name: "forecast temp high 2"
      unique_id: 1234565
      state: "{{ states.sensor.weather_daily_forecast.attributes.forecast[1]['temperature'] }}"

    - name: "forecast temp low 2"
      unique_id: 1234566
      state: "{{ states.sensor.weather_daily_forecast.attributes.forecast[1]['templow'] }}"

    - name: "forecast condition 3"
      unique_id: 1234567
      state: "{{ states.sensor.weather_daily_forecast.attributes.forecast[2]['condition'] }}"

    - name: "forecast temp high 3"
      unique_id: 1234568
      state: "{{ states.sensor.weather_daily_forecast.attributes.forecast[2]['temperature'] }}"

    - name: "forecast temp low 3"
      unique_id: 1234569
      state: "{{ states.sensor.weather_daily_forecast.attributes.forecast[2]['templow'] }}"

    - name: "forecast condition 4"
      unique_id: 12345610
      state: "{{ states.sensor.weather_daily_forecast.attributes.forecast[3]['condition'] }}"

    - name: "forecast temp high 4"
      unique_id: 12345611
      state: "{{ states.sensor.weather_daily_forecast.attributes.forecast[3]['temperature'] }}"

    - name: "forecast temp low 4"
      unique_id: 12345612
      state: "{{ states.sensor.weather_daily_forecast.attributes.forecast[3]['templow'] }}"

    - name: "forecast condition 5"
      unique_id: 12345613
      state: "{{ states.sensor.weather_daily_forecast.attributes.forecast[4]['condition'] }}"

    - name: "forecast temp high 5"
      unique_id: 12345614
      state: "{{ states.sensor.weather_daily_forecast.attributes.forecast[4]['temperature'] }}"

    - name: "forecast temp low 5"
      unique_id: 12345615
      state: "{{ states.sensor.weather_daily_forecast.attributes.forecast[4]['templow'] }}"

I am using these new sensors in the config for the forked PWC, and my card config is :

card_config_version: 8
daily_forecast_days: 5
daily_forecast_layout: horizontal
entity_apparent_temp: sensor.openweathermap_feels_like_temperature
entity_forecast_icon: sensor.openweathermap_condition
entity_forecast_icon_1: sensor.forecast_condition_1
entity_forecast_max: sensor.forecast_temp_high_1
entity_forecast_max_1: sensor.forecast_temp_high_1
entity_forecast_min: sensor.forecast_templow_1
entity_forecast_min_1: sensor.forecast_templow_1
entity_humidity: sensor.openweathermap_humidity
entity_pop: sensor.openweathermap_forecast_precipitation_probability
entity_pos: sensor.openweathermap_forecast_precipitation
entity_sun: sun.sun
entity_temperature: weather.openweathermap
entity_uv_alert_summary: sensor.openweathermap_uv_index
entity_wind_speed: weather.openweathermap
forecast_type: daily
option_color_fire_danger: false
option_locale: london
option_time_format: 12hour
section_order:
  - overview
  - extended
  - slots
  - daily_forecast
show_section_extended: false
slot_l1: forecast_max
slot_l2: humidity
slot_l3: wind
slot_l4: sun_next
slot_l5: remove
slot_l6: remove
slot_l7: remove
slot_l8: remove
slot_r1: forecast_min
slot_r2: popforecast
slot_r3: uv_summary
slot_r4: sun_following
slot_r5: remove
slot_r6: remove
slot_r7: remove
slot_r8: remove
type: custom:platinum-weather-card
weather_entity: weather.openweathermap

however the card is not showing up:

If I uncheck the ‘Daily Forecast Section’ then this shows:

So I guess there are a couple of issues here, but what should I be using as the ‘weather entity with forecasts’ in the Daily Forecast Section configuration? I only have one weather entity, which is my weather.openweathermap entity, which is the one that gets called by my trigger, and this populates my sensor.weather_daily_forecast sensor:

Since you using my forked version…
it looks to me like openweathermap is a native HA integration, so it should be supporting the new subscribe methods for getting forecasts data. My forked PWC added these new subscribe methods so that a weather entity could still be used by PWC to get forecast data (these subscribe methods are kinda like the service call weather.get_forecasts). So you shouldn’t need all those sensors derived/created using the get_forecasts service call. I would say If you have time to play with this, then save away (copy/paste) your PWC yaml config for safe keeping, and then try configuring pretty much all PWC entities with weather.openweathermap and see if it works (start with just the slots section first to see if it works, then proceed on to the daily section. Make sure you at least have one yaml config: weather_entity: weather.openweathermap

Back to the sensors question …
It looks like the warning: entity_pop=sensor.openweathermap_forecast_precipitation_probability value needs to have a number is a bug introduced in my forked version. entity_pop shouldn’t require a number. The workaround is to add yet another template sensor with a number in it, or go back to the original PWC.

Thanks for the explanation @wmaker - I’ve created a new forked PWC on a test dashboard and configured using the weather.openweathermap entity for each of the slots, overview and daily forecast section fields, and that works! As straightforward as that - I’m not sure why I struggled so much, but reading through this topic and several others, I figured I needed to create a bunch of new weather sensors regardless of the card.

The entity_pop=sensor.openweathermap_forecast_precipitation_probability value needs to have a number
message confused me, as the state of that entity appears to already be a number, such as ‘70’ or ‘100’ for example - so this can’t be what the message is actually referring to

Love this card to setup but I have a problem with the forecast icons.
Started all over again and clean but no luck.

Should be other icons also but only the first 2 is showing.

image

any idea’s?