Pirate-Weather / pirate-weather-ha

Replacement for the default Dark Sky Home Assistant integration using Pirate Weather
https://pirateweather.net/
Apache License 2.0
369 stars 26 forks source link

Can the `mdi` icon be exposed on the `weather` entity #279

Open Intecpsp opened 3 months ago

Intecpsp commented 3 months ago

Describe the feature

I see it is exposed on things like Precip Probability, Wind Gust, and Wind Speed. I also see an Icon setting I can configure, but this doesn't seem to match up to an mdi icon that I can use.

Home Assistant version

No response

Integration version

No response

Acknowledgements

alexander0042 commented 3 months ago

Hi, thanks for opening this issue and using Pirate Weather!

I see your challenge here, and unfortunately the Home Assistant Weather Entity is somewhat limited in this regard. However, would using the "icon" sensor work? You can add it in using this integration, and might be exactly what you're looking for here. It doesn't correspond to the mdi iconsl however, the code to translate them is here, so that could be dropped into a template, depending on your use case.

Intecpsp commented 3 months ago

I found that translation previously and had the template thought, but wanted to ask if it could be exposed on the weather entity for easier use. Could the Icon sensor expose the mdi as well? Or would I just need to stick to a template sensor?

alexander0042 commented 17 hours ago

This is a good one, but I'm not sure if it's supported by Home Assistant. The issue is that the weather entity uses a standard HA one , and so I don't know if it's supported for me to add additional properties to it? I'll give it a try and see what works.

In the meantime, the sensor entities really are made for this exact sort of situation! Icon is one of the properties exposed by the integration, so you can create icon sensors for current conditions, hourly, and daily forecasts!