Beta of Version 4 is available

424 views
Skip to first unread message

Thomas Keffer

unread,
Nov 15, 2019, 4:02:57 PM11/15/19
to weewx-development
Version 4 is now feature complete. There is lots of exciting new stuff, including:
  • Support for Python 3
  • User-defined derived types.
  • More customizable logging.
  • Support for Vantage LOOP2 packets.
and lots of other, little things.

The WeeWX test suites have never been better, but the one thing they can't test is hardware! We need you for that!

For the moment, V4 is available only for setup.py installs. Download it from the usual place, install, then run it on your local hardware. If you can, run it under Python 2.7, and Python 3. Report back.

Thanks in advance!!

-tk

Joe Spears

unread,
Nov 15, 2019, 4:46:55 PM11/15/19
to weewx-development
Upgraded from the previous alpha version.  Its been running well for me and the upgrade went smoothly.  Thanks.  

Raspberry Pi 4
Vantage Vue

Joe Spears

Vince Skahan

unread,
Nov 15, 2019, 7:06:15 PM11/15/19
to weewx-development
Installed b1 on a pi4 using my patched weatherflow-UDP driver using python3.  Looks ok.

One thing folks should remember is to be careful they pick the python of their choice (python, python2, python3, whatever your os calls it) so that all your prerequisites are present.  I keep forgetting to specify python3 in my setup.py commands :-)

Thomas Keffer

unread,
Nov 15, 2019, 7:08:00 PM11/15/19
to Joe Spears, weewx-development
Thanks, Joe. Which version of Python did you use?

--
You received this message because you are subscribed to the Google Groups "weewx-development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-developm...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-development/d451b3f5-d614-400f-82e7-8f3663512fb4%40googlegroups.com.

Thomas Keffer

unread,
Nov 15, 2019, 7:09:44 PM11/15/19
to Vince Skahan, weewx-development
You should be able to install WeeWX under Python 2.7, then run under Python 3. Did you have a different experience?

On Fri, Nov 15, 2019 at 4:06 PM Vince Skahan <vince...@gmail.com> wrote:
Installed b1 on a pi4 using my patched weatherflow-UDP driver using python3.  Looks ok.

One thing folks should remember is to be careful they pick the python of their choice (python, python2, python3, whatever your os calls it) so that all your prerequisites are present.  I keep forgetting to specify python3 in my setup.py commands :-)

--
You received this message because you are subscribed to the Google Groups "weewx-development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-developm...@googlegroups.com.

Vince Skahan

unread,
Nov 15, 2019, 7:24:47 PM11/15/19
to Thomas Keffer, weewx-development
How would you install under one python and tell it to run under another (short of manually running it in the foreground) ?

Wouldn't you also need all the corequisites for both versions as well ?

--
-----  vince...@gmail.com ----

Thomas Keffer

unread,
Nov 15, 2019, 7:43:35 PM11/15/19
to Vince Skahan, weewx-development
Install under any version you like. The only thing setup.py needs is configobj.

Then run under any version, After, of course, installing the necessary prerequisites for that version.

Personally, I've almost entirely switched to Python 3. These days, the only thing I'm using Python 2 for is to check compatibility. So, I've installed the prereqs for both versions.

-tk

Vince Skahan

unread,
Nov 15, 2019, 9:25:04 PM11/15/19
to weewx-development
Yup, works fine under either one here for my slightly patched WF UDP driver.

Anybody running a WF station who wants to use python3 should use the forked driver in my PR at the author's site.   I made a slight update today after some more python2 testing.  Works fine (as does weewx) under either python2 or python3.

gjr80

unread,
Nov 15, 2019, 11:34:22 PM11/15/19
to weewx-development
Just a note for anyone who may be toying with the new --calc-missing functionality in wee_database; it is broken in the current beta (b1). I should have a commit that fixes it this afternoon and I guess that will appear in the next beta.

Gary

Hartmut Schweidler

unread,
Nov 16, 2019, 6:51:28 AM11/16/19
to weewx-development
Hallo

there is an error in the function "cumumativ"

i have in skin

       
[[[dayraintot]]]
           
[[[[rain]]]]
                aggregate_type
= cumulative
                aggregate_interval
= 600
                label
= Regen (gesamt)

in syslog

Nov 16 12:45:39 wetter weewx-weewx[17305] INFO weewx.cheetahgenerator: Generated 13 files for report StandardReport in 11.84 seconds
Nov 16 12:45:40 wetter weewx-weewx[17305] ERROR weewx.reportengine: reportengine: Caught unrecoverable exception in generator 'weewx.imagegenerator.ImageGenerator'
Nov 16 12:45:40 wetter weewx-weewx[17305] ERROR weewx.reportengine:         ****  cumulative
Nov 16 12:45:40 wetter weewx-weewx[17305] ERROR weewx.reportengine:         ****  Traceback (most recent call last):
Nov 16 12:45:40 wetter weewx-weewx[17305] ERROR weewx.reportengine:         ****    File "/home/weewx/bin/weewx/reportengine.py", line 202, in run
Nov 16 12:45:40 wetter weewx-weewx[17305] ERROR weewx.reportengine:         ****      obj.start()
Nov 16 12:45:40 wetter weewx-weewx[17305] ERROR weewx.reportengine:         ****    File "/home/weewx/bin/weewx/reportengine.py", line 285, in start
Nov 16 12:45:40 wetter weewx-weewx[17305] ERROR weewx.reportengine:         ****      self.run()
Nov 16 12:45:40 wetter weewx-weewx[17305] ERROR weewx.reportengine:         ****    File "/home/weewx/bin/weewx/imagegenerator.py", line 41, in run
Nov 16 12:45:40 wetter weewx-weewx[17305] ERROR weewx.reportengine:         ****      self.genImages(self.gen_ts)
Nov 16 12:45:40 wetter weewx-weewx[17305] ERROR weewx.reportengine:         ****    File "/home/weewx/bin/weewx/imagegenerator.py", line 180, in genImages
Nov 16 12:45:40 wetter weewx-weewx[17305] ERROR weewx.reportengine:         ****      aggregate_interval=aggregate_interval)
Nov 16 12:45:40 wetter weewx-weewx[17305] ERROR weewx.reportengine:         ****    File "/home/weewx/bin/weewx/xtypes.py", line 77, in get_series
Nov 16 12:45:40 wetter weewx-weewx[17305] ERROR weewx.reportengine:         ****      return xtype.get_series(obs_type, timespan, db_manager, aggregate_type, aggregate_interval)
Nov 16 12:45:40 wetter weewx-weewx[17305] ERROR weewx.reportengine:         ****    File "/home/weewx/bin/weewx/xtypes.py", line 123, in get_series
Nov 16 12:45:40 wetter weewx-weewx[17305] ERROR weewx.reportengine:         ****      agg_vt = get_aggregate(obs_type, stamp, aggregate_type, db_manager)
Nov 16 12:45:40 wetter weewx-weewx[17305] ERROR weewx.reportengine:         ****    File "/home/weewx/bin/weewx/xtypes.py", line 94, in get_aggregate
Nov 16 12:45:40 wetter weewx-weewx[17305] ERROR weewx.reportengine:         ****      raise weewx.UnknownAggregation(aggregate_type)
Nov 16 12:45:40 wetter weewx-weewx[17305] ERROR weewx.reportengine:         ****  weewx.UnknownAggregation: cumulative
Nov 16 12:45:40 wetter weewx-weewx[17305] ERROR weewx.reportengine:         ****  Generator terminated
Nov 16 12:45:40 wetter weewx-weewx[17305] INFO weewx.reportengine: Copied 0 files to /home/weewx/public_html
Nov 16 12:45:40 wetter weewx-weewx[17305] INFO weewx.cheetahgenerator: Generated 0 files for report AstroReport in 0.03 seconds


