Description

This is a ‘plugin’ for WeeWX-MQTTPublish. It uses undocumented, and therefore, unsupported interfaces of weewx-loopdata to create the loop-data. Then instead of writing the loop-data to a file, it adds it the configured topic. Then MQTTPublish publishes the data to the topic.

In addition to adding MQTT capability to weewx-loopdata, support for partial packets is added. This is accomplished by ‘caching’ loop packet data and ‘filling in’ any fields that are missing in the current loop packet with the prior value.

Preqrequisites

Prerequisite Version
WeeWX 5.0.0 or higher
Python 3.9.13 or higher
weewx-loopdata 7.0 or higher

Note: Early versions of Python 3 may work, but have not been explicitly 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/plugin-loopdata/archive/refs/tags/latest.zip

If a specific version is desired, the invocation would look like

weectl extension install https://github.com/weewx-mqtt/pligin-loopdata/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/plugin-loopdata/releases.

The version under development can be installed from the master branch using the following invocation

weectl extension install https://github.com/weewx-mqtt/plugin-loopdata/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 MQTTPluginLoopData 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

MQTTLoopData is installed with it disabled. Setting flag, enable = true and restarting WeeWX will start publishing loop-data to the configured topic.

The installation process will create a [MQTTLoopData] section in the weewx configuration file. It should be straightforward to modify this ‘template’. The [topic to publish to usually needs to be configured.

The fields to be published needs to be configured (ToDo: - fill in)

The plugin value in MQTTPublish needs to be updated (ToDo: - fill in)

Reference weewx-loopdata repo (ToDo: - fill in)

Additional information on configuration MQTTLoopData can be found in help documentation.

Updating

Credits

weewx-loopdata - does the heavy lifting


Getting Help

For additional information see the help.

Feel free to open an issue or start a discussion in github. When doing so, see Help! Posting to weewx user for information on capturing the log.

Since this plugin uses internal, unsupported, interfaces of weewx-loopdata; please do not post to the WeeWX google group until we determined that is not a problem with MQTTLoopData.