-
Notifications
You must be signed in to change notification settings - Fork 13
Common Options
There are three major pieces to the MQTTSubscribe configuration.
This configures the MQTT connection and any necessary WeeWX options.
Set to false
to disable the service. This is only used by the service. The default is true
.
The MQTT server. The default is localhost
.
Maximum period in seconds allowed between communications with the broker. The default is 60
.
Coming soon. The maximum time in seconds that the client will wait before trying to reconnect. The default is 120.
Coming soon. The minimum time in seconds that the client will wait before trying to reconnect. The default is 1.
password for broker authentication. The default is None
.
The port to connect to. The default is 1883
.
Controls if validation errors raise an exception (stopping WeeWX from starting) or only logged.
Default is false
.
username for broker authentication. The default is None
.
This has the the MQTT topics that are to be subscribed to along with options used to control processing of the messages. Most of the options control if the message should be ignored due to its timestamp. See the Date Time Processing page for a detailed explanation of these.
Set to true
if the field should be ignored. The default is false
.
used to set the unit system. The default is US
.
This contains the information necessary to parse the MQTT message into a WeeWX name/value dictionary. Out of the box MQTTSubscribe supports JSON formatted messages, name=value format, or a topic for each individual data element.
Only used when type is json
. When the json is nested, the delimiter between the hierarchies. The default is _
.
Only used when type is keyword
. The delimiter between fieldname and value pairs. (field1=value1, field2=value2). The default is =
.
Only used when type is keyword
. The separator between fieldname and value pairs. (field1=value1, field2=value2). The default is ,
.
Selects the parser to use. valid values are, json
, keyword
, or individual
.
Each topic to subscribe to has its own section that is the name of the topic to subscribe to.
Set to true
if the field should be ignored. The default is false
.
Overrides the [[topics]] [[[message]]]
settings for this specific topic.
Under each [[[topic-name]]]
any fields that need configuring are designated via a [[[[field-name]]]]
section.
This information maybe in a sensor-map
, label-map
, etc. in other drivers or services.
Some common configuration options for a field are:
Set to true
if the incoming data is cumulative value (for example, rain total) and the WeeWX field expects an increment value.. The default is false
.
The conversion type (bool, float, or int) necessary for WeeWX compatibility. The default is float
.
Set to true
if the field should be ignored. The default is false
.
The WeeWX name.
To be used in conjunction with contains_total
.
Set to true
if the incoming cumulative value can wrap around (yearly rain for example). The default is false
.
- Information on configuring the less common options can be found here.
- Complete examples for json, keyword, and individual payloads.
- An in depth explaination of date/time 'filtering' is here.
Getting Help
Feel free to open an issue, start a discussion in github, or post on WeeWX google group. When doing so, see Help! Posting to weewx user for information on capturing the log.
Getting Started
Prerequisites
Required MQTT information
Required WeeWX information
Installing MQTTSubscribe
Configuring MQTTSubscribe
Running MQTTSubscribe with WeeWX
Debugging
Common Options
Main section
The [[topics]]
section
The [[[message]]]
section
The [[[topic-name]]]
section
The [[[[field-name]]]]
section
Additional Options
Main section
The [[tls]]
section
The [[topics]]
section
The [[[topic-name]]]
section
The [[[[field-name]]]]
section
Example individual Configuration
Example Configuration with multiple types