Hello everyone, I have been trying to create a control system with node red for a few days, which is also my first experience with it.
I would like to use ahoyDTU (communicates with an inverter via mqtt) to create a control that should calculate the following:
- If power consumption > 0 then the inverter should take the value of the power consumption and add 10 to it.
- If feed-in > 0, the inverter should reduce the value of the feed-in until it is 10.
Would someone please help me and point me in the right direction?
var calcLimit = flow.get("limit") + Number(msg.verbrauch) + 10;
var limit = Math.min(calcLimit, 1500);
msg.payload = limit;
However, the value is increased continuously up to 1500.