otherwise everything is going very well

Thanks to all
Hartmut

Joe Spears

unread,
Nov 16, 2019, 8:17:30 AM11/16/19
to weewx-development
I have been using python 3


On Friday, November 15, 2019 at 7:08:00 PM UTC-5, Tom Keffer wrote:
Thanks, Joe. Which version of Python did you use?

On Fri, Nov 15, 2019 at 1:46 PM Joe Spears <jgsp...@gmail.com> wrote:
Upgraded from the previous alpha version.  Its been running well for me and the upgrade went smoothly.  Thanks.  

Raspberry Pi 4
Vantage Vue

Joe Spears

On Friday, November 15, 2019 at 4:02:57 PM UTC-5, Tom Keffer wrote:
Version 4 is now feature complete. There is lots of exciting new stuff, including:
  • Support for Python 3
  • User-defined derived types.
  • More customizable logging.
  • Support for Vantage LOOP2 packets.
and lots of other, little things.

The WeeWX test suites have never been better, but the one thing they can't test is hardware! We need you for that!

For the moment, V4 is available only for setup.py installs. Download it from the usual place, install, then run it on your local hardware. If you can, run it under Python 2.7, and Python 3. Report back.

Thanks in advance!!

-tk

--
You received this message because you are subscribed to the Google Groups "weewx-development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-de...@googlegroups.com.

Thomas Keffer

unread,
Nov 16, 2019, 8:51:52 AM11/16/19
to Hartmut Schweidler, weewx-development
Thanks, Hartmut! That's exactly the kind of testing we're looking for!

Fixed in commit f1c50ae. If you want to fix your version, replace the file /home/weewx/bin/weewx/xtypes.py with this.

-tk

--
You received this message because you are subscribed to the Google Groups "weewx-development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-developm...@googlegroups.com.

Hartmut Schweidler

unread,
Nov 16, 2019, 11:47:33 AM11/16/19
to weewx-development
Hallo
and now by  my  "StandardReport" an "cumulative"
Nov 16 17:40:27 wetter weewx-weewx[18349] INFO weewx.restx: PWSWeather: Published record 2019-11-16 17:40:00 CET (1573922400)
Nov 16 17:40:28 wetter weewx-weewx[18349] INFO weewx.restx: WindFinder: Published record 2019-11-16 17:40:00 CET (1573922400)
Nov 16 17:40:28 wetter weewx-weewx[18349] INFO weewx.restx: Wunderground-PWS: Published record 2019-11-16 17:40:00 CET (1573922400)
Nov 16 17:40:41 wetter weewx-weewx[18349] INFO weewx.cheetahgenerator: Generated 14 files for report StandardReport in 13.73 seconds
Nov 16 17:40:43 wetter weewx-weewx[18349] INFO weewx.imagegenerator: Generated 33 images for StandardReport in 1.98 seconds
Nov 16 17:40:43 wetter weewx-weewx[18349] INFO weewx.reportengine: Copied 0 files to /home/weewx/public_html
Nov 16 17:40:43 wetter weewx-weewx[18349] INFO weewx.cheetahgenerator: Generated 0 files for report AstroReport in 0.03 seconds
Nov 16 17:40:43 wetter weewx-weewx[18349] INFO weewx.imagegenerator: Generated 2 images for AstroReport in 0.16 seconds
Nov 16 17:40:43 wetter weewx-weewx[18349] INFO weewx.reportengine: Copied 0 files to /home/weewx/public_html

but in
        [[[weekrain]]]
            yscale
= None, None, 0.02
            plot_type
= bar
           
[[[[rain]]]]
                aggregate_type
= sum
                aggregate_interval
= 86400
                label
= Rain (mm/Day)

is error

