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/fc7c5ae5-a6f1-418f-9718-904899215131n%40googlegroups.com.

Reply via email to