Automatic control of water heater with Shelly and NodeRed on sailboat

I have upgraded my electrical system on sailboat and have now much more energy for use.

I can now afford some of that energy for AC water heater, so that we have hot water for washing our dishes or warm shower in the evening. Water heater uses around 870W when heating, so this is still in range of my MultiPlus 1600VA Compact inverter.

I have installed Shelly 1PM Mini Gen3 on the water heater (after breaker) and have it configured via Cerbo MQTT. This allows me to monitor energy usage and allows me to switch it On/Off programatically.

I have created the following NodeRed flow:

It also has control UI dashboard, primarily to control the parameters:

Main logic is in Heater control function:

  • always On when shore power
  • always Off during the night (to reduce noise)
  • Off if SOC too low (35%)
  • turns On when battery is charged to at least 70%

Full JSON flow is attached:
water-heater.json.zip (5.3 KB)

I have still two things on my TODO:

  1. Always Off when engine is running (as engine heats the water then) - but I need this data from SignalK to NodeRed
  2. Overload protection: do not turn water heater On if there is substantial load on inverter already

Really happy with Victron equipment and particularly Cerbo GX and NodeRed integration. Also great community support here.

3 Likes

What you will need to do, is keep an eye on the load on the Cerbo.
We have seen reports, more commonly with the Shelly driver and a larger config of flows, that the Cerbo can start to reboot, or show “busy” errors.
This is more applicable when airflow is limited and heat becomes an issue.
If it does occur it will be obvious, also why I sometimes suggest a separate device for power users.

Thanks for the warning, as I am new to this will have to monitor the system.
The automation function triggers only once per minute and all Victron data sources only pass value on changes. I suspect this should not bring too high load on Cerbo.

Great, that is the best way to lower the general load. Your setup is looking good, nicely done.
I see you are using dashboard 1.0.
Have a look a dash 2.0, it is much prettier and more powerful. VRM also supports it remotely.

@nickdb what is Dashboard 2.0? I am using node-red-dashboard, latest version. Did you mean dashboard-evi?

@flowfuse/node-red-dashboard

1 Like

Thank you very much, nice blog post, will also check other content there. Will update first post with new image and flow json.

Dirk is the nodered guru at Victron, you will see his posts more here as well. He is a legend.

I’ve had issues with the Shelly devices randomly going offline then commands sent to them via Node-Red being missed.

For example the relay is in the ON state but the device drops offline. When an OFF command is sent then it isn’t received and the load stays on, potentially draining battery or overloading the system.

So I’ve recently started switching the relays on with a 60 second timer, then I repeat this ON command and reset the timer to 60 seconds every 10 seconds for as long as I want the load to stay on. That way if the Shelly drops offline it will automatically disconnect the load when the timer expires.

2 Likes

@WhiteCitySolar good to know.
My implementation is also very defensive: I read shelly switch state every minute and based on that the logic is performed. So if switch would not be in right state, another off or on command would be sent.

I have now resolved all TODO items from my opening post:

  1. I have switched to SignalK embedded NodeRed and disabled Cerbo’s NodeRed. This allows me to have access to SignalK and Victron nodes at the same time.

  2. Added simple overload protection: if inverter load gets above 1200W, heater is turned off. If heater should be turned on and the AC load is already high, do not turn heater on to not cause overload.

I have also added chart with SOC and time when switch is turned ON/OFF, so that I can inspect what was going on in past 24h.

This is my new flow for SignalK embedded NodeRed:
nr-signalk-flow.json.zip (12.4 KB)

Thank you all for support and for putting SignalK and NodeRed on Cerbo.

2 Likes