Nov 16 17:41:32 wetter weewx-weewx[18349] INFO weewx.cheetahgenerator: Generated 10 files for report CalendarReport in 23.25 seconds
Nov 16 17:41:33 wetter weewx-weewx[18349] ERROR weewx.reportengine: reportengine: Caught unrecoverable exception in generator 'weewx.imagegenerator.ImageGenerator'
Nov 16 17:41:33 wetter weewx-weewx[18349] ERROR weewx.reportengine:         ****  sum
Nov 16 17:41:33 wetter weewx-weewx[18349] ERROR weewx.reportengine:         ****  Traceback (most recent call last):
Nov 16 17:41:33 wetter weewx-weewx[18349] ERROR weewx.reportengine:         ****    File "/home/weewx/bin/weewx/reportengine.py", line 202, in run
Nov 16 17:41:33 wetter weewx-weewx[18349] ERROR weewx.reportengine:         ****      obj.start()
Nov 16 17:41:33 wetter weewx-weewx[18349] ERROR weewx.reportengine:         ****    File "/home/weewx/bin/weewx/reportengine.py", line 285, in start
Nov 16 17:41:33 wetter weewx-weewx[18349] ERROR weewx.reportengine:         ****      self.run()
Nov 16 17:41:33 wetter weewx-weewx[18349] ERROR weewx.reportengine:         ****    File "/home/weewx/bin/weewx/imagegenerator.py", line 41, in run
Nov 16 17:41:33 wetter weewx-weewx[18349] ERROR weewx.reportengine:         ****      self.genImages(self.gen_ts)
Nov 16 17:41:33 wetter weewx-weewx[18349] ERROR weewx.reportengine:         ****    File "/home/weewx/bin/weewx/imagegenerator.py", line 180, in genImages
Nov 16 17:41:33 wetter weewx-weewx[18349] ERROR weewx.reportengine:         ****      aggregate_interval=aggregate_interval)
Nov 16 17:41:33 wetter weewx-weewx[18349] ERROR weewx.reportengine:         ****    File "/home/weewx/bin/weewx/xtypes.py", line 77, in get_series
Nov 16 17:41:33 wetter weewx-weewx[18349] ERROR weewx.reportengine:         ****      return xtype.get_series(obs_type, timespan, db_manager, aggregate_type, aggregate_interval)
Nov 16 17:41:33 wetter weewx-weewx[18349] ERROR weewx.reportengine:         ****    File "/home/weewx/bin/weewx/xtypes.py", line 126, in get_series
Nov 16 17:41:33 wetter weewx-weewx[18349] ERROR weewx.reportengine:         ****      agg_vt = get_aggregate(obs_type, stamp, do_aggregate, db_manager)
Nov 16 17:41:33 wetter weewx-weewx[18349] ERROR weewx.reportengine:         ****    File "/home/weewx/bin/weewx/xtypes.py", line 94, in get_aggregate
Nov 16 17:41:33 wetter weewx-weewx[18349] ERROR weewx.reportengine:         ****      raise weewx.UnknownAggregation(aggregate_type)
Nov 16 17:41:33 wetter weewx-weewx[18349] ERROR weewx.reportengine:         ****  weewx.UnknownAggregation: sum
Nov 16 17:41:33 wetter weewx-weewx[18349] ERROR weewx.reportengine:         ****  Generator terminated
Nov 16 17:41:33 wetter weewx-weewx[18349] INFO weewx.reportengine: Copied 0 files to /home/weewx/public_html
Nov 16 17:41:33 wetter weewx-weewx[18349] INFO weewx.cheetahgenerator: Generated 6 files for report SmartphoneReport in 0.10 seconds

Vince Skahan

unread,
Nov 16, 2019, 1:04:09 PM11/16/19
to weewx-development
Is there a problem with secondary db ?

I'm trying to update my odds+ends skins/extensions to v4 and every one that creates/uses an alternate db fails to initialize similarly. Figuring Matthew's code would be a better test case than mine, I grabbed pmon.py as a reference implementation and that fails exactly the same way:

PYTHONPATH=/home/weewx/bin python pmon.py
 
Traceback (most recent call last):
  File "pmon.py", line 173, in <module>
    eng = StdEngine(config)
  File "/home/weewx/bin/weewx/engine.py", line 83, in __init__
    self.loadServices(config_dict)
  File "/home/weewx/bin/weewx/engine.py", line 143, in loadServices
    obj = weeutil.weeutil.get_object(svc)(self,config_dict)
  File "/home/weewx/bin/user/pmon.py", line 70, in __init__
    initialize=True)
  File "/home/weewx/bin/weewx/manager.py", line 507, in get_manager
    self.manager_cache[data_binding] = open_manager(manager_dict, initialize)
  File "/home/weewx/bin/weewx/manager.py", line 660, in open_manager
    manager_dict['schema'])
  File "/home/weewx/bin/weewx/manager.py", line 151, in open_with_create
    dbmanager = cls(connection, table_name=table_name, schema=schema)
  File "/home/weewx/bin/weewx/manager.py", line 799, in __init__
    self._initialize_day_tables(schema)
  File "/home/weewx/bin/weewx/manager.py", line 845, in _initialize_day_tables
    cursor.execute(sql_create_str)
  File "/home/weewx/bin/weedb/sqlite.py", line 39, in guarded_fn
    raise weedb.TableExistsError(e)
weedb.TableExistsError: table archive_day_m already exists

