Pirate-Weather / pirate-weather-ha

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

Icons #21

Closed cloneofghosts closed 2 years ago

cloneofghosts commented 2 years ago

The last two nights at my location it got foggy overnight but when I checked the website it showed a visibility value of 0.1km but it did not show the fog icon.

As far as I am aware a visibility under 1km is considered fog though it might need to be over 75% humidity like Mist needs to be otherwise it would be considered Haze/Smoke/etc.

If you need an example here is Thunder Bay, Ontario where it has a visibility of 0.1km. The two blank icons on the weather page are the fog icons (that also needs to be fixed) and checking the api it seems that it shows when the visibility is exactly 0. image

alexander0042 commented 2 years ago

Hi,

Thanks for pointing this out! That definitely is an issue- I think the API is returning the fog icon (although I need to double check how it's calculated), and the website is missing that icon for some reason. Let me dig into this one and get back to you!

Thanks, Alexander

cloneofghosts commented 2 years ago

The repo that the site is based off of never had a fog icon so it seems like nobody noticed until now. I have found the icon set that the repo used so you can add it in. https://www.alessioatzeni.com/meteocons/

Edit: Just realized that I don't think the wind icon ever shows? I know other sites show it if wind speed is over 30km/h unless fog or precipitation. Also are the three icons (hail, thunderstorm and tornado) that Darksky said might be defined not being added here?

Edit 2: Does the rain icon only show if intensity is over 1mm? The API shows intensity of 0.72mm and cloudy.

alexander0042 commented 2 years ago

Hi,

Apologies for the radio silence here- I’m doing some across the pond weather forecast research (aka visiting Italy on my honeymoon), so away from this momentarily.

Adding in fog is pretty straightforward, so that’ll be on the docket shortly.

I also noticed those three icons, but as of yet, I don’t think I can implement them. Hail would be the easiest, since it’s reported out of the models; however, I want to maintain comparability with Dark Sky as much as I can, and I’m worried that if I return an icon that they didn’t, it’ll break an implementation somewhere.

Also yes! That’s the threshold for rain, and slightly higher for snow. It seemed like as reasonable of a line as any, but this reminded me that I should document it!

cloneofghosts commented 2 years ago

I know in the Dark Sky documentation it did mention that developers should have those defined in case they add them in but I think most probably didn't. Maybe a solution here would be to offer them as an optional parameter? That way those who want those icons can use them without breaking other setups. Just an idea.

I feel that rain/snow/sleet should show if precip is greater than 0 at least for current conditions though maybe this is something to think about when you change to the different source in the future.

alexander0042 commented 2 years ago

Haven't forgotten about this! I think I've addressed the main issue here- the fog icon from that set has been added in, and updated the weather-vue code to use it! Unfortunately, there doesn't seem to be fog anywhere, so I can't test this out, but I'll keep an eye out for some fog somewhere to test it.

I really like the idea of adding a wind icon in, and I think the best way to go about it is adding a different unit. Something along the lines of "si-wind" or "us-wind", which would return it as a icon. This would preserve compatibility with Dark Sky, but provide it as an option?

cloneofghosts commented 2 years ago

They were forecasting fog patches last night but I didn't check to see if it was fixed or not. Whenever I find a location to check I will definitely check for you.

I don't know what the parameters for the wind icon to show on DarkSky are since it isn't mentioned anywhere in their docs but it might be 40 km/h, 25 mph, 11 m/s? All those convert to roughly the same speed in the different unit types so maybe that could be used for the icon?

cloneofghosts commented 2 years ago

Just following up on this. I'm seeing visibility of 0.2km and cloudy. Looking at the hourly forecast I don't see any fog so I cannot confirm if it works on the website.

EDIT: Now that I think about it I swear the cloud cover rage seems really large compared to Partly Cloudy/Overcast. I know on Dark Sky Clear is <= 30% , Partly Cloudy is between 31 and 84 and Overcast is >= 85%

cloneofghosts commented 2 years ago

I just noticed that in the hourly forecast it shows the sleet icon with a summary of None or Snow sometimes in the API. I haven't seen any other instances of this in the API so I'm not sure why it's happening now.

"time": 1640440800,
"icon": "sleet",
"summary": "None",
"time": 1640444400,
"icon": "sleet",
"summary": "Snow",
alexander0042 commented 2 years ago

I'm thinking this issue for the sleet/ freezing rain is related to issue Pirate-Weather/pirateweather#117, since it has to do with the minimum precipitation to trigger an icon, so I'm going to merge this issue with that one!