Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

icon issues on the development endpoint #385

Open
4 tasks done
cloneofghosts opened this issue Dec 10, 2024 · 8 comments · May be fixed by #383
Open
4 tasks done

icon issues on the development endpoint #385

cloneofghosts opened this issue Dec 10, 2024 · 8 comments · May be fixed by #383
Assignees
Labels
bug Something isn't working priority: high

Comments

@cloneofghosts
Copy link
Collaborator

cloneofghosts commented Dec 10, 2024

Describe the bug

@alexander0042 I thought for currently if precipIntensity is above 0.02 mm/h then it would show the icon and it wouldn't show the possible text. This is what I'm currently seeing on the dev endpoint at the moment:

"currently": {
  "time": 1733846940,
  "summary": "Possible Light Sleet",
  "icon": "cloudy",
  "nearestStormDistance": 216.31,
  "nearestStormBearing": 90,
  "precipIntensity": 0.217,
  "precipProbability": 0.11,
  "precipIntensityError": 0.04,
}

Live is showing the icon/summary as sleet. I assume because the probability is only 11% it's not showing the icon and adds the possible text?

Expected behavior

The currently icon should show the precipitation icon if intensity is greater than 0.02 mm/h regardless of pop

Actual behavior

The currently icon doesn't show the precipitation icon if intensity is greater than 0.02 mm/h and pop is less than 25%

API Endpoint

Development

Location

Ottawa, Ontario

Other details

No response

Troubleshooting steps

  • I have searched this repository and Home Assistant Repository to see if the issue has already been reported.
  • I have read through the API documentation before opening this issue.
  • I have not included my API key anywhere in my issue.
  • I have written an informative title.
@cloneofghosts
Copy link
Collaborator Author

This isn't related to the currently section but I did notice a few other misc bugs with the icon:

When I exclude NBM on both live and dev the precipitation icon shows when precipIntensity is 0. If I exclude HRRR then it shows that GFS/GEFS is showing precipitation for that hour. Taking a look at SpotWX shows that HRRR is forecasting precipitation for that hour but PW is showing 0.
image

{
  "time": 1733889600,
  "summary": "Light Rain",
  "icon": "rain",
  "precipIntensity": 0,
  "precipProbability": 1,
  "precipIntensityError": 1.8629,
  "precipAccumulation": 0.158,
  "precipType": "rain",
  "temperature": 0.35,
  "apparentTemperature": -4.36,
  "dewPoint": 0.35,
  "humidity": 0.94,
  "pressure": 1009.92,
  "windSpeed": 13.63,
  "windGust": 25,
  "windBearing": 87.38,
  "cloudCover": 1,
  "uvIndex": 0,
  "visibility": 1.7,
  "ozone": 335.59
},

Another thing I noticed (had to exclude NBM and HRRR for this) is that if there there is enough precipitation to show the precipitation text, is enough to show the wind icon/text and is foggy then it shows the rain + wind summary with a fog icon. Looks a bit weird is all.

"time": 1734008400,
"summary": "Possible Flurries and Breezy",
"icon": "fog",
"precipIntensity": 0.4429,
"precipProbability": 0.12,
"precipIntensityError": 0.0443,
"precipAccumulation": 0.0443,
"windSpeed": 32.3,
"visibility": 0.49,

@cloneofghosts cloneofghosts changed the title currently icon doesn't show precipitation icon on dev whereas it does on prod icon issues on the development endpoint Dec 13, 2024
@cloneofghosts
Copy link
Collaborator Author

cloneofghosts commented Dec 13, 2024

@alexander0042 Noticed another issue this morning where the summary said Drizzle but icon was partly-cloudy-night

{
  "time": 1734487200,
  "summary": "Drizzle",
  "icon": "partly-cloudy-night",
  "precipIntensity": 0.0797,
  "precipProbability": 0.25,
  "precipIntensityError": 0.0055,
  "precipAccumulation": 0.008,
  "precipType": "rain",
  "temperature": 1.61,
  "apparentTemperature": -5,
  "dewPoint": -0.86,
  "humidity": 0.83,
  "pressure": 1017.25,
  "windSpeed": 23.09,
  "windGust": 38.71,
  "windBearing": 238.78,
  "cloudCover": 0.77,
  "uvIndex": 0,
  "visibility": 16.09,
  "ozone": 312.75
},

I think because pop is exactly 25% it doesn't hit the possible check or the icon check so it falls back to the None icon check to set the icon.

Copying the comment I left on the PR:

