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/5627b007-b463-432b-9616-db5ad90608cfn%40googlegroups.com.