Include running accumulations in rain graphs weewx report main web page

90 views
Skip to first unread message

CCOR58 RADIO

unread,
Jul 10, 2019, 7:17:10 AM7/10/19
to weewx-user
I have managed to get the correct mm units to show in the hourly accumulations rain graph. What I would like to be able to have in one of the corners of the same graph is a YTD accumulation SUM text figure say in bold blue letters and a current calendar month to date rain accumulated text SUM figure in RED say adjacent to the YTD one.

What kind of change to the weewx.conf file to I have to do to have this show up?

Failing that can anyone pls give me the SQL SELECT statement to use to manually extract these numbers from the mysql database using phpmyadmin to obtain these two figures?

Thanks

link to graph I would like to try to modify is here:

Andrew Milner

unread,
Jul 10, 2019, 7:38:05 AM7/10/19
to weewx-user
1.  You cannot create any additional text on a graph within standard weewx regardless of what you change

2. for the YTD sql statements - is the year you are interested in the calendar year or the rain year??  Are you using mysql or sqlite3 for your database??

Andrew Milner

unread,
Jul 10, 2019, 7:50:15 AM7/10/19
to weewx-user
in mysql something like
select sum(rain) from archive where dateTime >= UNIX_TIMESTAMP(CONCAT(YEAR(CURDATE()),'-01-01')); might work for the calendar year to date

CCOR58 RADIO

unread,
Jul 10, 2019, 8:03:48 AM7/10/19
to weewx-user
I am looking for the current calendar month and the current calendar year running accumulations

Andrew Milner

unread,
Jul 10, 2019, 8:23:37 AM7/10/19
to weewx-user
if the year select works as you need then I am sure you can google for the month adaption!!!!

CCOR58 RADIO

unread,
Jul 10, 2019, 1:01:22 PM7/10/19
to weewx-user
Yes that year to date sum worked for what I need or am seeking.
I tried to use MONTH instead of year and adjust the 01 01 parameters but no joy with that. need to find ref manual for the mariahdb/mysql syntaxes and without a big picture view of data relationships  it will be a bit of a challenge methinks but thanks for your help here on the YTD part anyway.

vince

unread,
Jul 10, 2019, 1:10:16 PM7/10/19
to weewx-user
On Wednesday, July 10, 2019 at 10:01:22 AM UTC-7, CCOR58 RADIO wrote:
Yes that year to date sum worked for what I need or am seeking.
I tried to use MONTH instead of year and adjust the 01 01 parameters but no joy with that. need to find ref manual for the mariahdb/mysql syntaxes and without a big picture view of data relationships  it will be a bit of a challenge methinks but thanks for your help here on the YTD part anyway.


Andrew Milner

unread,
Jul 10, 2019, 1:18:31 PM7/10/19
to weewx-user
it would be if the result was wanted for a standard html page.  I guess the original poster has the option of putting the graphs on a page where the text fields are displayed between the graphs.  doing it this way would permit full styling of the text in red, blue, or any other colour in whatever size font he desires.  I got preoccupied into thinking the poster intended to retrieve the values and massage the png files to give him his corner information.

vince

unread,
Jul 10, 2019, 5:24:34 PM7/10/19
to weewx-user
On Wednesday, July 10, 2019 at 10:18:31 AM UTC-7, Andrew Milner wrote:
it would be if the result was wanted for a standard html page.  I guess the original poster has the option of putting the graphs on a page where the text fields are displayed between the graphs.  doing it this way would permit full styling of the text in red, blue, or any other colour in whatever size font he desires.  I got preoccupied into thinking the poster intended to retrieve the values and massage the png files to give him his corner information.


I guess I wouldn't fight the limitations of the imaging engine and I'd have a .tmpl file with the values in a table cell next to the image, but there are lots of ways to do that of course.    It would be interesting to see if $month.rain.sum would get the running graph for the month-to-date.  I think I might have seen somebody doing this, but my recollection is hazy.

FWIW - I use influxdb and grafana which makes running totals in graphs trivial, but that's a whole lot different than weewx over mysql or sqlite.

vince

unread,
Jul 10, 2019, 7:15:56 PM7/10/19
to weewx-user
I might note that the Belchertown skin has a special 'rainTotal' element that can graph a running total overlaid with things like rain for the date.  Works great.

My site's year to date graphs are https://www.skahan.net/weewx/weewx_belchertown/graphs/?graph=year - rain is near the bottom of the page.
Reply all
Reply to author
Forward
0 new messages