SNMP and MQTT Power Logger & Visualizer
Logs Tasmota-flashed power usage monitors, and TP-Link Omada/Mikrotik POE switches, to InfluxDB and Grafana using MQTT, SNMP and prometheus. Also logs Zigbee informtion with a Tasmota-flashed Zigbee bridge.
Looking for the Mikrotik POE usage monitor/exporter? That's in mikrotik.py

Setup
cp power.env.example power.env- Edit
power.envas appropriate touch .passwordssudo docker-compose up -d --buildsudo docker exec -it poweredagay_mqtt_1 shThen in the container:chmod 0700 /mosquitto/passwd_filechmod root:root /mosquitto/passwd_filemosquitto_passwd -c /mosquitto/passwd_file user_nameChanginguser_nameas appropriate, then it will prompt for a password
sudo docker-compose restart- Test with the
mosquitto_subandmosquitto_pubcommands, the name of the package on debian ismosquitto-clients - Change the config in the Tasmota MQTT web UI, then check the logs to make sure it connects nicely
- I like to run
TelePeriod 30in the Tasmota console to set it to send MQTT messages every 30 seconds, for example. The default is every 5 minutes I believe
Switch setup
You must enable SNMP in the Omada controller with the community string tplink:

Moreover mikrotik switches must be set up with an appropriate SSH key pair so they can be polled through SSH
MQTT setup
We are using a Tasmota-flashed zigbee coordinator to transmit zigbee messages to our MQTT castor, and Tasmota-flashed plugs for logging power from the wall over MQTT. Both must be configured with an appropriate friendlyname and told access the MQTT castor.

