Setting relays depending on SOC

I have a Cerbo GX mk2 who recieve SOC from a smart shunt. What I want to do is to set relay 2 if SOC gets below 10% SOC and clear it if raising above 12%. Then I want to set relay 1 if SOC are above 90% and clear it if below 88%.

What is the easiest way to do this?

I’m completly new to mqtt, nodered, python etc. Is any of those needed and if so is there an guide to follow?

Node red would be the easiest way to do that, but Venus Large must be installed on the Cerbo.
Start with:Venus OS Large image: Signal K and Node-RED [Victron Energy]

3 Likes

Here you go this works perfectly. What you do is write the SOC to a variable and then check it with the functions I’ve written. This will do exactly what you want: when the SOC drops below 10% (so at 9%), it will send a 1. When it rises above 12% (for example, 13%), it will open and send a 0.

The same logic applies for the high-level trigger: it will send a 1 when the SOC goes above 90% (so at 91%), and it will reset at 87%.

This is a demo-mode RPi Venus OS install. Just connect your nodes to the SOC input and the relay you want to control. I write all my code on a Pi in demo mode so I don’t break my live system. Like Mike said, install Node-RED Large.

The flow code is in the text file, just copy it right right-click import, import it and update the nodes to suit your system. The demo only has 1 relay for some reason, and you will need to change one of them to relay 0.

Toggle the debug nodes when you are done with the setup and testing.

CHECK SOC LIMITS CONTROL RELAY.txt (19.2 KB)

1 Like

Thank you, this will help a lot! So when installing Venus OS large do I also need MQTT and TCPserver running as well as NodeRed?

And when connecting to the source from within NodeRed is it best to use a fixed IP-adress or ”venus.local”?

In gui V2 on the remote console go to settings integration and turn on node red after installing the large image.

The best way to get there is via VRM just click on venus OS large and you will see a tile for node red.

Ok, thats done. So I don’t need any of the other services running.

Thank you again.

No thats it. Once you find your device node and set the relay you can test if its working by injecting the 0 or 1 to turn it on and off.

1 Like

Will give it a try and let you all know the result.

Did that work? I imagine you are talking about Cerbo relays. Note that the inverter/charger also has some relays that can be controlled with Assistants without the need for Node Red or anything else. I don’t know if this applies to all models of inverters. Node Red is perhaps the simplest route.

Can´t get it working, need to sort the basics out first. I have imported it, get the flow visualized but think I dont have the proper setup to get hold of the data.

Hi, would a file like the attached work? can I run it safely to try it out?

Want to close relay 2 if SOC<60% and open it if SOC>60%

And yes, it´s the Cerbo GX relays I talk about.

flows.json.txt (4.8 KB)

The node for the Venus device is just a placeholder. You will need to double-click them to open the node, then select your device and the relay you want to control. You also need to choose the device for your SOC. I put a battery monitor in there and the MultiPlus.

After you update the nodes, hit the red button, deploy to make them active top right. There is also a debug window to open, press the little bug so you can see the console and get the data from the debug nodes.

Thank you, I might get there in time.

I just used this and was amazed at how easy it was.

Thank you.

1 Like