Rain into a scenario in the hourly block where the visibility is low enough to trigger the fog icon but windy enough to trigger the wind icon. How its setup currently it will show the fog summary and icon (as Foggy and Breezy doesn't make sense) but I wonder if it should show the wind icon instead?

{
  "time": 1733983200,
  "summary": "Foggy",
  "icon": "fog",
  "precipIntensity": 0,
  "precipProbability": 0.07,
  "precipIntensityError": 0.2704,
  "precipAccumulation": 0,
  "precipType": "snow",
  "windSpeed": 27.36,
  "windGust": 45.36,
  "visibility": 0.38,
},

cloneofghosts added a commit to Pirate-Weather/pirate-weather-code that referenced this issue Dec 13, 2024
@alexander0042
Copy link
Collaborator

Sorry for the radio silence! Crazy busy week, and so 2.5.0 got pushed 😢. Thanks for keeping track of everything and highlighting the issues with it, since it really, really helps. I'm going to go through the tags this weekend and put it all in, so I'll update then!

@cloneofghosts
Copy link
Collaborator Author

cloneofghosts commented Dec 16, 2024

@alexander0042 So the plan is to fix up those few issues and port the rest of the languages over to python and push it to the translations repo? If everything goes well the launch would likely be near the end of the week?

EDIT: Been getting 502 errors this morning when trying to access the development endpoint. It was doing it before but it would eventually work but this morning its just broken.

@cloneofghosts
Copy link
Collaborator Author

Sorry for the repeated pings here @alexander0042 but is there any estimate on when the development endpoint will come back up? It's been giving me 502 errors since yesterday morning:

{
    "message": "An invalid response was received from the upstream server"
}

@cloneofghosts cloneofghosts linked a pull request Dec 20, 2024 that will close this issue
10 tasks
@alexander0042
Copy link
Collaborator

Ok, a few thoughts here:

  1. Since text is now using rain/snow/ice accumulations to determine an icon, unknown precipitation can never occur (at least in theory), so I think leaving it out continues to make sense.
  2. re: possible threshold, a couple things. It's currently coded as "if POP is =<25% OR between 0 and 0.4 mm/h", so that's why possible is in the text.
  • re: the icon, it's set so it only occurs if "if POP is > 25% and greater than 0.02 mm/h", so that's what led to the initial issue.
  • However, I kind of like using POP for hourly, since I think that it's useful information. Your current solution of overriding pop is great, and the only change adding a possible threshold, since using the light rain threshold is too high. I've also adjusted the POP threshold from 25% to 20%, since I think 25% was a little high.
  1. re: HRRR precipitation. This one is from HRRR accumulation giving different results than HRRR precipitation rate. I believe that's to be expected, but it's been so long since I've looked at the raw data, so want to double check this one.
  2. re: fog icon, I've been mulling over the "priority" order of the icons, since it's a tricky sort of question. The text makes sense, and so it's question of "should fog outrank windy". I don't know if that is always true, but I think so in most case, so ok leaving it for now.
  3. Great catch and fix on the "exactly" 25% issue, that seems like it was it.
  4. See above, but it's a really good question. Maybe some sort of threshold approach would make sense, like if wind is above medium threshold use the wind icon, otherwise use the fog icon?

I'm going to quickly double check those HRRR values before release, but definitely improved a few things here!

@cloneofghosts
Copy link
Collaborator Author

  1. Since text is now using rain/snow/ice accumulations to determine an icon, unknown precipitation can never occur (at least in theory), so I think leaving it out continues to make sense.

Still might be a good idea to have it anyway on the off chance that it might happen.

  1. re: possible threshold, a couple things. It's currently coded as "if POP is =<25% OR between 0 and 0.4 mm/h", so that's why possible is in the text.
  • re: the icon, it's set so it only occurs if "if POP is > 25% and greater than 0.02 mm/h", so that's what led to the initial issue.
  • However, I kind of like using POP for hourly, since I think that it's useful information. Your current solution of overriding pop is great, and the only change adding a possible threshold, since using the light rain threshold is too high. I've also adjusted the POP threshold from 25% to 20%, since I think 25% was a little high.

So if the precipitation is between 0-0.4 and less than 20% the possible text is shown? So if for an hour there's 1.5 mm rain forecasted and only a 20% chance then it doesn't show the possible text and uses fog/wind/cloud text/summary instead?

  1. re: fog icon, I've been mulling over the "priority" order of the icons, since it's a tricky sort of question. The text makes sense, and so it's question of "should fog outrank windy". I don't know if that is always true, but I think so in most case, so ok leaving it for now.

  2. See above, but it's a really good question. Maybe some sort of threshold approach would make sense, like if wind is above medium threshold use the wind icon, otherwise use the fog icon?

It might make sense for the fog icon to show if the wind threshold is below the medium wind threshold? If the visibility is low enough for fog and windy enough for the breezy text then the visibility obstruction likely isn't fog.

@cloneofghosts
Copy link
Collaborator Author

@alexander0042 I'm noticing on the dev endpoint that sometimes precipAccumulation has more than four decimal points on the daily block.

I don't have an example on-hand this morning but I did notice on the weekend that there were a few cases of an hour having zero precipIntensity but precipAccumulation greater than zero. In that case the text showed the possible precipitation text when I don't think it should? Probably should have the accumulation set to zero if there's no intensity?

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working priority: high
Projects
Status: Todo
Development

Successfully merging a pull request may close this issue.

2 participants