(I used python2 because pmon.py isn't python3 friendly yet)

Tom

unread,
Nov 16, 2019, 5:34:24 PM11/16/19
to weewx-development

Using Version 4 Beta, Raspberry Pi, and Python3.  The Meteotemplate is giving these errors.  I was able to correct the second one by changing the

 

 

except KeyError, e: to except KeyError as e: on line 106 and

 except weewx.ViolatedPrecondition, e: to  except weewx.ViolatedPrecondition as e: on line 123

 

I have no idea about the Queue error.

 

Nov 16 16:00:59 raspberrypi weewx[4171] CRITICAL weewx.engine: Caught unrecoverable exception:

Nov 16 16:00:59 raspberrypi weewx[4171] CRITICAL weewx.engine:     ****  No module named 'Queue'

Nov 16 16:00:59 raspberrypi weewx[4171] CRITICAL weewx.engine:     ****  Traceback (most recent call last):

Nov 16 16:00:59 raspberrypi weewx[4171] CRITICAL weewx.engine:     ****    File "/home/weewx/bin/weewx/engine.py", line 883, in main

Nov 16 16:00:59 raspberrypi weewx[4171] CRITICAL weewx.engine:     ****      engine = StdEngine(config_dict)

Nov 16 16:00:59 raspberrypi weewx[4171] CRITICAL weewx.engine:     ****    File "/home/weewx/bin/weewx/engine.py", line 83, in __init__

Nov 16 16:00:59 raspberrypi weewx[4171] CRITICAL weewx.engine:     ****      self.loadServices(config_dict)

Nov 16 16:00:59 raspberrypi weewx[4171] CRITICAL weewx.engine:     ****    File "/home/weewx/bin/weewx/engine.py", line 143, in loadServices

Nov 16 16:00:59 raspberrypi weewx[4171] CRITICAL weewx.engine:     ****      obj = weeutil.weeutil.get_object(svc)(self,config_dict)

Nov 16 16:00:59 raspberrypi weewx[4171] CRITICAL weewx.engine:     ****    File "/home/weewx/bin/weeutil/weeutil.py", line 1107, in get_object

Nov 16 16:00:59 raspberrypi weewx[4171] CRITICAL weewx.engine:     ****      mod = __import__(module)

Nov 16 16:00:59 raspberrypi weewx[4171] CRITICAL weewx.engine:     ****    File "/home/weewx/bin/user/meteotemplate.py", line 55, in <module>

Nov 16 16:00:59 raspberrypi weewx[4171] CRITICAL weewx.engine:     ****      import Queue

Nov 16 16:00:59 raspberrypi weewx[4171] CRITICAL weewx.engine:     ****  ModuleNotFoundError: No module named 'Queue'

Nov 16 16:00:59 raspberrypi weewx[4171] CRITICAL weewx.engine:     ****  Exiting.

 

 

Nov 16 16:10:01 raspberrypi weewx[7906] CRITICAL weewx.engine: Caught unrecoverable exception:

Nov 16 16:10:01 raspberrypi weewx[7906] CRITICAL weewx.engine:     ****  invalid syntax (meteotemplate.py, line 106)

Nov 16 16:10:01 raspberrypi weewx[7906] CRITICAL weewx.engine:     ****  Traceback (most recent call last):

Nov 16 16:10:01 raspberrypi weewx[7906] CRITICAL weewx.engine:     ****    File "/home/weewx/bin/weewx/engine.py", line 883, in main

Nov 16 16:10:01 raspberrypi weewx[7906] CRITICAL weewx.engine:     ****      engine = StdEngine(config_dict)

Nov 16 16:10:01 raspberrypi weewx[7906] CRITICAL weewx.engine:     ****    File "/home/weewx/bin/weewx/engine.py", line 83, in __init__

Nov 16 16:10:01 raspberrypi weewx[7906] CRITICAL weewx.engine:     ****      self.loadServices(config_dict)

Nov 16 16:10:01 raspberrypi weewx[7906] CRITICAL weewx.engine:     ****    File "/home/weewx/bin/weewx/engine.py", line 143, in loadServices

Nov 16 16:10:01 raspberrypi weewx[7906] CRITICAL weewx.engine:     ****      obj = weeutil.weeutil.get_object(svc)(self,config_dict)

Nov 16 16:10:01 raspberrypi weewx[7906] CRITICAL weewx.engine:     ****    File "/home/weewx/bin/weeutil/weeutil.py", line 1107, in get_object

Nov 16 16:10:01 raspberrypi weewx[7906] CRITICAL weewx.engine:     ****      mod = __import__(module)

Nov 16 16:10:01 raspberrypi weewx[7906] CRITICAL weewx.engine:     ****    File "/home/weewx/bin/user/meteotemplate.py", line 106

Nov 16 16:10:01 raspberrypi weewx[7906] CRITICAL weewx.engine:     ****      except KeyError, e:

Nov 16 16:10:01 raspberrypi weewx[7906] CRITICAL weewx.engine:     ****                     ^

Nov 16 16:10:01 raspberrypi weewx[7906] CRITICAL weewx.engine:     ****  SyntaxError: invalid syntax

Nov 16 16:10:01 raspberrypi weewx[7906] CRITICAL weewx.engine:     ****  Exiting.

 

Tom



Thomas Keffer

unread,
Nov 16, 2019, 6:36:07 PM11/16/19
to Hartmut Schweidler, weewx-development
Hartmut, try this version of xtypes.py

-tk

--
You received this message because you are subscribed to the Google Groups "weewx-development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-developm...@googlegroups.com.
xtypes.py

Thomas Keffer

unread,
Nov 16, 2019, 7:19:24 PM11/16/19
to Vince Skahan, weewx-development
The problem was with old-style schemas (see the upgrading guide if you're interested). Fixed in commit c99c25e.

That fixed that problem, but pmon still doesn't seem to be working, at least for me. Perhaps you can investigate further?



--
You received this message because you are subscribed to the Google Groups "weewx-development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-developm...@googlegroups.com.

Thomas Keffer

unread,
Nov 16, 2019, 7:20:13 PM11/16/19
to Tom, weewx-development
Tom,

These are problems in meteotemplate, which does not seem to have been ported to Python 3. You'll have to ask the author for fixes (it is not part of WeeWX).

-tk

--
You received this message because you are subscribed to the Google Groups "weewx-development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-developm...@googlegroups.com.

gjr80

unread,
Nov 16, 2019, 7:32:40 PM11/16/19
to weewx-development
4.0 is throwing the following for me under python 3.5.3:

Nov 17 10:27:34 stretch41 weewx[16116] INFO weewx.engine: Starting main packet loop.
Nov 17 10:30:14 stretch41 weewx[16116] INFO weewx.manager: Added record 2019-11-17 10:30:00 AEST (1573950600) to database 'weewx.sdb'
Nov 17 10:30:14 stretch41 weewx[16116] INFO weewx.manager: Added record 2019-11-17 10:30:00 AEST (1573950600) to daily summary in 'weewx.sdb'
Nov 17 10:30:15 stretch41 weewx[16116] ERROR weewx.cheetahgenerator: Generate failed with exception '<class 'TypeError'>'
Nov 17 10:30:15 stretch41 weewx[16116] ERROR weewx.cheetahgenerator: **** Ignoring template /home/weewx/skins/Seasons/NOAA/NOAA-YYYY-MM.txt.tmpl
Nov 17 10:30:15 stretch41 weewx[16116] ERROR weewx.cheetahgenerator: **** Reason: get_aggregate() missing 1 required positional argument: 'db_manager'
Nov 17 10:30:15 stretch41 weewx[16116] ERROR weewx.cheetahgenerator: ****  Traceback (most recent call last):
Nov 17 10:30:15 stretch41 weewx[16116] ERROR weewx.cheetahgenerator: ****    File "/home/weewx/bin/weewx/cheetahgenerator.py", line 329, in generate
Nov 17 10:30:15 stretch41 weewx[16116] ERROR weewx.cheetahgenerator: ****      unicode_string = compiled_template.respond()
Nov 17 10:30:15 stretch41 weewx[16116] ERROR weewx.cheetahgenerator: ****    File "_home_weewx_skins_Seasons_NOAA_NOAA_YYYY_MM_txt_tmpl.py", line 450, in respond
Nov 17 10:30:15 stretch41 weewx[16116] ERROR weewx.cheetahgenerator: ****    File "_home_weewx_skins_Seasons_NOAA_NOAA_YYYY_MM_txt_tmpl.py", line 204, in __errorCatcher20
Nov 17 10:30:15 stretch41 weewx[16116] ERROR weewx.cheetahgenerator: ****    File "<string>", line 1, in <module>
Nov 17 10:30:15 stretch41 weewx[16116] ERROR weewx.cheetahgenerator: ****    File "/home/weewx/bin/weewx/tags.py", line 334, in __getattr__
Nov 17 10:30:15 stretch41 weewx[16116] ERROR weewx.cheetahgenerator: ****      return self._do_query(aggregate_type)
Nov 17 10:30:15 stretch41 weewx[16116] ERROR weewx.cheetahgenerator: ****    File "/home/weewx/bin/weewx/tags.py", line 351, in _do_query
Nov 17 10:30:15 stretch41 weewx[16116] ERROR weewx.cheetahgenerator: ****      db_manager, val=val, **self.option_dict)
Nov 17 10:30:15 stretch41 weewx[16116] ERROR weewx.cheetahgenerator: ****    File "/home/weewx/bin/weewx/xtypes.py", line 91, in get_aggregate
Nov 17 10:30:15 stretch41 weewx[16116] ERROR weewx.cheetahgenerator: ****      return xtype.get_aggregate(obs_type, timespan, aggregate_type, db_manager, **option_dict)
Nov 17 10:30:15 stretch41 weewx[16116] ERROR weewx.cheetahgenerator: ****    File "/home/weewx/bin/weewx/xtypes.py", line 494, in get_aggregate
Nov 17 10:30:15 stretch41 weewx[16116] ERROR weewx.cheetahgenerator: ****      Tavg_t = AggregateDaily.get_aggregate('outTemp', daySpan, 'avg', db_manager)
Nov 17 10:30:15 stretch41 weewx[16116] ERROR weewx.cheetahgenerator: ****  TypeError: get_aggregate() missing 1 required positional argument: 'db_manager'
Nov 17 10:30:15 stretch41 weewx[16116] ERROR weewx.cheetahgenerator: Generate failed with exception '<class 'TypeError'>'
Nov 17 10:30:15 stretch41 weewx[16116] ERROR weewx.cheetahgenerator: **** Ignoring template /home/weewx/skins/Seasons/NOAA/NOAA-YYYY.txt.tmpl
Nov 17 10:30:15 stretch41 weewx[16116] ERROR weewx.cheetahgenerator: **** Reason: get_aggregate() missing 1 required positional argument: 'db_manager'
Nov 17 10:30:15 stretch41 weewx[16116] ERROR weewx.cheetahgenerator: ****  Traceback (most recent call last):
Nov 17 10:30:15 stretch41 weewx[16116] ERROR weewx.cheetahgenerator: ****    File "/home/weewx/bin/weewx/cheetahgenerator.py", line 329, in generate
Nov 17 10:30:15 stretch41 weewx[16116] ERROR weewx.cheetahgenerator: ****      unicode_string = compiled_template.respond()
Nov 17 10:30:15 stretch41 weewx[16116] ERROR weewx.cheetahgenerator: ****    File "_home_weewx_skins_Seasons_NOAA_NOAA_YYYY_txt_tmpl.py", line 703, in respond
Nov 17 10:30:15 stretch41 weewx[16116] ERROR weewx.cheetahgenerator: ****    File "_home_weewx_skins_Seasons_NOAA_NOAA_YYYY_txt_tmpl.py", line 246, in __errorCatcher18
Nov 17 10:30:15 stretch41 weewx[16116] ERROR weewx.cheetahgenerator: ****    File "<string>", line 1, in <module>
Nov 17 10:30:15 stretch41 weewx[16116] ERROR weewx.cheetahgenerator: ****    File "/home/weewx/bin/weewx/tags.py", line 334, in __getattr__
Nov 17 10:30:15 stretch41 weewx[16116] ERROR weewx.cheetahgenerator: ****      return self._do_query(aggregate_type)
Nov 17 10:30:15 stretch41 weewx[16116] ERROR weewx.cheetahgenerator: ****    File "/home/weewx/bin/weewx/tags.py", line 351, in _do_query
Nov 17 10:30:15 stretch41 weewx[16116] ERROR weewx.cheetahgenerator: ****      db_manager, val=val, **self.option_dict)
Nov 17 10:30:15 stretch41 weewx[16116] ERROR weewx.cheetahgenerator: ****    File "/home/weewx/bin/weewx/xtypes.py", line 91, in get_aggregate
Nov 17 10:30:15 stretch41 weewx[16116] ERROR weewx.cheetahgenerator: ****      return xtype.get_aggregate(obs_type, timespan, aggregate_type, db_manager, **option_dict)
Nov 17 10:30:15 stretch41 weewx[16116] ERROR weewx.cheetahgenerator: ****    File "/home/weewx/bin/weewx/xtypes.py", line 494, in get_aggregate
Nov 17 10:30:15 stretch41 weewx[16116] ERROR weewx.cheetahgenerator: ****      Tavg_t = AggregateDaily.get_aggregate('outTemp', daySpan, 'avg', db_manager)
Nov 17 10:30:15 stretch41 weewx[16116] ERROR weewx.cheetahgenerator: ****  TypeError: get_aggregate() missing 1 required positional argument: 'db_manager'
Nov 17 10:30:15 stretch41 weewx[16116] INFO weewx.cheetahgenerator: Generated 6 files for report SeasonsReport in 0.49 seconds
Nov 17 10:30:15 stretch41 weewx[16116] ERROR weewx.reportengine: reportengine: Caught unrecoverable exception in generator 'weewx.imagegenerator.ImageGenerator'
Nov 17 10:30:15 stretch41 weewx[16116] ERROR weewx.reportengine:         ****  'WXDaySummaryManager' object is not iterable
Nov 17 10:30:15 stretch41 weewx[16116] ERROR weewx.reportengine:         ****  Traceback (most recent call last):
Nov 17 10:30:15 stretch41 weewx[16116] ERROR weewx.reportengine:         ****    File "/home/weewx/bin/weewx/reportengine.py", line 202, in run
Nov 17 10:30:15 stretch41 weewx[16116] ERROR weewx.reportengine:         ****      obj.start()
Nov 17 10:30:15 stretch41 weewx[16116] ERROR weewx.reportengine:         ****    File "/home/weewx/bin/weewx/reportengine.py", line 285, in start
Nov 17 10:30:15 stretch41 weewx[16116] ERROR weewx.reportengine:         ****      self.run()
Nov 17 10:30:15 stretch41 weewx[16116] ERROR weewx.reportengine:         ****    File "/home/weewx/bin/weewx/imagegenerator.py", line 41, in run
Nov 17 10:30:15 stretch41 weewx[16116] ERROR weewx.reportengine:         ****      self.genImages(self.gen_ts)
Nov 17 10:30:15 stretch41 weewx[16116] ERROR weewx.reportengine:         ****    File "/home/weewx/bin/weewx/imagegenerator.py", line 180, in genImages
Nov 17 10:30:15 stretch41 weewx[16116] ERROR weewx.reportengine:         ****      aggregate_interval=aggregate_interval)
Nov 17 10:30:15 stretch41 weewx[16116] ERROR weewx.reportengine:         ****    File "/home/weewx/bin/weewx/xtypes.py", line 77, in get_series
Nov 17 10:30:15 stretch41 weewx[16116] ERROR weewx.reportengine:         ****      return xtype.get_series(obs_type, timespan, db_manager, aggregate_type, aggregate_interval)
Nov 17 10:30:15 stretch41 weewx[16116] ERROR weewx.reportengine:         ****    File "/home/weewx/bin/weewx/xtypes.py", line 570, in get_series
Nov 17 10:30:15 stretch41 weewx[16116] ERROR weewx.reportengine:         ****      return SeriesArchive.get_series(obs_type, timespan, db_manager, aggregate_type, aggregate_interval)
Nov 17 10:30:15 stretch41 weewx[16116] ERROR weewx.reportengine:         ****    File "/home/weewx/bin/weewx/xtypes.py", line 113, in get_series
Nov 17 10:30:15 stretch41 weewx[16116] ERROR weewx.reportengine:         ****      startstamp, stopstamp = timespan
Nov 17 10:30:15 stretch41 weewx[16116] ERROR weewx.reportengine:         ****  TypeError: 'WXDaySummaryManager' object is not iterable
Nov 17 10:30:15 stretch41 weewx[16116] ERROR weewx.reportengine:         ****  Generator terminated
Nov 17 10:30:15 stretch41 weewx[16116] INFO weewx.reportengine: Copied 5 files to /home/weewx/public_html

