-
Notifications
You must be signed in to change notification settings - Fork 13
Installing and updating version 3.x with WeeWX 4.x
Note:, without workarounds WeeWX 4.x does not support python 3.12 and higher. See this discussion for additional information.
Note:, in 4.6.1 WeeWX fixed 737. This resulted in different test results and therefore technically MQTTSubscribe only supports WeeWX 4.6.1+.
- Python 3.7 or higher
- Paho MQTT Python client
Because there are multiple methods to install WeeWX V5, location of files can vary. See for the definitive information. The following symbolic names are used to define the various locations:
- $BIN_ROOT - Executables
- $USER_ROOT - User directory
- $CONFIG_FILE - The WeeWX configuration file (This is not typically in the WEEWX documentation)
The notation vX.Y.Z designates the version of MQTTSubscribe being installed.
Prior to making any updates/changes, always make a backup.
If running as a driver,
RUN_MODE=driver
If running as a service,
RUN_MODE=service
BIN_ROOT=/usr/share/weewx
USER_ROOT=/usr/share/weewx/user
CONFIG_FILE=/etc/weewx/weewx.conf
DOWNLOAD_DIR=/tmp
BIN_ROOT=/home/weewx/bin
USER_ROOT=/home/weewx/bin/user
CONFIG_FILE=/home/weewx/weewx.conf
DOWNLOAD_DIR=/tmp
$BIN_ROOT/wee_extension --install=$DOWNLOAD_DIR/vX.Y.Z.tar.gz
Note: For package installs, the above command needs to be prefixed with sudo
(sudo $BIN_ROOT/wee_extension ...)
PYTHONPATH=$BIN_ROOT python3 $USER_ROOT/MQTTSubscribe.py configure --create-example mqttsubscribe.template.conf
Note, MQTTSubscribeDriver can also be configured and weewx.conf updated interactively via weectl station. This method has the following disadvantages:
- The options that can be configured are limited.
- The configuration options can not be validated and tested before restarting WeeWX.
-
Edit the
mqttsubscribe.template.conf
fileFor example,
nano mqttsubscribe.template.conf
-
Validate and test the
mqttsubscribe.template.conf
filePYTHONPATH=$BIN_ROOT python3 $USER_ROOT/MQTTSubscribe.py configure $RUN_MODE --validate --conf mqttsubscribe.template.conf
PYTHONPATH=$BIN_ROOT python3 $USER_ROOT/MQTTSubscribe.py simulate $RUN_MODE --conf mqttsubscribe.template.conf
Additional information on running MQTTSubscribe in configuration mode can be found at this wiki page.
Additional information on running MQTTSubscribe in simulation mode can be found at this wiki page.
$BIN_ROOT/wee_config --reconfigure --driver=user.MQTTSubscribe --no-prompt
Note: For package installs, the above command needs to be prefixed with sudo
(sudo $BIN_ROOT/wee_config ...)
PYTHONPATH=$BIN_ROOT python3 $USER_ROOT/MQTTSubscribe.py configure $RUN_MODE --replace-with mqttsubscribe.template.conf --conf $CONFIG_FILE
Note: For package installs, the above command needs to be prefixed with sudo
(sudo PYTHONPATH=$BIN_ROOT python3 ...)
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