Not getting extraTemp1 nor extraTemp2 that are being sent via MQTT. Any help would be appreciated.
I know the data is getting to the mosquitto broker.
This is the setup on weewx.conf.
[MQTTSubscribeService]
# This section is for the MQTTSubscribe service.
# Turn the service on and off.
# Default is: true
# Only used by the service.
enable = true
# The MQTT server.
# Default is localhost.
host = 192.168.1.166
# The port to connect to.
# Default is 1883.
port = 1883
# Maximum period in seconds allowed between communications with the broker.
# Default is 60.
keepalive = 120
# username for broker authentication.
# Default is None.
Username = ODT
# password for broker authentication.
# Default is None.
Password = ??????
# The binding, loop or archive.
# Default is: loop
# Only used by the service.
binding = loop
# The message handler to use
[[message_callback]]
# The format of the MQTT payload.
# Currently support: individual, json, keyword
# Must be specified.
type = individual
# The topics to subscribe to.
[[topics]]
# Units for MQTT payloads without unit value.
# Valid values: US, METRIC, METRICWX
# Default is: US
unit_system = METRIC
# When true, the fieldname is set to the topic and therefore [[[[fieldname]]]] cannot be used.
# This allows the [[[[fieldname]]]] configuration to be specified directly under the [[[topic]]].
# Default is False.
use_topic_as_fieldname = True
# The first topic to subscribe to.
[[[topic/rtd_temperature]]]
# The WeeWX name.
# Default is the name from MQTT.
name = extraTemp1
# True if the incoming data should not be processed into WeeWX.
# Valid values: True, False
# Default is False
ignore = False
# True if the incoming data is cumulative.
# Valid values: True, False
# Default is False
contains_total = False
# The conversion type necessary for WeeWX compatibility
# Valid values: bool, float, int, none
# Default is float
conversion_type = float
# The units of the incoming data.
# Useful if this field's units differ from the topic's unit_system's units.
# Valid values: see, http://www.weewx.com/docs/customizing.htm#units
# Default is not set
units = degree_C
[[[topic/tmp117_temperature]]]
# The WeeWX name.
# Default is the name from MQTT.
name = extraTemp2
# True if the incoming data should not be processed into WeeWX.
# Valid values: True, False
# Default is False
ignore = False
# True if the incoming data is cumulative.
# Valid values: True, False
# Default is False
contains_total = False
# The conversion type necessary for WeeWX compatibility
# Valid values: bool, float, int, none
# Default is float
conversion_type = float
# The units of the incoming data.
# Useful if this field's units differ from the topic's unit_system's units.
# Valid values: see, http://www.weewx.com/docs/customizing.htm#units
# Default is not set
units = degree_C
When I run debug = 1 I get this but no extraTemp1 or 2
Mar 2 15:26:15 pi34 weewx[4895] DEBUG user.MQTTSubscribe: (Service) data-> final packet is 2023-03-02 15:26:16 MST (1677795976): 'dateTime': '1677795976', 'inHumidity': '22.568543063381135', 'inTemp': '17.212429480347783', 'rainRate': '0', 'txBatteryStatus': '0', 'usUnits': '17', 'windDir': '265.8379446640316', 'windSpeed': '0.0'
When I run debug=0, I get at weewx restart
Mar 2 15:31:13 pi34 weewx[7610] INFO user.MQTTSubscribe: (Service) Version is 2.2.2
Mar 2 15:31:13 pi34 weewx[7610] INFO user.MQTTSubscribe: (Service) Log level: 0
Mar 2 15:31:13 pi34 weewx[7610] INFO user.MQTTSubscribe: (Service) Log debug setting: 0
Mar 2 15:31:13 pi34 weewx[7610] INFO user.MQTTSubscribe: (Service) Log console: False
Mar 2 15:31:13 pi34 weewx[7610] INFO user.MQTTSubscribe: (Service) Log file: None
Mar 2 15:31:13 pi34 weewx[7610] INFO user.MQTTSubscribe: (Service) 'use_topic_as_fieldname' option is no longer needed and can be removed.
Mar 2 15:31:13 pi34 weewx[7610] INFO user.MQTTSubscribe: (Service) message_callback_provider_name is user.MQTTSubscribe.MessageCallbackProvider
Mar 2 15:31:13 pi34 weewx[7610] INFO user.MQTTSubscribe: (Service) clientid is MQTTSubscribe-5972
Mar 2 15:31:13 pi34 weewx[7610] INFO user.MQTTSubscribe: (Service) client_session is True
Mar 2 15:31:13 pi34 weewx[7610] INFO user.MQTTSubscribe: (Service) host is 192.168.1.166
Mar 2 15:31:13 pi34 weewx[7610] INFO user.MQTTSubscribe: (Service) port is 1883
Mar 2 15:31:13 pi34 weewx[7610] INFO user.MQTTSubscribe: (Service) keepalive is 120
Mar 2 15:31:13 pi34 weewx[7610] INFO user.MQTTSubscribe: (Service) username is ODT
Mar 2 15:31:13 pi34 weewx[7610] INFO user.MQTTSubscribe: (Service) min_delay is 1
Mar 2 15:31:13 pi34 weewx[7610] INFO user.MQTTSubscribe: (Service) max_delay is 120
Mar 2 15:31:13 pi34 weewx[7610] INFO user.MQTTSubscribe: (Service) password is set
Mar 2 15:31:13 pi34 weewx[7610] INFO user.MQTTSubscribe: (Service) Archive topic is None
Mar 2 15:31:13 pi34 weewx[7610] INFO user.MQTTSubscribe: (Service) binding is loop
Mar 2 15:31:13 pi34 weewx[7610] INFO user.MQTTSubscribe: (Service) Waiting for MQTT connection.
Mar 2 15:31:13 pi34 weewx[7610] INFO user.MQTTSubscribe: (Service) Connected with result code 0
Mar 2 15:31:13 pi34 weewx[7610] INFO user.MQTTSubscribe: (Service) Connected flags {'session present': 0}
Mar 2 15:31:13 pi34 weewx[7610] INFO user.MQTTSubscribe: (Service) Subscribing to topic/rtd_temperature has a mid 1 and rc 0
Mar 2 15:31:13 pi34 weewx[7610] INFO user.MQTTSubscribe: (Service) Subscribing to topic/tmp117_temperature has a mid 2 and rc 0
Mar 2 15:31:13 pi34 weewx[7610] INFO user.MQTTSubscribe: (Service) Subscribed to mid: 1 is size 1 has a QOS of 0
Mar 2 15:31:13 pi34 weewx[7610] INFO user.MQTTSubscribe: (Service) Subscribed to mid: 2 is size 1 has a QOS of 0
Mar 2 15:31:14 pi34 weewx[7610] INFO user.MQTTSubscribe: (Service) MQTT initialization complete.
My setup is a ESP32 reading a RTD100 and a TMP117 temperature, sending the data every 15 seconds via MQTT to the Pi 3 B+ running Bullseye and WeeWX version 4.10.2.
WeeWX is running lheijst’s github weewx-rtldavis software to read the Davis Vantage Pro2 ISS and wjcarpenter’s gitlab bme280wx.git as a service to read the BME280 for indoor temp and barometer.
mosquitto broker version 2.0.11 at the Pi. mosquitto is an MQTT v5.0/v3.1.1/v3.1 broker.
When I run
mosquitto_sub -h 192.168.1.166 -t + -v -u ??? -P ???? | xargs -d$'\n' -L1 bash -c 'date "+%Y-%m-%d %T.%3N $0"'
the ? are to not give out my user and password info and the pipe to xargs is to add date and time
I get the data sent from the ESP32
2023-03-02 13:04:20.439 rtd_temperature 20.29
2023-03-02 13:04:20.455 tmp117_temperature 18.09
current.inc, hilo.inc, statistics.inc and index.html.tmpl . Note that what might look like a comment with the # in front of it (such as #if $day.extraTemp3.has_data ) is a conditional or preprocessor statement so those have to be changed. There is probably a way to do that in weewx.conf but I took the simple way out.