G6EJD / ESP32-e-Paper-Weather-Display

An ESP32 and 2.9", 4.2" or 7.5" ePaper Display reads Weather Underground data via their API and then displays the weather
Other
946 stars 206 forks source link

Add probability of precipitation to timeseries graph? #201

Open jpolton opened 1 year ago

jpolton commented 1 year ago

Probability of precipitation is downloaded with the 3hrly forecast data. And is quite interesting. This can be overlayed on the precipitation rate graph with a separate y-axis (on e.g. RHS of rainfall graph). On a 7.5" screen this fits fine with a little bit of nudging of the other elements in the DisplayForecastSection().

IMG_9623 IMG_9624

Would this be of interest as a Pull Request?

dreamy1 commented 1 year ago

Yes :-)

jpolton commented 1 year ago

Started a PR: #202. Implemented in Waveshare_7_5_T7.ino only, for now.

jpolton commented 1 year ago

Edits should work on other screens but the forecast graph spacing might have to be tweaked to get the extra y-axis labels to fit.

For the 7.5" 800x480 screen this was a simple edit in the DisplayForecastSection() method (~line 407):

int gx = (SCREEN_WIDTH - gwidth * 4) / 5 + 5;

-->

int gx = (SCREEN_WIDTH - gwidth * 4) / 5 + 1;

I am reluctant to make a PR for things I can't personally test, unless someone else wants the PR and can help with that.

jpolton commented 1 year ago

Yes :-)

@dreamy1 @Kobbe1 Let me know what board you have, I'll make the changes for it and you could see if it looks OK?

dreamy1 commented 1 year ago

Thanks a lot - i have the 7.5" and the Liliygo T5 4.7" screen...but at the moment, unfortunately no time for testing...

Kobbe1 commented 1 year ago

I have a 4.2 inch board. I did not want to wait so already more or less implemented in my local copy which is heavily customized. I really love this feature - been using it since a few weeks now, thanks for the awesome idea. I did not actually add an Y-axis to show the % - as it is always 0 - 100% I don't think it is really needed and things are tight on a 4.2 screen.

I might be able to test it some time in the future when I merge other new changes but I don't regularly update it if all is well as it is "in production" - with the family, so changes are risky :)

G6EJD commented 1 year ago

I agree, actually OWM’s predicted rainfall amounts to gives a profile of predicted precipitation without the need to draw it as yet another graph line.

jpolton commented 1 year ago

I agree, actually OWM’s predicted rainfall amounts to gives a profile of predicted precipitation without the need to draw it as yet another graph line.

Yes but overlaying "probability of rainfall" as a line on top of rainfall rate is illuminating, especially when the probability is low. Together they make an estimate of risk of getting wet during e.g. the commute, laundry outside. IMG_0121

For smaller screens temperature and humidity could also be combined (where humidity is otherwise not plotted), though some method of distinguishing the lines (colour, thickness, style) would have to be experimented with.

jpolton commented 9 months ago

Associated PR #202 got closed when I attempted to move it off my master branch. Created a new PR