AC load control - how would you do it?

Hi all, I am looking after a fairly large off grid system with two Quattros and a ColorControlGX.

I want to add the ability to switch on 3 AC loads when the battery SOC is approaching full. I see that the ColorControlGX has some capability for this, but it has only one relay which is already used for generator starting. Besides, my AC loads are remote, so it would be nice to use some kind of network solution.

I was thinking about, for example. Shelly 1 Wifi switches, looking at the GX data using modbusTCP. But I am quite new to the whole world of IoT.

i.e. if I can turn on the first load at battery SOC >= 95%, and off again at SOC < 94%. And so on for the other loads, so that there is some priority (the loads are thermostatic controlled water heaters, so when one is satisfied the SOC will continue to increase even when its relay is on).

But I am looking for suggestions of the ā€œeasyā€ way to do this without setting up lots of infrastructure, and without spending a ton of time at the site learning how to set it up as I go. What devices or protocols would you use for this?

After some more reading, it seems a good way would be to use node-red to act on the SOC value, and control the relay by MQTT or similar - Node-red can interface with just about anything it seems.

But, node-red can’t run on the CCGX :frowning: So I have got an old Rpi 2 and installed node-red, and added @victronenergy/node-red-contrib-victron to the palette.

But that’s not going to work is it? This is not Victron hardware. Can it access the data anyway over Modbus TCP?

I would use some small single board computers(SBC) to ā€˜manage’ the local relays, and use modbus over TCP/IP to access the SOC register in the GX modbus table. Each of the SBC devices can manage several relays, giving very flexible control. Python is easy, and has good modbus support.

Thanks Mike.

Continuing down the node-red rabbit hole for a minute, it looks like I should probably be using this module instead, which should access Victron registers over modbus: node-red-contrib-victron-modbus (node) - Node-RED

I hope that is going to read the register I need from some part of the Victron system, I see Dc/Battery/Soc in the dropdown.

I have ordered a Shelly device to try this out, not sure the best method to talk to that yet, but hopefully it is straightforward.

I try to keep this simple as possible - having multiple SBCs spread around, each with custom code is going to be a nightmare to remember how it all works. At least with the logic in one place, and in a visual form, I should be able to keep track of it in future. In theory!?

Could do… I don’t normally use Node Red.
As for keeping it in one place, installing the relays and SBC next to the main switchboard where all of the heaters come together could be possible. One SBC could then easily drive 3 or more relays. Both Beaglebones and R-pi’s can be remotely accessed for code tuning, so I would not see that as an issue.

1 Like

Yes, if all could be done from a single Pi at the consumer unit, that would be OK. But unfortunately the 3 water tanks are in separate buildings. The biggest issue that the Shelly would solve is, no need for mains sockets to run USB wall-warts for raspberry Pis at the remote locations.

I take your point about remote admin though, I will try to set that up for the one node-red Pi if it works out.

I use Real VNC for remote to R-pi, mine locarted 60m away in workshed.
problem with Shelly BLE is the 30m range (?) limitation. If you are ok with that, fine.

I have used Real-VNC in the past. In this case it would need to be administrated over the internet (via Starlink), which I think means using a paid account of Real-VNC. I’ve never succeeded to do remote access satisfactorily with Linux, so it’s another thing to research. The Pi 2 I have set up for this does not have the desktop anyway, so open to suggestions for remote ssh tunnel access that can dial out :slight_smile:

The shelly I am looking at is wifi connected (the wifi is repeated across the whole site) and the node-red library for it seems to use straightforward HTTP requests - node-red-contrib-shelly (node) - Node-RED

Though I know it can do MQTT I hope to avoid that as it’s a whole other layer of stuff that doesn’t seem super necessary.

If you have site wide wifi, then you are on a local network, and can use the free license VNC.

Well, I’m not on the local network - as I said, it would be over the internet via starlink. If I’m on the local network I could just ssh in or use the node-red web pages anyway.

That raises a question - if I upgraded this thing to Cerbo GX instead of CCGX, can its node-red dashboard be accessed remotely as VRM can? If I’m spending money and effort to set this up, swapping out the controller might actually be easier.

Hi Etec,
Everything on your side of the modem - is YOUR local area network be it wired or wifi, Everything on the outside is the WAN.
Within your local network, you can set up everything pretty much as you want it. so whether you use starlink, an LTE modem or a router into a fiber network, what happens on your side is under your control.
If you want to access a device on your local network from the WAN (wide area network) i.e. over the internet, you would need to set up some form of secure VPN access - to which there are several solutions. I think that the CERBO’s node red dash can only be accessed from your local network, so you may need a small computer locally to connect to then that could access the Cerbo. I have not done anything like that yet.

Yes I’m aware.
I have actually done what I would need to years ago, using the tunnel capability of SSH. It required the remote computer to periodically check a website where I would upload a text file containing my (dynamic) IP address and then connect to it, and then I could do a reverse tunnel to connect to the machine’s http served admin pages and console.

