jdejaegh / irm-kmi-ha

Home Assistant weather provider using data from Belgian IRM KMI 🇧🇪 🇱🇺 🇳🇱
MIT License
40 stars 0 forks source link

pollen #33

Closed jrspowers closed 3 months ago

jrspowers commented 3 months ago

Hello,

very nice weather integration, especially for the pollen. I have a question: would it be possible to see the upcoming days as well, like on the website where you can see three days ahead? And I have another question: what does "pollen active" mean?

Schermafbeelding 2024-05-26 142715

jdejaegh commented 3 months ago

Thanks for the feedback!

The data used by this integration is from the Android app of meteo.be (https://play.google.com/store/apps/details?id=be.irm.kmi.meteo). The application gets the data from an API that is easy enough to work with from a program. Therefore, you may see differences with their website.

The forecast for the pollen is not available in their mobile app, there is only the current observation. On top of that, the screenshot you share is displaying images (PNG files) so getting the pollen levels from the images is harder than from an API.

For the meaning of "pollen active", it is not well defined either: it's how it is shown in the app. See the screenshot below, showing the pollen for today in Brussels. Oak is shown as 'active' (no mention of the amount of pollen) but grasses shows an orange level.

I hope you understand why the data is not available in this integration and probably won't ever be.

If we find a good source (with a API) for pollen level in Belgium, it might be possible to create an integration for that.

screenshot

jrspowers commented 3 months ago

Hello, I completely understand. Indeed, it won't be possible to retrieve pollen data for multiple days. No problem, hopefully we can find an API with good pollen information for Belgium because the Netherlands has a good one from Kleenex. It's a pity that it doesn't support Belgium. And another question: is it also possible to have the UV index come in as a separate sensor in Home Assistant?

jdejaegh commented 3 months ago

Actually, Sciensano provides information about the pollen levels in Belgium: https://airallergy.sciensano.be/. However, they don't seem to have a public API to get the data out.

The Belgian Interregional Environment Agency provides air quality measurements but only for pollution and not pollen. They have an open-data on their website so it's possible to write an integration to get it: https://irceline.be/en

To get the UV index as a separate sensor, you can use a template sensor: go to Settings > Devices & Services > Helpers (top ribbon) > Create Helper (+ blue button) > Template > Template a sensor. Give it a name and use something like below (where weather.home should be your weather entity). Fill the other fields as you see fit.

{{ state_attr('weather.home', 'uv_index') }}
jrspowers commented 3 months ago

Getting better pollen information will still be a difficult task in Belgium, but Irceline would be good for fine dust and similar data to use in Home Assistant. Could you make an integration for Home Assistant for this? I would really appreciate it. I will definitely look into the UV index, thanks.

jdejaegh commented 3 months ago

Irceline would be good for fine dust and similar data to use in Home Assistant. Could you make an integration for Home Assistant for this?

That's something I already thought about, but I have no idea of when I'll have time to implement (might be in a few weeks, few months or years). I still have lots to learn before writing an integration for that: how to use their API, what data point do they have, how to make it practical to use within Home Assistant. They have an open data with documentation so that's a good start

jrspowers commented 3 months ago

Yes, I understand that very well. I also don't think it's that simple, but it will definitely work out. If I can help with anything, please let me know.

thomasddn commented 3 months ago

@jrspowers To get the pollen "forecast" into Home Assistant, I just use picture cards with the following URLs:

Where Dx suffix stands today, tomorrow, day after tomorrow and forth day ahead.

So you don't get any values out of it, just a glance of the pollen levels across Belgium. Not ideal, but it works for me.

jdejaegh commented 2 months ago

@jrspowers you may want to check out https://github.com/jdejaegh/python-irceline

The end goal is to contribute a new integration to Home Assistant Core with the data from https://www.irceline.be for air quality. The linked repository holds the code to query their open data that will be published on PyPI. Once this is done, I'll come up with a pull request for a core integration