Inverter control ahoyDTU

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);

flow.set("limit", limit);

msg.payload = limit;

return msg;

However, the value is increased continuously up to 1500.

Hi @dima2241
& welcome to this forum.

With the data you provided, people trying to support you have to guess a lot. It's always better to post the json of the flow - rather than just a sniplet of code.

What I think I see: There's no functionality (in the data given) that reduces numbers; either you missed that when pasting the code here - or you don't have it implemented.

Additional tip:
You should format your code as "Preformatted text" by the </> button in the toolbar...
That makes it easier readable...

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.