Tasmota Energy Monitoring with NodeRED, Influx and Grafana
Tasmota-Energy-Monitor
Energy monitor using NodeRED, InfluxDB and Grafana
This project is using power monitoring devices like Gosund SP111, SONOFF POW to measure the energy consumption. Data is collected by NodeRED and pushed to a Influx database. Finally Grafana is used to provide a dashboard.
Supporting files are availabe on github:
https://github.com/ThomasH-W/Tasmota-Energy-Monitor
Grafana Monitoring
NodeRED
The flow is kept very generic. You do not need to manually create flows for each devices. Instead of using discovery, NodRED is listening to all SENSOR messages and creating automatically a list of devices.
The fields pushed to the influx database are
- device: myDevice,
- event: ‘tele’,
- power: msg.payload.ENERGY.Power,
- today: msg.payload.ENERGY.Today,
- yesterday: msg.payload.ENERGY.Yesterday,
- total: msg.payload.ENERGY.Total
At the end of each day at 11.58 p.m. the value of today is pushed to another measurement in influx.
Tsamota Devices
Hardware
Any Tasmota device with power measurement will work: NOUS A1T, Gosund SP111, BlitzWolf SHP2 (old version with ESP), SONOFF POW
Configuration
When I started with home automation I thought it is a bright idea to seperate MQTT messages by building. Accordingly I changed the full topic to “house/%prefix%/%topic/”.
Probably I would not do it anymore.
Hallo Thomas, das ist eine super Lösung für mehrere Geräte! Wie sind die Tasmota Einstellungen in den Switches?
Danke Carsten
Hallo Carsten,
die Einstellungen habe ich oben ergänzt.
Viele Grüße, Thomas
Hi Thomas,
super beschrieben, einzig aber wie man den Split der Daten könntest du noch etwas mehr beschreiben. Ich verstehe nicht wie du die Json Datei konvertierst und splittest.
Danke für deine Mühen,
Tobias
Hallo Thomas,
irgend etwas stimmt da nicht. Die Ausgabe der “create tele msg” sieht bei mir so aus:
6.9.2023, 07:34:10node: debug 3
tele/licht/SENSOR : msg.payload : Object
object
device: “SENSOR”
power: 64
today: 0.475
yesterday: 1.522
total: 112.402
Bei all meinen Geräten steht unter device: “SENSOR”
Somit sind die daten nicht unterscheidbar. oder?
Gruß Tobi
Hallo Tobi,
mein topic benutzt house/tele/, bei dir (wahrscheinlich auch bei den meisten) steht tele/ .
Also ist bei dir der device name das dritte element im topic bzw. hat den index 2 im array.
Entsprechend muss in den Funktionen “create tele msg” der index für das array auf 1 geändert werden.
alt: var myDevice = array[2]; // 3. Element holen
neu: var myDevice = array[1]; // 2. Element holen
Gruß,
Thomas