weewx 4.8.0 PNG file issue

132 views
Skip to first unread message

Mks Mk

unread,
Oct 29, 2022, 4:42:38 AM10/29/22
to weewx-user
we have installed (weewx-aqi), it calculates an air quality index.
the install and configuration were done and weewx just run fine with one issue we could not figured out the reason why.

in weewx Seasons (skin.conf) file the below lines were added:

    [[[dayaqi]]]
        data_binding = aqi_binding
        [[[[aqi_pm2_5]]]]



we can see the PNG file (aqi.png) was created in (/var/www/html/weewx) but it does not show on the weewx webpage, we have found out the link to this file is not added to the (index.html) during the webpage generate process.

we need your help on this issue.

Tom Keffer

unread,
Oct 29, 2022, 6:45:09 AM10/29/22
to weewx...@googlegroups.com
You did not say which skin you are using.

Assuming it is "Seasons", you need to add "aqi" to option "plot_groups".

Look in skin.conf, in the [DisplayOptions] section, for option "plot_groups". It is a long list of plot_groups, such as barometer, tempdew, tempfeel, etc. Add "aqi" to the end.



--
You received this message because you are subscribed to the Google Groups "weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/e0ae834b-7f90-4a74-8b1b-7908ca2a4046n%40googlegroups.com.

Mks Mk

unread,
Oct 29, 2022, 7:15:52 AM10/29/22
to weewx-user
we are using the Seasons skin and the "aqi" is there in the  "plot_groups" with the rest of other parameters under the "[DisplayOptions]".
the file "aqi.png" was made and it gets updated every 5 minutes but never showed up on the webpage. (((looking inside "index.html" file ....there is no link to "aqi.png")))

Mks Mk

unread,
Oct 29, 2022, 7:27:30 AM10/29/22
to weewx-user
the "weewx-aqi" is storing the data in different data base "aqi.sdb" and we are not sure if this does make different!

Tom Keffer

unread,
Oct 29, 2022, 8:49:48 AM10/29/22
to weewx...@googlegroups.com
The file names should be "dayaqi.png", "weekaqi.png", "monthaqi.png", and "yearaqi.png". That is, not a simple "aqi.png".

Is that the case?

Mks Mk

unread,
Oct 29, 2022, 9:08:22 AM10/29/22
to weewx-user
yes that is correct, the file name is  "dayaqi.png" 

Tom Keffer

unread,
Oct 29, 2022, 9:30:25 AM10/29/22
to weewx...@googlegroups.com
I think you are correct that the problem is the extra database aqi.sdb that you are using.

The way the self-provisioning feature of Seasons works is that it checks the database to see if there is any data. By default, it is checking weewx.sdb. Unfortunately, there is no way to tell it to use a different database. 

I've created issue #803 to track.

In the meantime, you can force it to display the plot. I have not tested this, but go into the Seasons index template file index.tmpl (found at /etc/weewx/skins/Seasons/index.tmpl or /home/weewx/skins/Seasons/index.tmpl, depending on your install method) and replace this

    #for obs in $getobs($plot_name)
      #if $recent.check_for_data($obs)
        #set $show_plot = 1
      #end if
    #end for

with this

    #for obs in $getobs($plot_name)
      #if $recent.check_for_data($obs) or $plot_group == "aqi"
        #set $show_plot = 1
      #end if
    #end for

Let me know how that works out.

-tk


Mks Mk

unread,
Oct 29, 2022, 10:40:27 AM10/29/22
to weewx-user
The file "index.html.tmpl" of weewx v4.8.0 contain slightly different lines than the one suggested but we went ahead and did these changes:

replaced this

    #for obs in $getobs($plot_name)
      #if getattr($recent, $obs).has_data

        #set $show_plot = 1
      #end if
    #end for


with this

    #for obs in $getobs($plot_name)
      #if getattr($recent, $obs).has_data or $plot_group == "aqi"

        #set $show_plot = 1
      #end if
    #end for


and it did work and the plot was shown on the webpage.

but how we can expand this temporary fix to include "aqi1" which belongs to another sensor and another data base "aqi1.sdb

we tried

#if getattr($recent, $obs).has_data or $plot_group == "aqi, aqi1"
#if getattr($recent, $obs).has_data or $plot_group == "aqi; aqi1"
#if getattr($recent, $obs).has_data or $plot_group == "aqi",  "aqi1"

none worked and weewx did not complain of these changes or gave any errors but refused to show the plot of both "dayaqi.png" and "dayaqi1.png"

Mks Mk

unread,
Oct 29, 2022, 11:00:51 AM10/29/22
to weewx-user
somehow this below line change fixed both plots

#if getattr($recent, $obs).has_data or $plot_group == "aqi" or $plot_group == "aqi1"

is it ok to keep or remove it?

thank you

Tom Keffer

unread,
Oct 29, 2022, 11:13:42 AM10/29/22
to weewx...@googlegroups.com
This should do it:

      #if getattr($recent, $obs).has_data or $plot_group == "aqi" or $plot_group == "aqi1"

Mks Mk

unread,
Oct 29, 2022, 11:26:43 AM10/29/22
to weewx-user
Thank you for your support.
Reply all
Reply to author
Forward
0 new messages