Should point out this is running the development branch as of commit c99c25e

Gary

Vince Skahan

unread,
Nov 16, 2019, 8:16:44 PM11/16/19
to weewx-development
On Saturday, November 16, 2019 at 4:19:24 PM UTC-8, Tom Keffer wrote:
The problem was with old-style schemas (see the upgrading guide if you're interested). Fixed in commit c99c25e.


Yup - works for me.  Thanks.

 
That fixed that problem, but pmon still doesn't seem to be working, at least for me. Perhaps you can investigate further?



After applying that commit, it's very close.
Looks like the utf-8 thing that I ran into on the WF UDP driver.

Run through "2to3 -w" to fix up the print statements, then insert one line ala:

              cmd = 'ps aux'
              p = Popen(cmd, shell=True, stdout=PIPE)
              o = p.communicate()[0]
              o = str(o,'utf-8')                     # <== needed for python3
              for line in o.split('\n'):
                  if line.find(self.process) >= 0:
                      m = self.COLUMNS.search(line)

At that point for me, after the manager.py edits, pmon seems to work ok in at least its standalone test mode.



Thomas Keffer

unread,
Nov 16, 2019, 8:45:33 PM11/16/19
to gjr80, weewx-development
Gary, did you get this under the commit I just did an hour ago? If so, try the development branch now. I reverted that commit.

-tk

--
You received this message because you are subscribed to the Google Groups "weewx-development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-developm...@googlegroups.com.

gjr80

unread,
Nov 16, 2019, 9:01:55 PM11/16/19
to weewx-development
I just pulled down development now and it is running error free.

Gary
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-de...@googlegroups.com.

Thomas Keffer

unread,
Nov 16, 2019, 9:15:47 PM11/16/19
to Hartmut Schweidler, weewx-development
Hartmut, another question: are you sure the problem is in the following plot?

        [[[weekrain]]]
            yscale 
= None, None, 0.02
            plot_type 
= bar
            
[[[[rain]]]]
                aggregate_type 
= sum
                aggregate_interval 
= 86400
                label 
= Rain (mm/Day)

How did you determine this was the problem?

-tk

Hartmut Schweidler

unread,
Nov 17, 2019, 2:17:19 AM11/17/19
to weewx-development
Good morning from Germany

Hallo Tom

the problem is not in the skin.conf because in all other works xtypes.py correctly.

Ich suche noch die Ursache für diese konkrete Fehlermeldung aber an der skin.conf liegt es nicht.
I'm still looking for the cause of this specific error message but the skin.conf is not.

Hartmut
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-de...@googlegroups.com.

Vince Skahan

unread,
Nov 17, 2019, 2:20:57 PM11/17/19
to weewx-development
Probable nit, but I see a bare comma in the value on the data_services line in the b1 weewx.conf file.  Is that meaningful or just something extraneous ?

Thomas Keffer

unread,
Nov 17, 2019, 2:51:45 PM11/17/19
to Vince Skahan, weewx-development
Meaningful. That’s how configObj knows it’s a list, and not a single value.

On Sun, Nov 17, 2019 at 11:21 AM Vince Skahan <vince...@gmail.com> wrote:
Probable nit, but I see a bare comma in the value on the data_services line in the b1 weewx.conf file.  Is that meaningful or just something extraneous ?

--
You received this message because you are subscribed to the Google Groups "weewx-development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-developm...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-development/80f83d69-3c8d-431d-a1cc-b0b7633c8230%40googlegroups.com.
--
-tk

Rich Bell

unread,
Nov 19, 2019, 10:16:31 AM11/19/19
to weewx-development
With this in weewx.conf
[ComputerMonitor]
    max_age = None
 
Getting the following error:
Traceback (most recent call last):
  File "./bin/weewxd", line 64, in <module>
    weewx.engine.main(options, args)
  File "/home/pi/4.0.0b1/bin/weewx/engine.py", line 883, in main
    engine = StdEngine(config_dict)
  File "/home/pi/4.0.0b1/bin/weewx/engine.py", line 83, in __init__
    self.loadServices(config_dict)
  File "/home/pi/4.0.0b1/bin/weewx/engine.py", line 143, in loadServices
    obj = weeutil.weeutil.get_object(svc)(self,config_dict)
  File "/home/pi/4.0.0b1/bin/user/cmon.py", line 667, in __init__
    self.max_age = weeutil.weeutil.to_int(d.get('max_age', 2592000))
  File "/home/pi/4.0.0b1/bin/weeutil/weeutil.py", line 1248, in to_int
    return int(float(x))
ValueError: could not convert string to float: None

Rich Bell

unread,
Nov 19, 2019, 10:18:19 AM11/19/19
to weewx-development
Should have added, running under python 2.

Thomas Keffer

unread,
Nov 19, 2019, 11:41:44 AM11/19/19
to Rich Bell, weewx-development
Fixed in commit 178114d.

Thanks, Rich!

-tk

--
You received this message because you are subscribed to the Google Groups "weewx-development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-developm...@googlegroups.com.

Hartmut Schweidler

unread,
Nov 19, 2019, 1:34:09 PM11/19/19
to weewx-development
Hallo Tom,

wie wird den einzelnen Werten aus der Datenbank die Funktion "sum" wie zum Beispiel bei ($day($data_binding='wd_binding').cooldeg.sum) zugewiesen, denn hier vermute ich den 

raise weewx.UnknownAggregation(aggregate_type)
        ****  weewx.UnknownAggregation: sum

Des Weitern, gibt es eine Funktion "alltime" in der Version 4.0.0b1
-----------------------------------------------------------
how is the individual values from the database assigned the function "sum", such as ($ day ($ data_binding = 'wd_binding'). cooldeg.sum), because here I suspect the error

raise weewx.UnknownAggregation (aggregate_type)
         **** weewx.UnknownAggregation: sum

Furthermore, there is a function "alltime" in version 4.0.0b1

Gruss Hartmut

Thomas Keffer

unread,
Nov 19, 2019, 1:45:36 PM11/19/19
to Hartmut Schweidler, weewx-development
I am unable to reproduce this error, nor do I understand the context in which it is happening. 

Could you please:
  1. tar up your report 'CalendarReport'
  2. take out any passwords in weewx.conf. You can use the utility wee_debug to do this.
Then send them both to me. tke...@gmail.com

-tk

--
You received this message because you are subscribed to the Google Groups "weewx-development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-developm...@googlegroups.com.

Hartmut Schweidler

unread,
Nov 19, 2019, 2:19:56 PM11/19/19
to weewx-development
Hallo Tom

the skin 'CalendarReport' und die aktuellen weewx.conf und cmon.conf
by  https://github.com/hes19073/hesweewx/tree/master/skins

Gruss und Danke Hartmut

Thomas Keffer

unread,
Nov 19, 2019, 2:28:35 PM11/19/19
to Hartmut Schweidler, weewx-development
I am sorry, Hartmut, but that skin has an extraordinary number of custom databases, bindings, templates, search list extensions, observation types, and generators that I can't possibly debug it.

You're going to have to get the problem down to something simple, using standard WeeWX facilities.

-tk

--
You received this message because you are subscribed to the Google Groups "weewx-development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-developm...@googlegroups.com.

Hartmut Schweidler

unread,
Nov 19, 2019, 3:17:05 PM11/19/19
to weewx-development
Hallo Tom

Ok I can try it on the weekend
Thanks for the many hints
But until version a8, everything went fine


thanks again for the help

Hartmut
Am Dienstag, 19. November 2019 20:28:35 UTC+1 schrieb Tom Keffer:
I am sorry, Hartmut, but that skin has an extraordinary number of custom databases, bindings, templates, search list extensions, observation types, and generators that I can't possibly debug it.

You're going to have to get the problem down to something simple, using standard WeeWX facilities.

-tk

On Tue, Nov 19, 2019 at 11:19 AM Hartmut Schweidler <hesf...@gmail.com> wrote:
Hallo Tom

the skin 'CalendarReport' und die aktuellen weewx.conf und cmon.conf
by  https://github.com/hes19073/hesweewx/tree/master/skins

Gruss und Danke Hartmut

--
You received this message because you are subscribed to the Google Groups "weewx-development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-de...@googlegroups.com.

Rich Bell

unread,
Nov 19, 2019, 4:25:42 PM11/19/19
to weewx-development
I'm throwing various extensions  that I have collected at the beta, so feel free to push back if the problem needs an update to the extension.
Under python 2 I am getting this:

Traceback (most recent call last):
  File "/home/pi/4.0.0b1/bin/weewx/reportengine.py", line 202, in run
    obj.start()
  File "/home/pi/4.0.0b1/bin/weewx/reportengine.py", line 285, in start
    self.run()
  File "/home/pi/4.0.0b1/bin/weewx/imagegenerator.py", line 41, in run
    self.genImages(self.gen_ts)
  File "/home/pi/4.0.0b1/bin/weewx/imagegenerator.py", line 180, in genImages
    aggregate_interval=aggregate_interval)
  File "/home/pi/4.0.0b1/bin/weewx/xtypes.py", line 77, in get_series
    return xtype.get_series(obs_type, timespan, db_manager, aggregate_type, aggregate_interval)
  File "/home/pi/4.0.0b1/bin/weewx/xtypes.py", line 573, in get_series
    return SeriesArchive.get_series(obs_type, timespan, db_manager, aggregate_type, aggregate_interval)
  File "/home/pi/4.0.0b1/bin/weewx/xtypes.py", line 126, in get_series
    agg_vt = get_aggregate(obs_type, stamp, do_aggregate, db_manager)
  File "/home/pi/4.0.0b1/bin/weewx/xtypes.py", line 91, in get_aggregate
    return xtype.get_aggregate(obs_type, timespan, aggregate_type, db_manager, **option_dict)
  File "/home/pi/4.0.0b1/bin/weewx/xtypes.py", line 656, in get_aggregate
    value = complex(row[0], row[1])
