Accumulator configuration and WeeWX crash

117 views
Skip to first unread message

Karen K

unread,
Nov 17, 2022, 2:15:33 PM11/17/22
to weewx-user
I added accumulator definitions in weewx.conf:

[Accumulator]
    ...
    [[upsEstimatedChargeRemaining]]
        accumulator = firstlast
        extractor = last
    [[upsSecondsOnBattery]]
        accumulator = firstlast
        extractor = last
    [[upsEstimatedMinutesRemaining]]
        accumulator = firstlast
        extractor = last

WeeWx crashes then with the error messages shown below.

If I then remove the line accumulator = firstlast, no error occurs any more. So that configuration works fine:
[Accumulator]
    ...
    [[upsEstimatedChargeRemaining]] 
        extractor = last 
    [[upsSecondsOnBattery]] 
        extractor = last 
    [[upsEstimatedMinutesRemaining]] 
        extractor = last 


Error messages for the configuration including the line accumulator = firstlast:

Nov 17 19:30:17 LokalWiki weewx[85284] CRITICAL __main__: Caught unrecoverable exception:

Nov 17 19:30:17 LokalWiki weewx[85284] CRITICAL __main__:     ****  too many values to unpack (expected 4)

Nov 17 19:30:17 LokalWiki weewx[85284] CRITICAL __main__:     ****  Traceback (most recent call last):

Nov 17 19:30:17 LokalWiki weewx[85284] CRITICAL __main__:     ****    File "/usr/share/weewx/weewx/engine.py", line 214, in run

Nov 17 19:30:17 LokalWiki weewx[85284] CRITICAL __main__:     ****      self.dispatchEvent(weewx.Event(weewx.CHECK_LOOP, packet=packet))

Nov 17 19:30:17 LokalWiki weewx[85284] CRITICAL __main__:     ****    File "/usr/share/weewx/weewx/engine.py", line 245, in dispatchEvent

Nov 17 19:30:17 LokalWiki weewx[85284] CRITICAL __main__:     ****      callback(event)

Nov 17 19:30:17 LokalWiki weewx[85284] CRITICAL __main__:     ****    File "/usr/share/weewx/weewx/engine.py", line 634, in check_loop

Nov 17 19:30:17 LokalWiki weewx[85284] CRITICAL __main__:     ****      raise BreakLoop

Nov 17 19:30:17 LokalWiki weewx[85284] CRITICAL __main__:     ****  weewx.engine.BreakLoop

Nov 17 19:30:17 LokalWiki weewx[85284] CRITICAL __main__:     ****  

Nov 17 19:30:17 LokalWiki weewx[85284] CRITICAL __main__:     ****  During handling of the above exception, another exception occurred:

Nov 17 19:30:17 LokalWiki weewx[85284] CRITICAL __main__:     ****  

Nov 17 19:30:17 LokalWiki weewx[85284] CRITICAL __main__:     ****  Traceback (most recent call last):

Nov 17 19:30:17 LokalWiki weewx[85284] CRITICAL __main__:     ****    File "/usr/share/weewx/weewx/engine.py", line 650, in post_loop

Nov 17 19:30:17 LokalWiki weewx[85284] CRITICAL __main__:     ****      self._catchup(self.engine.console.genArchiveRecords)

Nov 17 19:30:17 LokalWiki weewx[85284] CRITICAL __main__:     ****    File "/usr/share/weewx/weewx/engine.py", line 697, in _catchup

Nov 17 19:30:17 LokalWiki weewx[85284] CRITICAL __main__:     ****      for record in generator(lastgood_ts):

Nov 17 19:30:17 LokalWiki weewx[85284] CRITICAL __main__:     ****    File "/usr/share/weewx/weewx/drivers/__init__.py", line 30, in genArchiveRecords

Nov 17 19:30:17 LokalWiki weewx[85284] CRITICAL __main__:     ****      raise NotImplementedError("Method 'genArchiveRecords' not implemented")

Nov 17 19:30:17 LokalWiki weewx[85284] CRITICAL __main__:     ****  NotImplementedError: Method 'genArchiveRecords' not implemented

Nov 17 19:30:17 LokalWiki weewx[85284] CRITICAL __main__:     ****  

Nov 17 19:30:17 LokalWiki weewx[85284] CRITICAL __main__:     ****  During handling of the above exception, another exception occurred:

Nov 17 19:30:17 LokalWiki weewx[85284] CRITICAL __main__:     ****  

Nov 17 19:30:17 LokalWiki weewx[85284] CRITICAL __main__:     ****  Traceback (most recent call last):

Nov 17 19:30:17 LokalWiki weewx[85284] CRITICAL __main__:     ****    File "/usr/share/weewx/weewxd", line 154, in main

Nov 17 19:30:17 LokalWiki weewx[85284] CRITICAL __main__:     ****      engine.run()

Nov 17 19:30:17 LokalWiki weewx[85284] CRITICAL __main__:     ****    File "/usr/share/weewx/weewx/engine.py", line 221, in run

