On Thursday, July 4, 2019 at 8:01:24 AM UTC-4, Tadej Javornik wrote:
>
> Jul  4 13:57:43 raspberrypi weewx[3645]: restx: MQTT: Unexpected exception 
> of type <type 'exceptions.ValueError'>
> Jul  4 13:57:43 raspberrypi weewx[3645]: *** Traceback (most recent call 
> last):
> Jul  4 13:57:43 raspberrypi weewx[3645]: ***   File 
> "/home/weewx/bin/weewx/restx.py", line 350, in run_loop
> Jul  4 13:57:43 raspberrypi weewx[3645]: ***    
>  self.process_record(_record, dbmanager)
> Jul  4 13:57:43 raspberrypi weewx[3645]: ***   File 
> "/home/weewx/bin/user/mqtt.py", line 396, in process_record
> Jul  4 13:57:43 raspberrypi weewx[3645]: ***     record = 
> self.get_record(record, dbm)
> Jul  4 13:57:43 raspberrypi weewx[3645]: ***   File 
> "/home/weewx/bin/weewx/restx.py", line 270, in get_record
> Jul  4 13:57:43 raspberrypi weewx[3645]: ***     (_result[1], _result[2], 
> record['usUnits']))
> Jul  4 13:57:43 raspberrypi weewx[3645]: *** ValueError: Inconsistent 
> units (1 vs 1 vs 16) when querying for hourRain
> Jul  4 13:57:43 raspberrypi weewx[3645]: restx: MQTT: Thread exiting. 
> Reason: Inconsistent units (1 vs 1 vs 16) when querying for hourRain
>

the unit system in your database is 1 (US) but the unit system in the 
record is 16 (METRIC)

so when weewx tries to calculate hourRain, it fails

one workaround is to disable the calculation of hourRain (and rain24 and 
dayRain) by setting augment_record to False:

[MQTT]
    augment_record = False

but the bigger question is how you are getting packets that have a METRIC 
unit system, even though you are using a database with US unit system.

i'll bet that one of those many other services that you are running is 
sending out packets in METRIC unit system.

so that means the root cause is units confusion between the services you 
have added, the mqtt uploader, and the restx base class/utilities.

let me think about a proper solution (it is probably obvious, but my head 
is still a bit addled by the sun and altitude)

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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/0412dcd7-2328-4ddc-b64c-262ec9c9e273%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to