Description
A Weewx service publishes data to multiple MQTT topics.
Currently MQTT payloads of json, keyword (field1=value, field2=value..), and individual (each topic contains a single observation) are supported.
Preqrequisites
| Prerequisite | Version |
|---|---|
| WeeWX | 5.0.0 or higher |
| Python | 3.9.13 or higher |
| Paho MQTT Python client | 1.6.1 or higher |
| MQTT | 3.1, 3.1.1, 5 or higher. |
Note: Early versions of Python 3 may work, but have not been explicitly tested.
Note: Not all ‘supported’ versions of the Paho MQTT client have been tested.
Note: Not all ‘supported’ versions of MQTT have been tested.
Installing
This extension is installed using the weectl extension utility. The latest release can be installed with the invocation
weectl extension install https://github.com/weewx-mqtt/publish/archive/refs/tags/latest.zip
If a specific version is desired, the invocation would look like
weectl extension install https://github.com/weewx-mqtt/publish/archive/refs/tags/vX.Y.Z.zip
where X.Y.Z is the release. The list of releases can be found at https://github.com/weewx-mqtt/publish/releases.
The version under development can be installed from the master branch using the following invocation
weectl extension install https://github.com/weewx-mqtt/publish/archive/master.zip
Where master is the branch name.
Note: WeeWX ‘package’ installs add the user that performed the install to the weewx group. This means that this user should not need to use sudo to install the weewx-mqtt/publish extension. But in order to for this update to the weewx group to take affect, the user has to have logged out/in at least once or use one of the other methods that can be found on the web
Note: WeeWX pip installs that install WeeWX into a Python virtual environment, must ‘activate’ the environment performing the install. A typical invocation would look like this.
source ~/weewx-venv/bin/activate
Configuring
weewx-mqtt/publish is installed with it disabled. Setting flag, enable = true and restarting WeeWX will start publishing MQTT data to the configured broker and topics. The processing can be controlled by updating the configuration in the WeeWX configuration file. The host and topic(s) to publish to usually need to be configured.
Updating
Getting Help
For additional information see the help.
Feel free to open an issue, start a discussion in github, post on WeeWX google group. When doing so, see Help! Posting to weewx user for information on capturing the log.