Ankündigung

Einklappen
Keine Ankündigung bisher.

Node Red Fragen

Einklappen
X
 
  • Filter
  • Zeit
  • Anzeigen
Alles löschen
neue Beiträge

    Zitat von PhilW Beitrag anzeigen
    maybe you can help me with one piece of code right now.
    To calculate the feed (values) from/to the Grip I need always suptract it from my load which in one case or another always gives a minus number. What is the json code for not giving negative numbers or no numbers <0 as payload?

    e.g. this is the feed to the grid. I don't need a value output if it's negative


    I'm near a bloody beginner
    No problem. Here two options. Select wich you prefer. Paste the code in a function node.

    Code:
    // This will output an always positive value. If negative, outputs zero.
    var nRet=(msg.payload.siteCurrentPowerFlow.PV.currentPower-msg.payload.siteCurrentPowerFlow.LOAD.currentPower)*1000;
    if(nRet<0) nRet=0;
    msg.payload=nRet;
    return msg;
    Code:
    // This will output an always positive value. If negative, it doesn't send anything.
    var nRet=(msg.payload.siteCurrentPowerFlow.PV.currentPower-msg.payload.siteCurrentPowerFlow.LOAD.currentPower)*1000;
    if(nRet<0) return null;
    msg.payload=nRet;
    return msg;

    Kommentar


      Perfect thx...
      Google oder Wiki-Hilfe-Hinweise nehme ich nur an wenn sie mich total blamieren..... dann ertrage ich sie auch in Demut und Dankbarkeit;-)

      Kommentar


        TheMax74

        Good evening Massimo,

        just to give a feedback, with the MDT IP Router everything works fine thru Multicast without any waitstate or delay nodes or any "write" messages.
        If I switch to the direct IP Adress of the Router the communication and the values will be sent and displayed into the knx-bus, but on every Ultimate Node "write" is displayed.

        So for me everything works fine with the multicast. My problem is solved.
        THX
        Guido
        Google oder Wiki-Hilfe-Hinweise nehme ich nur an wenn sie mich total blamieren..... dann ertrage ich sie auch in Demut und Dankbarkeit;-)

        Kommentar


          Thanks for the feedback Guido. Routing multicast is the way to go. I’ve intensively tested the node with a “pure” ip interface and it works as well.
          Not all routers does also interfacing, so setting in the node the ip of the router to use it as interface, not always works.

          Kommentar

          Lädt...
          X