Purple Air graph problem

148 views
Skip to first unread message

Ralph Underwood

unread,
Aug 17, 2026, 12:31:33 PM (7 days ago) Aug 17
to weewx-user

I have a PurpleAir air quality monitor. It was previously used at a vacation home connected to a WeeWx weather station. My memory of the setup was that it was pretty simple, install a Purple Air extension and data appeared and a graph was installed automagically.


I do not remember the air quality stuff being in a separate database. I believe that I was using a 4.something version of WeeWx.


Now I am trying to get it working with my home WeeWx installation. I installed the Purple extension and I can get data from it to display in my current.inc using  a line :

<td class=“data">$latest('purpleair_binding').pm2_5_cf_1</td>


I have been trying to get the image generator to work with the PurpleAir and so far no joy.

This is what I have in my Seasons skin.conf:


 

        [[[daypurpleair]]]

            [[[[pm2_5_cf_1]]]]

                data_binding = purpleair_binding


I have purpleair in the plot groups.



I am using WeeWx version 5.1.0 on  RPi.  I installed using pip.


Any guess on what dumb thing I am missing?


Is the separate database required or does the extended WeeWx schema work? 


Thanks for any guidance.


Vince Skahan

unread,
Aug 17, 2026, 2:24:56 PM (7 days ago) Aug 17
to weewx-user
Impossible to say with such little information.    No debug=1 logs.  No excerpts for purpleair from your weewx.conf either.  No info on 'which' purpleair extension you are running (there are a few). Insufficient info of what you changed where re: the Seasons skin.

We can't read minds.

FWIW - I a modified version of Ken Baker's v0.1 extension. If you look at the top of purpleair.py there are comments saying what your weewx.conf should contain.  It saves to its own db.  Works fine.

Ralph Underwood

unread,
Aug 18, 2026, 11:45:09 AM (6 days ago) Aug 18
to weewx-user
I have attached a bit of log and the skin.conf and weewx..conf.

The image file is being written to my website, however it does not display with the other plots. I have edited the plot groups order a couple of times as I tested things.

I used apt to install weewx on an Rpi.
weewxlog.pdf

Vince Skahan

unread,
Aug 18, 2026, 12:24:01 PM (6 days ago) Aug 18
to weewx-user
I'm not going to battle through a PDF.  Sorry.

If the image is being generated, it sounds like all you want to do is add a plot to the Seasons skin.  Sorry can't help there.  Don't use that skin.  I'm sure many others do.

Ralph Underwood

unread,
Aug 18, 2026, 12:41:47 PM (6 days ago) Aug 18
to weewx-user
Sorry that a pdf is a battle. 

John Kline

unread,
Aug 18, 2026, 2:45:29 PM (6 days ago) Aug 18
to weewx...@googlegroups.com, weewx-user
Subject: Re: PurpleAir Graph Problem

Your images are being generated. They just aren't being linked into the page.

Look at your own log. At 08:25 the FTP generator uploaded daypurpleair.png,
weekpurpleair.png and monthpurpleair.png (items 3, 13 and 14 in the upload
list). Nothing is wrong with your ImageGenerator stanza. Browse directly to
daypurpleair.png on your site and I expect you'll see a perfectly good plot.

The reason it doesn't appear on index.html is the auto-provisioning feature of
the parameterized Seasons skin. For each plot group, index.html.tmpl does
something like this:

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

check_for_data uses the report's default binding, which is wx_binding, i.e.
weewx.sdb. Your pm2_5_cf_1 lives in purpleair.sdb, so the check comes back
false, show_plot is never set, and no img tag is emitted. Tom described exactly
this on weewx-user a while back and opened issue #803 to track it: there is
currently no way to tell the auto-provisioning logic to look at a different
database.

The workaround is Tom's: edit index.html.tmpl and change that test to

    #if $recent.check_for_data($obs) or $plot_group == "purpleair"

Same edit in statistics.html.tmpl if you want it there too.

One other thing while you're in there: you have purpleair in plot_groups and
year in periods, but there is no [[[yearpurpleair]]] stanza under
[[year_images]]. The Year button will point at a file that never gets built.

On the data_binding placement, it doesn't matter. In your email you had it
under [[[[pm2_5_cf_1]]]] and in the skin.conf you sent it's under
[[[daypurpleair]]]. Both work, because options accumulate downward from the
plot to the line. The plot-level form is what the extension's readme shows.

As to your actual question: with the bakerkj weewx-purpleair extension the
separate database isn't optional. That extension writes to its own database by
design, and its schema uses fields like pm2_5_cf_1, pm2_5_atm and pm10_0_cf_1,
none of which exist in wview_extended. wview_extended has only pm1_0, pm2_5 and
pm10_0. That mismatch is also precisely why Seasons can't auto-provision the
plot for you.

Which brings me to a guess about your vacation-home setup. The fact that you
remember no separate database, and that a graph appeared automagically,
strongly suggests you were running a different extension then - perhaps my
weewx-purple extension, which populates the pm1_0, pm2_5 and pm10_0 columns in the main
archive. Once the data is in those columns, Seasons finds it and puts the plot
up with no configuration from you at all. That would explain both of your
memories exactly.

So you have a choice. Patch the template as above and stay where you are, or
switch extensions and get the old behavior back. Two things to weigh if you
switch: the history already in purpleair.sdb would be stranded, and
weewx-purple stores the EPA-corrected PM2.5 rather than the raw pm2_5_cf_1
you're displaying now, so your numbers will shift a bit.

John

On Aug 18, 2026, at 5:45 PM, Ralph Underwood <ral...@gmail.com> wrote:

I have attached a bit of log and the skin.conf and weewx..conf.
--
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 visit https://groups.google.com/d/msgid/weewx-user/20f85b1c-65e0-4646-a310-d01bec13aa4dn%40googlegroups.com.
<weewxlog.pdf>

Ralph Underwood

unread,
Aug 18, 2026, 5:20:43 PM (5 days ago) Aug 18
to weewx-user
John,

Thanks for the explanation of what was going on. I am able to log in and see the image when going directly to the png file.
For my purposes, I think using your extension will be preferable.  Where do I find it?

Ralph

John Kline

unread,
Aug 18, 2026, 6:25:28 PM (5 days ago) Aug 18
to weewx...@googlegroups.com, weewx-user

Ralph Underwood

unread,
Aug 18, 2026, 7:16:57 PM (5 days ago) Aug 18
to weewx-user
I have installed it and now have graphs!

Thanks, Ralph
Reply all
Reply to author
Forward
0 new messages