[weewx-user] Re: Problem with weewx-swb 0.4 under 3.7.0 and 3.7.1

2017-03-31 Thread Andrew Potter
Thanks all - the suggested config changes appear to be working well.
Much appreciated.
Cheers
Andrew

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[weewx-user] Re: Problem with weewx-swb 0.4 under 3.7.0 and 3.7.1

2017-03-30 Thread Andrew Potter
Thanks Matt...
I made the suggested change but still get essentially the same error:

Mar 30 21:57:59 raspberrypi weewx[7145]: File 
"/usr/share/weewx/user/swb.py", line 52, in 
Mar 30 21:57:59 raspberrypi weewx[7145]:  
 weewx.accum.extract_dict['grid_energy'] = weewx.accum.Accum.extract_sum
Mar 30 21:57:59 raspberrypi weewx[7145]:   TypeError: 'NoneType' 
object does not support item assignment
Mar 30 21:57:59 raspberrypi weewx[7145]:   Exiting.

...any other ideas?
Is there a way to drop this out of swb.py and add to the config file as Tom 
suggests?
Cheers
Andrew


On Wednesday, March 29, 2017 at 11:33:30 PM UTC+10:30, mwall wrote:
>
> andrew,
>
> i think this is due to a change in the Accum object in weewx 3.7.0
>
> in the weewx-swb driver file swb.py, please change line 52 from this:
>
> weewx.accum.extract_dict['grid_energy'] = weewx.accum.Accum.sum_extract
>
> to this:
>
> weewx.accum.extract_dict['grid_energy'] = weewx.accum.Accum.extract_sum
>
> maybe tom could chime in about providing some backward compatibility in 
> accum.py...
>
> m
>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[weewx-user] Problem with weewx-swb 0.4 under 3.7.0 and 3.7.1

2017-03-29 Thread Andrew Potter
Hi
I'm running weewx installed from the .deb, and since upgrading from 3.6.2 
(initially to 3.7.0 and now 3.7.1) I've had problems getting weewx-swb to 
run.
I'm running 2 instances of weewx (one for my OWFS-based weather station, 
and the second running SWB v0.4), with separate config files. My weewx-swb 
config file has been upgraded. This setup has performed well through 
previous upgrades, but when I upgraded to 3.7.0 I began seeing errors. 
These have persisted now that I've upgraded to 3.7.1.
My log shows the following errors:

Mar 29 20:04:00 raspberrypi weewx[6163]: engine: Initializing weewx version 
3.7.1
Mar 29 20:04:00 raspberrypi weewx[6163]: engine: Using Python 2.7.3 
(default, Jun 22 2016, 03:14:32) #012[GCC 4.6.3]
Mar 29 20:04:00 raspberrypi weewx[6163]: engine: Platform 
Linux-4.4.38+-armv6l-with-debian-7.11
Mar 29 20:04:00 raspberrypi weewx[6163]: engine: Locale is 'en_AU.UTF-8'
Mar 29 20:04:00 raspberrypi weewx[6163]: engine: pid file is 
/var/run/weewx-swb.pid
Mar 29 20:04:01 raspberrypi weewx[6167]: engine: Using configuration file 
/etc/weewx/weewx-swb.conf
Mar 29 20:04:01 raspberrypi weewx[6167]: engine: Loading station type 
SunnyWebBox (user.swb)
Mar 29 20:04:01 raspberrypi weewx[6167]: engine: Caught unrecoverable 
exception in engine:
Mar 29 20:04:01 raspberrypi weewx[6167]:   type object 'Accum' has 
no attribute 'sum_extract'
Mar 29 20:04:01 raspberrypi weewx[6167]:   Traceback (most recent 
call last):
Mar 29 20:04:01 raspberrypi weewx[6167]: File 
"/usr/share/weewx/weewx/engine.py", line 865, in main
Mar 29 20:04:01 raspberrypi weewx[6167]:   engine = 
engine_class(config_dict)
Mar 29 20:04:01 raspberrypi weewx[6167]: File 
"/usr/share/weewx/weewx/engine.py", line 71, in __init__
Mar 29 20:04:01 raspberrypi weewx[6167]:  
 self.setupStation(config_dict)
Mar 29 20:04:01 raspberrypi weewx[6167]: File 
"/usr/share/weewx/weewx/engine.py", line 95, in setupStation
Mar 29 20:04:01 raspberrypi weewx[6167]:   __import__(driver)
Mar 29 20:04:01 raspberrypi weewx[6167]: File 
"/usr/share/weewx/user/swb.py", line 52, in 
Mar 29 20:04:01 raspberrypi weewx[6167]:  
 weewx.accum.extract_dict['grid_energy'] = weewx.accum.Accum.sum_extract
Mar 29 20:04:01 raspberrypi weewx[6167]:   AttributeError: type 
object 'Accum' has no attribute 'sum_extract'
Mar 29 20:04:01 raspberrypi weewx[6167]:   Exiting.

What have I missed?
Thanks in advance
Andrew

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[weewx-user] Re: Extract maximum value of an observation from loop packet

2016-10-16 Thread Andrew Potter
Thanks Tom and Matt for your prompt responses.
Apologies - I probably didn't quite make my intention clear.
I'm reading a sensor via OWFS, and am hoping to get weewx to only use the 
maximum value measured during any 5-minute archive interval.
Going on from Tom's post, I want to make sure the value of 
'$current.foo.max' is what goes into the database, rather than an average 
or anything else.
I figure one way is to create/write a new data type in the owfs driver to 
return the max value, or work on Matthew's suggestion above, but I'm hoping 
there's an easy way to do it...
Thanks
Andrew


On Sunday, October 16, 2016 at 9:21:28 AM UTC+10:30, mwall wrote:
>
> hi andrew,
>
> it is pretty simple, actually.  make a service that is bound to LOOP 
> packets.  on each loop packet, spit the value(s) to file/disk/database.
>
> create a file in user/captureloop.py that has something like this:
>
> import weewx
> from weewx.engine import StdService
>
> class CaptureLOOP(StdService):
> def __init__(self, engine, config_dict):
> super(CaptureLOOP, self).__init__(engine, config_dict)
> self.filename = config_dict.get('CaptureLOOP', {}).get('filename', 
> '/var/tmp/loop')
> self.bind(weewx.NEW_LOOP_PACKET, self.save_data)
>
> def save_data(self, event):
> with open(self.filename, "w") as f:
> f.write("%s" % event.packet)
>
> then in weewx.conf add user.captureloop.CaptureLoop to the report_services 
> list.
>
> m
>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[weewx-user] Extract maximum value of an observation from loop packet

2016-10-15 Thread Andrew Potter
Hi
I'm hoping to extract and log the maximum value of a sensor from any given loop 
(instead of the average by default).
Is there a way to do this? (I've had a look at accum.py but my Python obviously 
isn't up to scratch to figure it out).
I'm comfortable with needing to add to extensions.py but looking for the 
appropriate accumulator to use.
Thanks in advance
Andrew

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.