Zitat von PhilW
Beitrag anzeigen
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