TypeError: complex() argument must be a string or a number

I wrapped the line in a try/except to print out some variables, so it is actually line 655 in xtypes
Here are the values for select_stmt, aggregate_type, and row
SELECT windGust, windGustDir, usUnits FROM archive WHERE windGust = (SELECT MAX(windGust) FROM archive WHERE dateTime > 1574139600 AND dateTime <= 1574143200  AND windGust IS NOT NULL)
max
(0.0, None, 1)

-rich

Thomas Keffer

unread,
Nov 19, 2019, 6:41:10 PM11/19/19
to Rich Bell, weewx-development
You're making it easy! 

Turns out the vector arithmetic got neglected as well. I think I got it all fixed in commit 073be00. You can just download xtypes.py if you want to patch your copy, or do a pull on the repository.

--
You received this message because you are subscribed to the Google Groups "weewx-development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-developm...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-development/2f201206-3b3c-49b8-b653-40f6473fcae2%40googlegroups.com.

Rich Bell

unread,
Nov 19, 2019, 7:37:45 PM11/19/19
to weewx-development

Working great. Thanks!
- rich
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-de...@googlegroups.com.

Rich Bell

unread,
Nov 19, 2019, 7:46:04 PM11/19/19
to weewx-development
Patch is working.

Happy to finally be able to contribute in some way. Can’t thank you, Matthew, Gary, and all the others for this great software.
- rich
> To unsubscribe from this group and stop receiving emails from it, send an email to weewx-de...@googlegroups.com.
Message has been deleted

