Bob, As noted earlier, now that you have a base MQTTSubscribe configuration up and running, you probably want to look at its 'archive record cache capability'. Details are here, https://github.com/bellrichm/WeeWX-MQTTSubscribe/wiki/Configuring-additional-options#expires_after
I think that setting expires_after to none would be the simplest. So you would end up with something like this. [MQTTSubscribeService] [[topics]] [[[mytopic]]] ignore = true [[[[CO2_Value_PPM]]]] name = co2 ignore = false expires_after = none rich On Saturday, 4 December 2021 at 15:09:39 UTC-5 gjr80 wrote: > The other approach is to give WeeWX at least one co2 value per archive > period (it can be the same value) but that is a function of your data > source and the driver being used and I don’t know the > limitations/capabilities of each. > > Gary > > On Sunday, 5 December 2021 at 05:56:10 UTC+10 gjr80 wrote: > >> The issue here is that the ‘co2 field’ receives data only once per hour, >> so based on a 15 minute archive period only one in four archive records >> will have co2 data. Changing the accumulator type and extraction policy >> will not change this. I would leave the co2 accumulator settings out of >> weewx.conf. I doubt whether $last will be much help either; $last displays >> data from the last known good record in the database as opposed to the >> current record used by $current. If there is no co2 data in most records >> then $last will provide a similar result. >> >> You may have better luck with some sort of aggregate over the past hour, >> say something like (untested) $span($hour_delta=1).co2.avg. The actual >> aggregate is probably meaningless since you only have one value per hour so >> min be mx will work just as well. >> >> Gary >> On Sunday, 5 December 2021 at 03:59:46 UTC+10 [email protected] wrote: >> >>> Sorry, here is some info. This time, I re-inserted the [Accumulator] >>> paragraph at a different place in weewx.conf and it restarted without an >>> exit. The web data is still showing "$last.co2" >>> It ran for a while and then stopped. Debug file attached. Thanks >>> weewx.conf >>> >>> # Options for 'MQTTSubscribeService' >>> [Accumulator] >>> [[co2]] >>> accumulator = firstlast >>> extractor = last >>> >>> [MQTTSubscribeService] >>> # This section is for the MQTTSubscribe service. >>> >>> # Turn the service on and off. >>> # Default is: true >>> # Only used by the service. >>> enable = true # false >>> ================================================== >>> index.html.tmpl >>> <tr class = "even"> >>> <td class="stats_label">105 Crawl Temperature</td> >>> <td class="stats_data">$current.extraTemp1 / >>> $current.extraTemp1.degree_C</td> >>> </tr> >>> <tr class = "even"> >>> <td class="stats_label">CO2 level</td> >>> <td class="stats_data">$last.co2</td> >>> </tr> >>> >>> >>> ================================================== >>> >>> Standard web page reads: (http://grattans.org/wx) >>> >>> 105 Crawl Temperature 72.0°F / 22.2°C >>> CO2 level $last.co2 >>> >>> On Saturday, December 4, 2021 at 12:07:09 PM UTC-5 vince wrote: >>> >>>> On Saturday, December 4, 2021 at 7:16:00 AM UTC-8 [email protected] >>>> wrote: >>>> >>>>> I tried changing $current.co2 to $last.co2 but it only printed >>>>> "$last.co2" on the web page. >>>>> >>>>> Adding the [Accumulator] section to weewx.conf only caused an error >>>>> and exit when I restarted weewx. I tried adding this in several places >>>>> but >>>>> none seems to let weewx restart without an exit error. Is there a >>>>> special >>>>> place to add this? Couldn't find anything in the doc about placement. >>>>> Thanks >>>>> >>>>> >>>> Usual answers apply. >>>> >>>> Unless you post the error messages verbatim and/or the changes you made >>>> to the skin, we are not going to be able to help you. >>>> >>>> >>> -- 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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/7196cfc0-77cf-49dd-98bd-5405c0aadfadn%40googlegroups.com.
