MQTT Integration
Overview
- Publishes meter readings to MQTT broker for backend processing
- Topics:
energy/{device_id}/raw, energy/{device_id}/power, energy/{device_id}/voltage, energy/all/readings
Example Payload
{
"device_id": "M004_NSW_2095_Manly",
"timestamp": "2025-11-18T12:30:45",
"meter_reading": {
"IMPORT": 51.31,
"EXPORT": 157.91,
"VOLTAGE": 240.1,
"AMPS": 10.89,
"PF": 0.91,
"FREQUENCY": 49.27,
"POWER": 2.61
},
"metadata": {"source": "web3-docker", "version": "1.0"}
}
Configuration
- All settings in
.env or environment variables
- Supports SSL/TLS, authentication, and WebSocket transport
Testing
- Run
python scripts/test_mqtt.py to test configuration and publishing