Hi Gary,
thanks for your advice. After the modification of weewx.conf mqtt data is 
still delivered (so tha's positive), but no change in the number of decimal 
places.
My config:
#########################
 [[MQTT]]
       enable = true
        unit_system = METRICWX
        # Hostname/IP of MQTT broker
        host = 192.168.2.22
        topic = weather
#        append_units_label = false
        [[[inputs]]]
            [[[[outTemp]]]]
                format = %.2f                # use two decimal places of 
precision
                name = outside_temperature    # use label other than inTemp
            [[[[windSpeed]]]]
                units = meter_per_second
                format = %.1f
                name = windSpeed_m_s
            [[[[windGust]]]]
                units = meter_per_second
                format = %.1f
                name = gust_m_s
###########################

and the result in the broker:
###########################
weather/inTemp_degree_C 27.29999999999999
weather/inHumidity_percent 67
weather/outTemp_degree_C 24.700000000000003
weather/outHumidity_percent 64
weather/pressure_mbar 1012.8
weather/windSpeed_meter_per_second 0.40000099419637863
weather/windGust_meter_per_second 0.6000014912945679
weather/windDir_degree_compass 112.5
weather/windGustDir_degree_compass 112.5
weather/rainRate_mm_per_hour 0.0
weather/rain_mm (null)
weather/rxCheckPercent_percent 100
weather/windBatteryStatus 0
weather/rainBatteryStatus 0
weather/outTempBatteryStatus 0
weather/inTempBatteryStatus 0
weather/altimeter_mbar 1056.8811153752754
weather/appTemp_degree_C 26.97221024879724
weather/barometer_mbar 1055.5080297221955
weather/cloudbase_meter 1267.4829583543142
weather/dewpoint_degree_C 17.422122081623723
weather/ET_mm (null)
weather/heatindex_degree_C 24.89666666666667
weather/humidex_degree_C 30.293088441750406
weather/inDewpoint_degree_C 20.621737268345424
weather/maxSolarRad_watt_per_meter_squared 813.5477625196611
weather/windchill_degree_C 24.700000000000003
weather/windrun_km (null)
weather/usUnits 17
###########################

Something goes wrong, but I've no idea

br

Alex

gjr80 schrieb am Dienstag, 20. August 2024 um 11:02:39 UTC+2:

> Your config stanza format is incorrect; you cannot just insert sub-stanzas 
> in the middle of an existing stanza, the sub-stanzas need to be added to 
> the end. In the case of a WeeWX config file indents don't matter but order 
> does. Try something like:
>
>  [[MQTT]]        # Enable/disable this service
>         enable = true
>         unit_system = METRICWX
>         # Hostname/IP of MQTT broker
>         host = 192.168.2.22
>         topic = weather
>         [[[inputs]]]
>             [[[[outTemp]]]]
>                 format = %.2f                # use two decimal places of 
> precision
>                 name = outside_temperature    # use label other than inTemp
>             [[[[windSpeed]]]]
>                 units = meter_per_second
>                 format = %.2f
>                 name = wind_m_s
>
> The order you had meant the MQTT uploader was never seeing the host and 
> topic config entries.
>
> If that doesn't work post a log extract showing the error.
>
> Gary
> On Tuesday 20 August 2024 at 06:40:46 UTC+10 [email protected] wrote:
>
>> With this config, the weather values are puplished, but (i guess) due to 
>> convert from US (within db) to Metricwx with up to 16 decimal places. 
>> ###############
>>  [[MQTT]]        # Enable/disable this service
>>         enable = true
>>         unit_system = METRICWX
>>         # Hostname/IP of MQTT broker
>>         host = 192.168.2.22
>>         # Prefix for topics
>>         topic = weather
>> #################
>> I took one exemple from https://github.com/weewx/weewx/wiki/mqtt to 
>> reduce the
>> decimal places of the published values, but with this config, mqtt stops 
>> working.
>> #################
>>  [[MQTT]]        # Enable/disable this service
>>         enable = true
>>         unit_system = METRICWX
>>         [[[inputs]]]
>>             [[[[outTemp]]]]
>>                 format = %.2f                # use two decimal places of 
>> precision
>>                 name = outside_temperature    # use label other than 
>> inTemp
>>             [[[[windSpeed]]]]
>>                 units = meter_per_second
>>                 format = %.2f
>>                 name = wind_m_s
>>
>>         # Hostname/IP of MQTT broker
>>         host = 192.168.2.22
>>         topic = weather 
>> #################
>>
>> What could be wrong in the configuration?
>> My aim ist to limit all published values to a max. of 2 digits behind the 
>> dot
>> e. g. instead 
>> weather/windSpeed_meter_per_second 0.40000099419637863
>> is should be:
>> weather/windSpeed_meter_per_second 0.4
>>
>> br
>> Alex
>>
>

-- 
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/b344d75b-b1b1-4b71-a4c7-b8fbd9a458a2n%40googlegroups.com.

Reply via email to