question

ryanh avatar image
ryanh asked

Controlling Cerbox GX relay using multiple metrics

I recently finally arrived with the shortest way I could come up with to control a relay using the PV charge state (float) to enable it, and the SoC of the battery (90%) to disable it. The relay is connected to a grid-tie inverter (licensed) via a Victron Battery Protect to divert PV power when the battery is full.

I am just curious is there is a shorter/better way to do this, or if anyone sees any potential issues. It is currently working exactly as I wanted it to work. Here is the flow:

[{"id":"c5b0169dbcad227c","type":"tab","label":"Flow 1","disabled":false,"info":"","env":[]},{"id":"423486a2926d95d8","type":"victron-output-relay","z":"c5b0169dbcad227c","service":"com.victronenergy.system/0","path":"/Relay/0/State","serviceObj":{"service":"com.victronenergy.system/0","name":"Venus device"},"pathObj":{"path":"/Relay/0/State","type":"enum","name":"Venus relay 1 state","enum":{"0":"Open","1":"Closed"},"writable":true},"initial":"","name":"Relay 1","onlyChanges":false,"x":800,"y":160,"wires":[]},{"id":"91dbd7f4f70239a8","type":"victron-input-battery","z":"c5b0169dbcad227c","service":"com.victronenergy.battery/279","path":"/Soc","serviceObj":{"service":"com.victronenergy.battery/279","name":"100Ah 24v LiFePO4"},"pathObj":{"path":"/Soc","type":"float","name":"State of charge (%)"},"name":"SoC","onlyChanges":false,"roundValues":"no","x":130,"y":160,"wires":[["e5905157baf49199"]]},{"id":"0fda9a92c7dbacc8","type":"victron-input-solarcharger","z":"c5b0169dbcad227c","service":"com.victronenergy.solarcharger/278","path":"/State","serviceObj":{"service":"com.victronenergy.solarcharger/278","name":"SmartSolar Charger MPPT 150/35"},"pathObj":{"path":"/State","type":"enum","name":"Charge state","enum":{"0":"Off","2":"Fault","3":"Bulk","4":"Absorption","5":"Float","6":"Storage","7":"Equalize","245":"Off","247":"Equalize","252":"External Control"}},"initial":"","name":"Charge state","onlyChanges":false,"x":110,"y":220,"wires":[["85a78a15d61796d9"]]},{"id":"e5905157baf49199","type":"change","z":"c5b0169dbcad227c","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"soc","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":320,"y":160,"wires":[["251cffb8d9bf3f09"]]},{"id":"85a78a15d61796d9","type":"change","z":"c5b0169dbcad227c","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"state","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":320,"y":220,"wires":[["251cffb8d9bf3f09"]]},{"id":"251cffb8d9bf3f09","type":"function","z":"c5b0169dbcad227c","name":"On @ bulk / Off @ 90% ","func":"if (msg.topic == \"state\" && msg.payload>=5)\n{\n msg.payload = 1\n return msg;\n}\nelse if (msg.topic == \"soc\" && msg.payload<=98)\n{\n msg.payload = 0\n return msg;\n}\n","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":570,"y":180,"wires":[["279da8c01d0ec596","423486a2926d95d8"]]},{"id":"279da8c01d0ec596","type":"debug","z":"c5b0169dbcad227c","name":"Relay state","active":true,"tosidebar":true,"console":true,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":810,"y":220,"wires":[]}]


cerbo gxNode-REDRelay
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

0 Answers