Hartmut Schweidler

unread,
Nov 23, 2019, 9:15:31 AM11/23/19
to weewx-development
supplement

Die Auswertung aus zwei Datenbanken scheint so nicht mehr möglich

The evaluation of two databases seems no longer possible

i had in skin.conf

        [[[monthET_rain]]]
            data_binding = wd_binding
            [[[[rain_ET]]]]
                aggregate_type = cumulative
                aggregate_interval = 10800
                label = 'Wasser-Verdunstung /'
            [[[[data]]]]
                data_binding = wx_binding
                data_type = rain-ET
                aggregate_type = cumulative
                aggregate_interval = 10800
                label = 'Wasserbilanz ges.'


also the following error  "weewx.UnknownAggregation: sum"  found like here

Nov 21 06:46:33 wetter weewx-weewx[6777] ERROR weewx.reportengine: reportengine: Caught unrecoverable exception in generator 'weewx.imagegenerator.ImageGenerator'
Nov 21 06:46:33 wetter weewx-weewx[6777] ERROR weewx.reportengine:         ****  sum
Nov 21 06:46:33 wetter weewx-weewx[6777] ERROR weewx.reportengine:         ****  Traceback (most recent call last):
Nov 21 06:46:33 wetter weewx-weewx[6777] ERROR weewx.reportengine:         ****    File "/home/weewx/bin/weewx/reportengine.py", line 202, in run
Nov 21 06:46:33 wetter weewx-weewx[6777] ERROR weewx.reportengine:         ****      obj.start()
Nov 21 06:46:33 wetter weewx-weewx[6777] ERROR weewx.reportengine:         ****    File "/home/weewx/bin/weewx/reportengine.py", line 285, in start
Nov 21 06:46:33 wetter weewx-weewx[6777] ERROR weewx.reportengine:         ****      self.run()
Nov 21 06:46:33 wetter weewx-weewx[6777] ERROR weewx.reportengine:         ****    File "/home/weewx/bin/weewx/imagegenerator.py", line 41, in run
Nov 21 06:46:33 wetter weewx-weewx[6777] ERROR weewx.reportengine:         ****      self.genImages(self.gen_ts)
Nov 21 06:46:33 wetter weewx-weewx[6777] ERROR weewx.reportengine:         ****    File "/home/weewx/bin/weewx/imagegenerator.py", line 180, in genImages
Nov 21 06:46:33 wetter weewx-weewx[6777] ERROR weewx.reportengine:         ****      aggregate_interval=aggregate_interval)
Nov 21 06:46:33 wetter weewx-weewx[6777] ERROR weewx.reportengine:         ****    File "/home/weewx/bin/weewx/xtypes.py", line 77, in get_series
Nov 21 06:46:33 wetter weewx-weewx[6777] ERROR weewx.reportengine:         ****      return xtype.get_series(obs_type, timespan, db_manager, aggregate_type, aggregate_interval)
Nov 21 06:46:33 wetter weewx-weewx[6777] ERROR weewx.reportengine:         ****    File "/home/weewx/bin/weewx/xtypes.py", line 126, in get_series
Nov 21 06:46:33 wetter weewx-weewx[6777] ERROR weewx.reportengine:         ****      agg_vt = get_aggregate(obs_type, stamp, do_aggregate, db_manager)
Nov 21 06:46:33 wetter weewx-weewx[6777] ERROR weewx.reportengine:         ****    File "/home/weewx/bin/weewx/xtypes.py", line 94, in get_aggregate
Nov 21 06:46:33 wetter weewx-weewx[6777] ERROR weewx.reportengine:         ****      raise weewx.UnknownAggregation(aggregate_type)
Nov 21 06:46:33 wetter weewx-weewx[6777] ERROR weewx.reportengine:         ****  weewx.UnknownAggregation: sum
Nov 21 06:46:33 wetter weewx-weewx[6777] ERROR weewx.reportengine:         ****  Generator terminated

