Hi,
Based on some ideas in this forum, I created this chart:
It basically shows a orange line for the zero line, a green line, when my PV system is delivering power to the grid (pos values or "Einspeisung") and a yellow line, if my PV system is pulling power from the grid (neg values or "Bezug").
For this I implemented this code and get values every minute (single value pos or neg).
var Power = new Object();
var ZeroLine = new Object();
Power.payload = msg.payload;
if (Power.payload < 0) {
Power.topic = "Bezug";
} else {
Power.topic = "Einspeisung";
}
ZeroLine.payload = 0;
ZeroLine.topic = "Zero";
return [Power, ZeroLine];
The chart node is configured as follows:
This works almost perfectly but sometimes the colors get mixed up between the lines and I do not understand why. Does anyone have an idea what the problem is?
Many thanks for your help
Heinz