When i made weewx for the first time I didn change unit sistem I left it in 
US so my database is in US format. My webpages that are generated are all 
in METRIC (mm, m/s..) what is okay because i'm from EU(Slo.) I don't really 
know how I set it up that this is working because it was 5 years ago. All 
my other services are plain numbers, I used database schema and occupied 
those fields. At first I was having problems because for example I wanted 
to put in extraTemp1 my data from .txt file which was measurement from dust 
sensor( ex. 330) but the weewx thought that it was temperature in F and it 
converted it to C in web page generation so the number was different.  I 
then simply used another database field with no calculation example:UV.. So 
I made quiet a mess.. But it is working normaly  :)
But I didn't touch any rain data ..

Dne Ĩetrtek, 04. julij 2019 14.19.50 UTC+2 je oseba mwall napisala:
>
> 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/35b52dad-7612-40a0-a825-fba3f94265b8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to