Thomas Keffer

unread,
Nov 23, 2019, 11:15:56 AM11/23/19
to Hartmut Schweidler, weewx-development
What is type 'rain-ET'? Is it defined in the schemas for bindings wx_binding and wd_binding?

If it is not defined, you will get this error. With beta 3, I've improved the error message.

-tk

--
You received this message because you are subscribed to the Google Groups "weewx-development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-developm...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-development/5f89788c-37d5-46f2-8750-41b25b2b99fa%40googlegroups.com.

Hartmut Schweidler

unread,
Nov 23, 2019, 11:54:14 AM11/23/19
to weewx-development
this is not a datentype
it is an operation rain minus ET

At some point here was reported in the forum about it

I have graphically compared the two different calculations
rain sum minus evaporation water balance

but has no relevance anymore

gruss Hartmut
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-de...@googlegroups.com.

Thomas Keffer

unread,
Nov 23, 2019, 12:41:29 PM11/23/19
to Hartmut Schweidler, weewx-development
Unfortunately, the ImageGenerator does not allow you to use an expression as a data type; only type that appear in the schema, or as an xtype.

Defining a new xtype is not terribly hard. It would look something like this (NOT TESTED):

File user/rainet.py:

import weewx.units
import weewx.xtypes

class RainET(weewx.xtypes.XType):

    @staticmethod
    def get_scalar(obs_type, record, db_manager=None):

        if obs_type != 'rain-ET':
            raise weewx.UnknownType

        rain = record.get('rain')
        ET = record.get('ET')

        if rain is not None and ET is not None:
            record['rain-ET'] = rain - ET

    @staticmethod
    def get_aggregate(obs_type, timespan, aggregate_type, db_manager, **option_dict):

        if obs_type != 'rain-ET':
            raise weewx.UnknownType
        if aggregate_type != 'sum':
            raise weewx.UnknownAggregation

        sql = "SELECT SUM(rain - ET) FROM %s WHERE dateTime>? AND dateTime<=?;" % db_manager.table_name

        row = db_manager.getSql(sql, timespan)

        if row is not None:
            value = row[0]
        else:
            value = None

        # There is probably a more elegant way of doing this:
        if db_manager.std_unit_system == weewx.US:
            unit = 'inch'
        elif db_manager.std_unit_system == weewx.METRIC:
            unit = 'cm'
        else:
            unit = 'mm'

        vt = weewx.units.ValueTuple(value, unit, 'group_rain')
        return vt

# Insert my new class into the xtypes system:
weewx.xtypes.xtypes.append(RainET())


The final detail is that you have to make sure this file gets run, so that the new type will get inserted into the xtypes system. The easiest is to import it from a file that you know will get executed before the reporting happens.

import user.rainet

-tk


To unsubscribe from this group and stop receiving emails from it, send an email to weewx-developm...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-development/1672886f-7237-4e29-95b8-3bf39e5e30b4%40googlegroups.com.

Thomas Keffer

unread,
Nov 23, 2019, 4:02:16 PM11/23/19
to Hartmut Schweidler, weewx-development
Hartmut, on reflection, I recall the discussion in the forum about being able to use simple expressions in aggregates.

I will try to modify the xtypes facility to accommodate this.

Thanks for reminding me.

-tk
Reply all
Reply to author
Forward
0 new messages