First it doesn’t seem to handle the value -1 which is “Ingen information”.
Rudimentary fix implemented in the latest release. Hope it works for you; it did in my own testing. “-1” is really a NA value, I think. The latest release filters these to “0”. A proper way would be to add text and image for NA. Feel free open an issue to remind me. Also, PR:s are welcomed!
The second is that it hides all allergens with the value 0, Inga pollen. It should be selectable in the configuration.
Rudimentary support has been added, use variable pollen_threshold. Default value is 1, for the same behaviour as before. Set to 0 to show all, or any other number to filter. Currently, it checks if there is higher value than pollen_threshold in any coming days (1-4), regardless of days_to_show variable. Better support would be if it would only check days_to_show. Feel free open an issue to remind me. Also, PR:s are welcomed!
Better support for -1 has been added in the most recent release (v1.0.3). It now tells you there is no information rather than fooling you into believing that there wouldn’t be any.
Also considered implementing a threshold according to days to show, but I kind of prefer it as it is. Just let me know if anyone would prefer it otherwise.
Great card! Thanks a bunch! How would I go about changing the font-weight of the header “Idag”, “Imorgon”, “Övermorgon”? I’m using card mod, and can’t seem to find the element to style. Kind regards.
Currently, you need to add the card manually. See ludeeus’ explanation for how, here. In short, if you add the card in the UI editor, having pressed add; scroll down. Choose “manual”. Paste in this code:
type: custom:pollenprognos-card
city: Forshaga
show_text: false
days_to_show: 2
allergens:
- Al
- Alm
- Ambrosia
- Björk
- Ek
- Gråbo
- Gräs
- Hassel
- Sälg / vide
I am having problems using this card. I installed in through HACS, but it didn’t work as a custom integration, but Lovelace.
When trying to use the card with the code I am getting this error message as seen in the screenshot.
JohNan’s Home Assistant Pollenprognos integration is a prerequisite; that is the custom integration that provides the data shown by pollenprognos-card. Have you installed it?
Hi!
Yeah, I’ve done that and found the API-URL too.
I can see the two sensors of Gräs and Björk, and they work. But I can’t copy/paste the code to get the code above to work.
Appriciate you trying to help me out.
Hmm. Sensors are there; great. Do you still encounter the same error as in the screenshot you embedded in your post above? That would suggest that the following will not help, but nevertheless want to check:
Have you added the lovelace resource; see this post, above?
Really not sure what is going on, so the following is just grasping for straws. In order, try:
In your image, you correctly show pollen-sensors. Great. But are they also of the same city? Is your pollenprognos integration set up for the same city that you try to render the lovelace card of, that is: Forshaga?
If you open up your sensor for, say, Björk. Is the entity id indeed sensor.pollen_forshaga_bjork or is it something else? If it is something else, we might have found the culprit, as the error message you’re seeing would correspond with the entity it is looking for isn’t there. (For the two sensors you’ve configured in the lovelace UI editor, it would be looking for sensor.pollen_forshaga_bjork and sensor.pollen_forshaga_gras.)
One way of checking this, is opening up the Pollenprognos -integration, and viewing the list of it’s entities.
It looks like you have several lovelace pollenprognos cards installed (specifically pollen-card and pollenprognos-card). They shouldn’t clash, but . Try removing pollen-card?
Could you send a screenshot not only of the rendered error message, but also how the code looks before you save the card configuration in lovelace? Just to be sure.
THANK you so much!
I’m so stupid… Didn’t think that it would be a problem to try another city as long as the API-URL was correct.
As soon as I changed to Umeå it worked as a charm.