Please @Steve85737, post here, as a closure, which are the commands for reading and writing.
Also, don’t forget the fact that the relay mode should be set to External Control (Manual mode) and that register can also be written on the same way. It’s either the 0x034F or 0xEDD9.
PS. You said that you couldn’t read the relay state. Which is the command?
Also, in your suggestion, you are talking about Cerbo and he has a Pi.
He doesn’t have the luxury of Cerbo’s relays…
He only has the MPPT’s relay and the Phoenix’s relay.
In the end he asked for a way to control the MPPT relay and the target was hit…
It’s odd. I can now read the relay state after setting it.
I used:
to read the relay state:
vregd -c /dev/ttyUSB0 -g 0x034e
to set the relay state:
vregd -c /dev/ttyUSB0 -s 0x034e un8:0 [to open it]
vregd -c /dev/ttyUSB0 -s 0x034e un8:1 [to close it]
This was after setting the relay mode via Victron Connect app to Manual
I’ve just ordered a relay board for the RPi so I should be able to control those when it arrives. I believe they should just appear as relay devices in node-red if I get the config correct.
I wonder if there’s a timeout - I tried to read it again (using bash history to repeat command) and it gave the No Response Received error again. I wrote the value again and was then able to read it once more.
Does anyone know how to use the exec node in node-red to execute the vregd command?
I could be wrong, as I didn’t used Node Red, but maybe this could help?
It seems that you need to use an exec node and paste the command in the Command field ?
It turns out that the Phoenix 3000 has no AC out 2. The Multiplus-II 3000 has AC out 2. So that option is out of the window.
I only mentioned the Cerbo to show that Venus is doable. But that requires an Arduino which has ports which can be controlled by Venus/Node Red as noted.
I still don’t understand how the OP is going to use the DC charger to run an AC heater.
And please @Steve85737, another thing.
Could you please change the title of the topic in order to reflect the real thing now?
It isn’t anymore about connecting Arduino to Venus, but could be something like: “How to switch the relay on a Smart Solar MPPT via Node-Red”.
Many thanks!
If you have ordered a relay board which can be controlled by Venus, reading registries might not be necessary. You have 2 options as shown on the node red graphic:
Switch the Venus relay on or off depending on the battery SOC. The Venus relay in turn switches on and off your industrial relay connected to your inverter. DC to AC. Note that the Venus relay might be able to handle very limited voltage and current. Not to worry as your industrial relay can hopefully handle your heater. In that case, pass your battery voltage/current through the Venus relay to switch your industrial relay. You need at least 3 nodes. I can’t share mine because there is a lot going on.
You could take the @alexpescaru route and use the execute node to control your MPPT.
Examples below:
Thanks everyone for the valuable help. I wouldn’t have known where to start without all your contributions. Node-Red is great - it’s the first time I’ve ever used it. Being able to execute arbitrary bash scripts is really powerful too. Now I can get the tricky functionality working easily in Node-Red by setting up some threshold conditions for switching the relay.
Just to clarify, I’m going to use the relay to switch 230V AC at 4A to the water heater. Looking at the relay specs in the MPPT charge controller, it may be too much for the built-in relay so I’ll either add a more powerful 10A relay downstream, or try a relay board with the RPi instead. The Node-Red code will switch the relay when the battery voltage is high enough and the power fed to the batter is also high enough. That should give me enough power to run the 1kW heater when the sun is shining and the battery is nearly full.
I also tried using exec node. Using command ‘vreg’ and extra input parameters: ‘-c socketcan:can0 -s 0xEDAB un8:1 -n 0x280’ but without success.
Did anybody got it every working to remotely set the relay of a SmartSolar MPPT 75/10, 75/15, 100/15 or 100/20.
I can set it via the VictronConnect APP with bluetooth, so why not via remote commands?
Is your SS MPPT connected to Cerbo via VE.Direct or VE.CAN ?
If it’s CAN, are you sure the CAN address of SS MPPT is 0x280? Usually is an 8bit value.
To be sure, again, if it’s a CAN device, go in Cerbo at:
Settings → Services → VE.Can port → Devices → Select your MPPT → Network address
and read the value from there.
It’s a decimal value, so in vreg command, at -n parameter, you’ll just use that value, without 0x prefix.