But it was a lot of time an effort to set up, and I’d have to figure it out again from scratch as I don’t have a reference of what I did exactly.
If there are ready-made, easy, cheap or free solutions in existence now I would like suggestions!

Ok, sorry if you already \knew the LAN/WAN difference.
I don’t think there are really any ā€˜free’ solutions for what you want.
One way I can do this is to use a VPN like anydesk or team viewer to a local pc that is on the same network as the target, then it’s just remote control. Easier than what you describe, and reasonably secure. Once all is working, then the pc can be removed. Ideal would be to find a cheap single board computer that can handle this - I’ve done this with real VNC remotely to a R-pi, but that was a paid service…(by the client).

1 Like

You can install venus OS large on the RPI 2 and use that instead of the CCGX. The large image has node-red built-in. You will need a MK3 to USB cable to communicate with the quatro. The CCGX is getting pretty old. You can also upgrade to the cerbo GX.

I use shelly for load dumping based on SOC works very well. I have one set up for the hot water that will run at 100% and also run it once a day at a certain time in case it does not get to 100%, for example. It’s a 1400W heat pump and 1600w element so I can run it with a contactor.

If you need any help let me know. I run 2x RPI 3’s and a cerbo GX, 3 systems total. I do have a RPI 2 as a spare and it runs Venus OS fine just does not have wifi or Bluetooth.

1 Like

Hey thanks Owen this is very encouraging.

Could you give any more detail on the setup of the shelly, how you are controlling it? The sample I bought arrived today and I’ve been experimenting with it - very cool.

It actually has it’s own script facility built in, and multiple protocols - I start to wonder if it could actually do the job by itself, reading from Modbus TCP, without node-red or the additional Pi. I have some 3s as well btw, just thought it was cool to use the old 2 for something.

The customer might be a bit resistant to change the CCGX but I will see.
Plenty more learning to do!

Here is a flow to control a shelly 1pm. I also have nodes there for a 1PM pro and the new gen 3 you will just need to check what payload they need to turn on and off. I just use the shelly pallet in node-red. For the hot water, I do use a scene and run it for 3hrs when it is switched on. I have a shelly wall display and can see the state when I am in the kitchen. Also, it’s nice when we go somewhere for a week I turn the hot water on when we are heading home and disable the load dump flow.

I haven’t looked at sending an instruction from Victron to a separate node red I have it running in Venus of and use the Victron pallet.

SHELLY FLOWS.txt (13.0 KB)

1 Like

Excellent stuff Owen, thanks very much.
Your example also got me past a head-scratching moment because the example call on the Shelly web pages has a typo in it (a missing comma), but copying your example worked first time.

Well I think the external Pi 2 with Node Red will be the way to go for now, assuming that the access to the victron data works OK.

Thanks again!

Kia ora @etec , I am using the Shelly relays as you describe. I have three controlling water pumps, two for irrigation and one for household water (we are off grid in every respect). The irrigation pumps have timers so they turn on and off at fixed times, plus a timeout in case I turn them on manually and forget to turn them off. If the power goes off and back on again, the pumps stay off to prevent startup power draw pushing a low battery back over the edge. All this works without any network traffic at all; they do send status information out, and will change their behaviour if told to by Node-red and MQTT; but if the network is down they will still do all their pre-programmed stuff.
There are also Shellies that switch 2-4 relay outputs.
The point I am making is that a few Shellies and a single SBC running Node-RED (or HomeAssistant, whatever) will probably do all you need. Modern Shellies (more recent than Shelly 1) can also act as WiFi range extenders, particularly nice if you have a wide area or some nice Faraday cages to block signal.
Shellies draw power to stay alive from the wire feeding the socket outlet. You don’t need more than one SBC, making power supply overall much simpler. Logic is split between the SBC and the Shellies, but in a sensible way that helps a lot if the WiFi is at all loose. The Shellies are individually programmed via a web interface, and in my case the simple automations onboard the Shellies contribute all the ā€˜mandatory’ features, with the SBC just providing a nice web UI to check status and ā€˜future expansion’.

1 Like

Kia ora again Etec, I solve the remote access problem very simply using Zerotier. It creates a private VPN. I have Zerotier installed on my laptop and phone, and also on an SBC on the target LAN routing traffic between the LAN private IP addresses and the VPN. When I am local, Zerotier is not in the way, but when I am remote any traffic between my laptop or phone and the local private IP addresses just gets correctly routed by Zerotier. I’m lucky that the ā€˜local’ ISP gives out static public IP addresses but I can’t think why Zerotier would not also work where you have a dynamic public IP address, and that can be made much simpler using a Dynamic DNS provider like DuckDNS.
Zerotier has been zero maintenance so far…

1 Like

Great advice, I had not heard of Zerotier. I realized I do have a static IP at home now so this should be straightforward.

And thanks for the confidence vote in use of the Shelly devices for automated off-grid applications. I am quite impressed with them so far.

I hope the thread will be useful for others with the same kind of requirement - that is, optimizing the use of excess power (not talking about replacing any safety critical dump load).