Hello.
I can't get windDir and windGustDir data in MQTT uploader. I was able to 
add other  missing measurements successfully like ET, windchill, windrun 
and interval.

This is my MQTT section in weewx.conf
    [[MQTT]]
        server_url = mqtt://usr:pwd@localhost:1883/

        topic = weewx
        unit_system = METRIC
        binding = archive, loop
        aggregation = aggregate
        log_success = False
        log_failure = True
        [[[inputs]]]
            [[[[altimeter]]]]
                name = altimeter_hPa
                units = hPa
            [[[[barometer]]]]
                name = barometer_hPa
                units = hPa
            [[[[pressure]]]]
                name = pressure_hPa
                units = hPa
            [[[[dayRain]]]]
                name = dayRain_mm
                units = mm
            [[[[rainRate]]]]
                name = rainRate_mm_per_hour
                units = mm_per_hour
            [[[[hourRain]]]]
                name = hourRain_mm
                units= mm
            [[[[rain24]]]]
                name = rain24_mm
                units= mm
            [[[[rain]]]]
                name = rain_mm
                units= mm
            [[[[windchill]]]]
                name = windchill_C
                units= degree_C
            [[[[windDir]]]]
                name = windDir
                #units= degree_compass
                units= ordinal_compass
            [[[[windGustDir]]]]
                name = windGustDir
                #units= degree_compass
                units= ordinal_compass
            [[[[ET]]]]
                name = ET_mm
                units= mm
                #units = mm_per_day
            [[[[windrun]]]]
                name = windrun_km
                units= km
            [[[[interval]]]]
                name = interval
                #units= seconds
        [[[tls]]]

There is another problem if I set units = mm_per_day for ET MQTT fails with 
this error. 

May 28 11:30:58 pi2weewx python3[1673]: weewx[1673] DEBUG weewx.units: 
Unable to convert from cm to mm_per_day
May 28 11:30:58 pi2weewx python3[1673]: weewx[1673] ERROR weewx.restx: 
MQTT: Unexpected exception of type <class 'KeyError'>
May 28 11:30:59 pi2weewx python3[1673]: weewx[1673] ERROR weewx.restx: *** 
Traceback (most recent call last):
May 28 11:30:59 pi2weewx python3[1673]: weewx[1673] DEBUG 
weewx.reportengine: Running reports for latest time in the database.
May 28 11:30:59 pi2weewx python3[1673]: weewx[1673] ERROR weewx.restx: *** 
  File "/usr/share/weewx/weewx/restx.py", line 382, in run_loop
May 28 11:30:59 pi2weewx python3[1673]: weewx[1673] ERROR weewx.restx: *** 
    self.process_record(_record, dbmanager)
May 28 11:30:59 pi2weewx python3[1673]: weewx[1673] DEBUG 
weewx.reportengine: Report 'SeasonsReport' not enabled. Skipping.
May 28 11:30:59 pi2weewx python3[1673]: weewx[1673] ERROR weewx.restx: *** 
  File "/usr/share/weewx/user/mqtt.py", line 476, in process_record
May 28 11:30:59 pi2weewx python3[1673]: weewx[1673] DEBUG 
weewx.reportengine: Report 'SmartphoneReport' not enabled. Skipping.
May 28 11:30:59 pi2weewx python3[1673]: weewx[1673] ERROR weewx.restx: *** 
    data = self.filter_data(record)
May 28 11:30:59 pi2weewx python3[1673]: weewx[1673] DEBUG 
weewx.reportengine: Report 'MobileReport' not enabled. Skipping.
May 28 11:30:59 pi2weewx python3[1673]: weewx[1673] ERROR weewx.restx: *** 
  File "/usr/share/weewx/user/mqtt.py", line 455, in filter_data
May 28 11:30:59 pi2weewx python3[1673]: weewx[1673] DEBUG 
weewx.reportengine: Report 'StandardReport' not enabled. Skipping.
May 28 11:30:59 pi2weewx python3[1673]: weewx[1673] ERROR weewx.restx: *** 
    v = weewx.units.convert(from_t, to_units)[0]
May 28 11:30:59 pi2weewx python3[1673]: weewx[1673] DEBUG 
weewx.reportengine: Running report 'FTP'
May 28 11:30:59 pi2weewx python3[1673]: weewx[1673] ERROR weewx.restx: *** 
  File "/usr/share/weewx/weewx/units.py", line 1454, in convert
May 28 11:30:59 pi2weewx python3[1673]: weewx[1673] ERROR weewx.restx: *** 
    conversion_func = conversionDict[val_t[1]][target_unit]
May 28 11:30:59 pi2weewx python3[1673]: weewx[1673] ERROR weewx.restx: *** 
KeyError: 'mm_per_day'
May 28 11:30:59 pi2weewx python3[1673]: weewx[1673] CRITICAL weewx.restx: 
MQTT: Thread terminating. Reason: 'mm_per_day'

As far I understand ET is a rate in mm_per_day unit and it is supported in 
this commit. I had to set it (units = mm) to make it work
https://github.com/weewx/weewx/commit/59de935189d29617525ae8227832ea39c652f3e1
Thanks!!

-- 
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/3d8d240d-4fda-43d7-bae4-a83e2135da38n%40googlegroups.com.

Reply via email to