Nov 17 19:30:17 LokalWiki weewx[85284] CRITICAL __main__:     ****      self.dispatchEvent(weewx.Event(weewx.POST_LOOP))

Nov 17 19:30:17 LokalWiki weewx[85284] CRITICAL __main__:     ****    File "/usr/share/weewx/weewx/engine.py", line 245, in dispatchEvent

Nov 17 19:30:17 LokalWiki weewx[85284] CRITICAL __main__:     ****      callback(event)

Nov 17 19:30:17 LokalWiki weewx[85284] CRITICAL __main__:     ****    File "/usr/share/weewx/weewx/engine.py", line 652, in post_loop

Nov 17 19:30:17 LokalWiki weewx[85284] CRITICAL __main__:     ****      self._software_catchup()

Nov 17 19:30:17 LokalWiki weewx[85284] CRITICAL __main__:     ****    File "/usr/share/weewx/weewx/engine.py", line 715, in _software_catchup

Nov 17 19:30:17 LokalWiki weewx[85284] CRITICAL __main__:     ****      self.engine.dispatchEvent(weewx.Event(weewx.NEW_ARCHIVE_RECORD,

Nov 17 19:30:17 LokalWiki weewx[85284] CRITICAL __main__:     ****    File "/usr/share/weewx/weewx/engine.py", line 245, in dispatchEvent

Nov 17 19:30:17 LokalWiki weewx[85284] CRITICAL __main__:     ****      callback(event)

Nov 17 19:30:17 LokalWiki weewx[85284] CRITICAL __main__:     ****    File "/usr/share/weewx/user/snmp.py", line 562, in new_archive_record

Nov 17 19:30:17 LokalWiki weewx[85284] CRITICAL __main__:     ****      self.dbm_new_archive_record(event.record)

Nov 17 19:30:17 LokalWiki weewx[85284] CRITICAL __main__:     ****    File "/usr/share/weewx/user/snmp.py", line 607, in dbm_new_archive_record

Nov 17 19:30:17 LokalWiki weewx[85284] CRITICAL __main__:     ****      self.dbm.addRecord(record,

Nov 17 19:30:17 LokalWiki weewx[85284] CRITICAL __main__:     ****    File "/usr/share/weewx/weewx/manager.py", line 403, in addRecord

Nov 17 19:30:17 LokalWiki weewx[85284] CRITICAL __main__:     ****      self._updateHiLo(accumulator, cursor)

Nov 17 19:30:17 LokalWiki weewx[85284] CRITICAL __main__:     ****    File "/usr/share/weewx/weewx/manager.py", line 1189, in _updateHiLo

Nov 17 19:30:17 LokalWiki weewx[85284] CRITICAL __main__:     ****      _stats_dict = self._get_day_summary(_sod_ts, cursor)

Nov 17 19:30:17 LokalWiki weewx[85284] CRITICAL __main__:     ****    File "/usr/share/weewx/weewx/manager.py", line 1576, in _get_day_summary

Nov 17 19:30:17 LokalWiki weewx[85284] CRITICAL __main__:     ****      _day_accum.set_stats(_day_key, _stats_tuple)

Nov 17 19:30:17 LokalWiki weewx[85284] CRITICAL __main__:     ****    File "/usr/share/weewx/weewx/accum.py", line 485, in set_stats

Nov 17 19:30:17 LokalWiki weewx[85284] CRITICAL __main__:     ****      self[obs_type].setStats(stats_tuple)

Nov 17 19:30:17 LokalWiki weewx[85284] CRITICAL __main__:     ****    File "/usr/share/weewx/weewx/accum.py", line 366, in setStats

Nov 17 19:30:17 LokalWiki weewx[85284] CRITICAL __main__:     ****      self.first, self.firsttime, self.last, self.lasttime = stats_tuple \

Nov 17 19:30:17 LokalWiki weewx[85284] CRITICAL __main__:     ****  ValueError: too many values to unpack (expected 4)

Nov 17 19:30:17 LokalWiki weewx[85284] CRITICAL __main__:     ****  Exiting.


Tom Keffer

unread,
Nov 18, 2022, 4:21:09 PM11/18/22
to weewx...@googlegroups.com
The problem is that FirstLast values are not designed to be stored in the daily summaries (although there's no reason they couldn't be). 

Try removing upsEstimatedChargeRemaining, upsSecondsOnBattery, and upsEstimatedMinutesRemaining from the daily summary schema. 

--
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/8bcb4c52-fb04-487f-b0bc-60f032e18808n%40googlegroups.com.

Karen K

unread,
Nov 19, 2022, 9:45:32 AM11/19/22
to weewx-user
Oh, thank you. That is a detail that I was not aware of.

Tom Keffer

unread,
Nov 19, 2022, 10:21:33 AM11/19/22
to weewx...@googlegroups.com
... because it is not documented anywhere.

Issue #814.

Reply all
Reply to author
Forward
0 new messages