poblabs / weewx-belchertown

A clean and modern weewx skin with real time streaming updates, forecast data and interactive charts. View it in action at BelchertownWeather.com
https://belchertownweather.com
GNU General Public License v3.0
206 stars 111 forks source link

Add icon for currently raining #739

Closed lordratner closed 2 years ago

lordratner commented 2 years ago

Any appetite for indicating when the weather station is experiencing rain? If the Rain Rate value is greater than zero, the current conditions icon and text could be changed to indicate rain. Even better, the icon and text would change based on the rain rate to indicate Light, Moderate, Heavy, or Torrential, etc. I'm sure the best scale to use, since there are many.

There is a little space below the current conditions icon, so if you want to keep the sky condition icon unchanged, a rainfall text could be added directly below it. Green for Light Rain, Amber for Moderate Rain, Red for Heavy rain

I can help with the scales and logic, but I'm not terribly familiar with the coding itself.

It would be nice to have a more prominent indication of current rain than just seeing the rain rate value above 0.00 in/hr, which is somewhat subdued on the skin. Thoughts?

lordratner commented 2 years ago

I think I've figured out where the change would be made, but I don't have a good enough understanding of all the dictionaries used, in particular how to access the rainRate.

Working between lines 1469 and at line 1470 in belchertown.py, a few "if" statements to capture if the station is experiencing rain.

The elif statement on 1465 determines whether icons will be used (aeris metar is used and current data was received) and selects the icon. within this elif I came up with a simple logic and a more complex logic. The complex logic removes rain from current observations when weewx is not reporting a rainRate

SIMPLE Version: if rainRate == 0 or noRainEquioment Do current stuff elif current_ob == thunderstorms show thunderstorms icon and obs_text elif rainRate > heavyRainThreshold show rain icon (or heavy rain icon if added) and obs_text "Heavy Rain" elif rainRate > moderateRainThreshold show rain icon and obs_text for moderate Rain elif rainRate > lightRainThreshold show drizzle icon and obs_text for LightRain

COMPLEX Version

if noRainEquipment Do current stuff elif current_obs == thunderstorms if rainRate == 0 use thunderstorm icon and obs_text = Vicinity Thunderstorms else Use thunderstorm Icon and text elif current_ob == anyRainType if rainRate > heavyRainThreshold show rain icon (or heavy rain icon if added) and obs_text "Heavy Rain" elif rainRate > moderateRainThreshold show rain icon and obs_text for moderate Rain elif rainRate > lightRainThreshold show drizzle icon and obs_text for LightRain elif rainRate == 0 show rain icon and obs_text "Vicinity Showers"

dtalens commented 2 years ago

Hi @lordratner, I am interested in this improvement. Do you have a webpage where you tried it?

lordratner commented 2 years ago

I can put together the code as far as the If/elif statements, but I don't understand the variable dictionaries used in belchertown well enough to fill in the correct values. If someone is willing/able to fill in the correct dictionary references I will put together the logic for it.

ddperso commented 2 years ago

Hi

I am also interested in this improvement.

Le dim. 12 déc. 2021 à 21:15, lordratner @.***> a écrit :

I can put together the code as far as the If/elif statements, but I don't understand the variable dictionaries used in belchertown well enough to fill in the correct values. If someone is willing/able to fill in the correct dictionary references I will put together the logic for it.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/poblabs/weewx-belchertown/issues/739#issuecomment-991963179, or unsubscribe https://github.com/notifications/unsubscribe-auth/APUWSJI26EMBNLRMGY2J7RLUQT7FBANCNFSM5JSQQ3WQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

dtalens commented 2 years ago

Any news?

lordratner commented 2 years ago

Any news?

No. I still don't fully understand the various mappings, but I'm getting closer.

Unless I can find someone who already knows how to create an alternate mapping, it'll be a bit.

dtalens commented 2 years ago

If you have a preliminary version code I offer to test it.

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.