MarcoGos / kleenex_pollenradar

Kleenex pollenradar custom component integration for Home Assistant
10 stars 2 forks source link

Request: can u make sensors from the forecasts? #9

Closed raptile closed 3 weeks ago

raptile commented 1 month ago

Hi, I am trying to integrate the forecast into another card that was made by somebody else but i would like to get some help.

copy paste from the HA community: _You’ll need the Mushroom cards, stack-in-card, layout-card, grid-layout, bar-card and cardmod from HACS. For those adding to your own dashboard, you’ll need to make a “toggle” (boolean) helper to enable the drop down graphs. Link to Helpers – My Home Assistant (home-assistant.io) 16

it works with entities like - entity: sensor.thuis_grass_pollen_day_1 and i would like to add this value:

             - entity: {{ state_attr('sensor.kleenex_pollen_radar_thuis_gras',
              'forecast')[0].value }}

But i am unable to get it working. (I have no experience with this nice frontend stuff)

I think it can not be done like that inside this card because it wants sensors. (please correct me if i am wrong)

Thanks in advance for any help in the right direction or making sensors of the values so it could be used in cards like this:

`type: custom:stack-in-card title: EXPERIMENT cards:

raptile commented 1 month ago

i was able to do this by making sensors

- platform: template sensors: grass_pollen_forecast_1: friendly_name: "grass ollen Forecast 1" value_template: "{{ state_attr('sensor.kleenex_pollen_radar_thuis_gras', 'forecast')[0].value }}" grass_pollen_forecast_2: friendly_name: "grass pollen Forecast 2" value_template: "{{ state_attr('sensor.kleenex_pollen_radar_thuis_gras', 'forecast')[1].value }}" grass_pollen_forecast_3: friendly_name: "grass pollen Forecast 3" value_template: "{{ state_attr('sensor.kleenex_pollen_radar_thuis_gras', 'forecast')[2].value }}" grass_pollen_forecast_4: friendly_name: "grass pollen Forecast 4" value_template: "{{ state_attr('sensor.kleenex_pollen_radar_thuis_gras', 'forecast')[3].value }}" tree_pollen_forecast_1: friendly_name: "tree pollen Forecast 1" value_template: "{{ state_attr('sensor.kleenex_pollen_radar_thuis_bomen', 'forecast')[0].value }}" tree_pollen_forecast_2: friendly_name: "tree pollen Forecast 2" value_template: "{{ state_attr('sensor.kleenex_pollen_radar_thuis_bomen', 'forecast')[1].value }}" tree_pollen_forecast_3: friendly_name: "tree pollen Forecast 3" value_template: "{{ state_attr('sensor.kleenex_pollen_radar_thuis_bomen', 'forecast')[2].value }}" tree_pollen_forecast_4: friendly_name: "tree pollen Forecast 4" value_template: "{{ state_attr('sensor.kleenex_pollen_radar_thuis_bomen', 'forecast')[3].value }}" weed_pollen_forecast_1: friendly_name: "weed pollen Forecast 1" value_template: "{{ state_attr('sensor.kleenex_pollen_radar_thuis_kruiden', 'forecast')[0].value }}" weed_pollen_forecast_2: friendly_name: "weed pollen Forecast 2" value_template: "{{ state_attr('sensor.kleenex_pollen_radar_thuis_kruiden', 'forecast')[1].value }}" weed_pollen_forecast_3: friendly_name: "weed pollen Forecast 3" value_template: "{{ state_attr('sensor.kleenex_pollen_radar_thuis_kruiden', 'forecast')[2].value }}" weed_pollen_forecast_4: friendly_name: "weed pollen Forecast 4" value_template: "{{ state_attr('sensor.kleenex_pollen_radar_thuis_kruiden', 'forecast')[3].value }}"

and put those in a card:

`type: custom:stack-in-card cards:

image

(i am unable to fix ppm and pm3 at the moment)

raptile commented 1 month ago

The kleenex tree pollen seem to be broken. the tree pollen are always zero on a couple of days

MarcoGos commented 1 month ago

You are propably, same as me, living in the Northern hemosphere. The season of the tree pollen is over. That's why it's 0.

raptile commented 1 month ago

You are propably, same as me, living in the Northern hemosphere. The season of the tree pollen is over. That's why it's 0.

Sounds legit :) Then AccuWeather is broken... well, i'll re-adjust the scripts when i've got the time..

Thanks for the response and knowledge!