Python utilities for MQTT: publish/subscribe wrappers, retained message readers, Tasmota discovery
871
amd64, arm64MQTTStuff is a lightweight Python toolkit providing high-level utilities for working with MQTT brokers via Paho. It simplifies common MQTT patterns like connecting, subscribing, publishing, and reading retained messages, with special support for Tasmota device management.
Key Features:
paho-mqtt for quick connection and topic managementdocker run -it --rm \
-e MQTTSTUFF_MQTT_HOST=your-broker \
-e MQTTSTUFF_MQTT_PORT=1883 \
-e MQTTSTUFF_MQTT_USERNAME=user \
-e MQTTSTUFF_MQTT_PASSWORD=pass \
xomoxcc/mqttstuff:latest bash
docker run --rm \
xomoxcc/mqttstuff:latest \
python -c "from mqttstuff.mosquittomqttwrapper import MQTTLastDataReader; \
print(MQTTLastDataReader.get_most_recent_data_with_timeout(\
'broker', 1883, 'user', 'pass', ['tele/+/STATE'], retained='only'))"
Mount your config.yaml to configure the MQTT connection:
docker run -it --rm \
-v $(pwd)/config.yaml:/app/config.yaml:ro \
-e MQTTSTUFF_CONFIG_PATH=/app/config.yaml \
xomoxcc/mqttstuff:latest python your_script.py
docker run --rm \
-v $(pwd)/my_script.py:/app/my_script.py:ro \
-e MQTTSTUFF_MQTT_HOST=broker \
xomoxcc/mqttstuff:latest python /app/my_script.py
Configure the container via environment variables:
MQTTSTUFF_MQTT_HOST - MQTT broker hostnameMQTTSTUFF_MQTT_PORT - MQTT broker port (default: 1883)MQTTSTUFF_MQTT_USERNAME - MQTT usernameMQTTSTUFF_MQTT_PASSWORD - MQTT passwordLOGURU_LEVEL - Logging level (DEBUG, INFO, WARNING, ERROR)MQTTSTUFF_CONFIG_PATH - Path to config YAML fileMQTTSTUFF_CONFIG_DIR_PATH - Config directory pathQuickly test MQTT connections and inspect message payloads without installing dependencies locally.
Discover, monitor, and control Tasmota smart home devices via MQTT topics in bulk.
Collect and process retained messages from multiple topics with automatic type conversion.
Build automation scripts that interact with MQTT-based IoT devices.
paho-mqtt, pydantic, loguru, pytz, PyYAMLhtop, vim, ping, tini (init system)/appxomoxcc/mqttstuff:latestThe latest stable build with Python 3.14 on Debian Trixie.
xomoxcc/mqttstuff:<version>Specific version tags for reproducible builds.
LGPL-3.0-or-later (see LICENSE.md)
This is a development/experimental project. For production use, review security settings, customize configurations, and test thoroughly in your environment. Provided "as is" without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. In no event shall the authors or copyright holders be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the software or the use or other dealings in the software. Use at your own risk.
Content type
Image
Digest
sha256:6d2e1ea8a…
Size
427 MB
Last updated
7 months ago
docker pull xomoxcc/mqttstuff:python-3.14-trixie