Dashboard.jpgNodeRed.jpgA few days ago I built a dashboard in NodeRed. Now I have a problem that I need help with. I have four PV systems that produce electricity. I would like to see the current electricity production in watts for all four systems in one sum. My problem is that the four systems sometimes send their values with a time delay and this distorts the buzzers. How do I manage to add up the values of all four systems in NodeRed and display the total. The problem is the different receipt of messages from the PV systems. My current functions code looks like this:
var summe = 0;
// Iterieren Sie über alle Werte im Array und summieren Sie sie
for (var i = 0; i < msg.payload.length; i++) {
summe += parseFloat(msg.payload[i]);
}
// Aktualisieren Sie die Payload mit der Summe
msg.payload = summe;
// Senden Sie die Nachricht weiter
return msg;
Kann mir bitte jemand helfen?