change unit type in image generator

76 views
Skip to first unread message

fLsh

unread,
Jul 29, 2021, 4:51:05 AM7/29/21
to weewx-user
Hello altogether,

I added to the sunshine_time extension to my weewx configuration and also the plots to the Seasons-Skin and all works great.
But for the weekly, monthly and yearly plots, I would like to create plots with hours instead of the minutes, which is the default unit (defined as group_interval which is in minutes).
So I checked the description of the image generator but didn't find anything.
I tried it with sunshine_time.hours which works for the current values but not for the image generation.
Anyone has an idea?

Best regards,
Matthias

gjr80

unread,
Jul 29, 2021, 6:30:37 AM7/29/21
to weewx-user
All you want to do is change the ‘units’ used in the plots just like you would to plot temperature inC or F. In this case you need to tell WeeWX the units you wish to use for group_interval is hours not minutes. Unfortunately, that is done on a skin by skin basis and can’t be done on a plot by plot basis. Try adding the following (untested) to WeeWX.conf under [StdReport] [[Seasons]]:

 [StdReport]
    ….
     [[Seasons]]
        ….
        [[[Units]]]
            [[[[Groups]]]]
                group_interval = hours

Save weewx.conf and restart WeeWX. This should cause all of your plots that include an observation that belongs to group_interval to plot in hours rather than minutes. You may need to delete plots with an aggregate period (eg week, month and year) to force them to be re-generated otherwise you will need to wait for them to re-generate.

This approach may have some unintended consequences in some reports or (possibly) other plots, unfortunately I am away from my PC and cannot test the change. If this does work and gives you (some of) the plots you want you can achieve a plot by plot effect by create a cutdown copy of the Seasons skin that will just produce the plots in hours (and nothing else) and the original Seasons skin can produce everything else plus your plot in minutes.

Gary

fLsh

unread,
Jul 29, 2021, 6:48:06 AM7/29/21
to weewx-user
Hi Gary,

thanks for your answer and your suggestion.
Changing the unit for the whole group will work for sure.
I indeed was hoping that there is a solution on a plot by plot basis, since something that makes sense on a daily base (minutes) doesn't make sense on a monthly/year base (hours).
So in the end the only solution would be to create a second data_type which is then defined in a new group which is defined as hours or to either live with one unit type for all plots.

Best regards,
Matthias

gjr80

unread,
Jul 29, 2021, 7:01:19 AM7/29/21
to weewx-user
> So in the end the only solution would be to create a second data_type which is then defined in a new group which is defined as hours or to either live with one unit type for all plots.

Well, no, as I said you can create a copy of the Seasons skin that produces just the ‘hour’ plots. The skin will consist of just skin.conf, will only run the ImageGenerator and then only producing a few plots. It would be called from [StdReport] with a unit group override. No code, just config, no duplicate data type and no new unit groups.

Gary

Karen K

unread,
Jul 29, 2021, 7:05:09 AM7/29/21
to weewx-user
I had the same question, and I wanted to use different units for different plots. So an overall change does not work. 

If I understand the original question right, that user wants to use different units for the day plot and the week/month/year plot, respectively. So there is the same problem: an overall change does not do.

fLsh

unread,
Jul 29, 2021, 9:18:40 AM7/29/21
to weewx-user
ok I understand.
I think that is even an improvement because then I will be able to define different intervals of the report generation (especially of the image generations).
Doesn't really make sense to create the year-plots every 5 minutes :-) --> less write cycles to the flash card and lower cpu usage.

Karen K

unread,
Jul 29, 2021, 9:45:16 AM7/29/21
to weewx-user
rogu...@gmail.com schrieb am Donnerstag, 29. Juli 2021 um 15:18:40 UTC+2:
ok I understand.
I think that is even an improvement because then I will be able to define different intervals of the report generation (especially of the image generations).
Doesn't really make sense to create the year-plots every 5 minutes :-) --> less write cycles to the flash card and lower cpu usage.

How often the images are created depends on the aggregation interval. They are not all re-created every 5 minutes. Typically the year images are created once a day, others once an hour or once in 3 hours. You see it on the image. There is the creation time at the bottom.
 

fLsh

unread,
Jul 29, 2021, 10:04:13 AM7/29/21
to weewx-user
ok I see.. and where can I change/see that interval, besides of for the whole report?

fLsh

unread,
Jul 29, 2021, 10:07:15 AM7/29/21
to weewx-user
ok nvm I guess it is the aggregate_interval defined in the skins.conf

Karen K

unread,
Jul 29, 2021, 10:08:47 AM7/29/21
to weewx-user
rogu...@gmail.com schrieb am Donnerstag, 29. Juli 2021 um 16:07:15 UTC+2:
ok nvm I guess it is the aggregate_interval defined in the skins.conf

Yes. 
Reply all
Reply to author
Forward
0 new messages