MQTTSubscribe units conversion failed

92 views
Skip to first unread message

Tarmo

unread,
Feb 23, 2021, 10:52:06 AM2/23/21
to weewx-user
Hi!

I'm getting the following error:
Feb 23 17:25:58 pi3 weewx[1803] DEBUG user.MQTTSubscribe: (Driver) MessageCallbackProvider data-> incoming topic: emhi/26038/precipitations, QOS: 0, retain: 1, payload: b'0.1'
Feb 23 17:25:58 pi3 weewx[1803] DEBUG weewx.units: Unable to convert from mm_per_hour to cm
Feb 23 17:25:58 pi3 weewx[1803] ERROR user.MQTTSubscribe: (Driver) MessageCallbackProvider on_message_individual failed with: 'cm'
Feb 23 17:25:58 pi3 weewx[1803] ERROR user.MQTTSubscribe: (Driver) **** MessageCallbackProvider Ignoring topic=emhi/26038/precipitations and payload=b'0.1'

weewx.conf snippet:
[MQTTSubscribeDriver]
    # This section is for the MQTTSubscribe driver.
    
    # The driver to use:
    driver = user.MQTTSubscribe
    
    # The MQTT server.
    # Default is localhost.
    host = localhost
    
    # The port to connect to.
    # Default is 1883.
    port = 1883
    
    # Maximum period in seconds allowed between communications with the broker.
    # Default is 60.
    keepalive = 60
    
    # username for broker authentication.
    # Default is None.
    username = xxxx
    
    # password for broker authentication.
    # Default is None.
    password = xxxx
    
    # Configuration for the message callback.
    [[message_callback]]
        type = individual
    
    # The topics to subscribe to.
    [[topics]]
        unit_system = METRIC
        use_topic_as_fieldname = true
        use_server_datetime = true
        
        [[[rtl_433/lab/devices/Solight-TE44/1/4/temperature_C]]]
            name = outTemp
        [[[emhi/26038/uvindex]]]
            name = UV
        [[[emhi/26038/airpressure]]]
            name = pressure
        [[[emhi/26038/precipitations]]]
            name = rain
            units = mm_per_hour
        [[[emhi/26038/relativehumidity]]]
            name = outHumidity
        [[[emhi/26038/winddirection]]]
            name = windDir
        [[[emhi/26038/windspeed]]]
            name = windSpeed
            units = meter_per_second
        [[[emhi/26038/windspeedmax]]]
            name = windGust
            units = meter_per_second
        [[[emhi/26038/phenomenon]]]
            name = phenomenon
            conversion_type = None
        [[[emhi/26038/visibility]]]
            name = visibility
            conversion_type = None


bell...@gmail.com

unread,
Feb 23, 2021, 12:42:18 PM2/23/21
to weewx-user
Rain is an ‘incremental’ observation in WeeWX. Meaning that, it is the amount that has fallen since the previous reading. So, expected units are inch, cm, and mm. mm_per_hour is ‘rate’ measurement and cannot be converted to the expected unit of cm. Perhaps you want name = rainRate?
For additional information see, http://www.weewx.com/docs/customizing.htm#units
rich

Tarmo

unread,
Feb 23, 2021, 12:46:01 PM2/23/21
to weewx-user
Ofcourse. My mistake.
Thank you!

Reply all
Reply to author
Forward
0 new messages