Skip to content

Immersion heater control with node red

Featured Replies

#1

I have been pondering how to put to good use all that excess solar in the summer. Great advise here, but as soon as I read relay, I soon get confused... 
Having a Cerbo GX and wanting to see what this node red was all about, I thought I would give it a go. Turns out it was a lot easier than expected!

On the immersion heater side, I already had a (Chosry) Smart WiFi fused spur timer switch, which uses the Tuya platform. On the Cerbo side, I had to enable node red and install the Tuya package. Communication between them is local through the boat router, so no internet or cloud services involved. 

It's very much work in progress, but so far I can choose to start the immersion heater when the mppt goes into float, or when the battery reaches the desired SoC. And it will stop based on a custom timer or battery SoC. It turns on the inverter if it is off, and then puts it back to whatever it was when finished. 

All can be controlled with a web dashboard. Loads of room for improvement there, but for the moment it does the job.

I must say that node red is rather awkward to start with, but the more you tinker, soon you start getting used to it. Main problem is that I keep wanting to add more and more stuff to it :)

 

This is the current dashboard

 

image.jpeg.0fb879d32505b87881b38064920a3af3.jpeg

 

It will be great to hear from others doing similar things..

 

Edited by fer
just learnt how to do the attached image smaller

#2

Thanks for the information, although I don't fully understand it as I don't have a Cerbo GX. I assume yours is a mains immersion heater, not 12v?

  • Author
#3

Yes, mains 1kw immersion heater, with a wifi fused spur switch. I got this one.

The cerbo just tells the smart switch to turn on and off.  (it will turn on the inverter too if it is off)

Since the cerbo is connected to the rest of the equipment, it knows when the mppt goes into float, the battery reaches certain SoC, etc. And with node red, it  can be programmed to turn on and off the switch when certain conditions are met.  

Edited by fer

#4

Can you explain what node red is please 🤷🏻‍♂️(in thicko language please🤭) 

Edited by Chris John

#5

I've been doing the same this week with node red and a tapo smart plug. I have succesfully achieved switch on and off parameters based on SOC and solar output and various delays. Seems to work ok, but I think I need one of those cheap scr motor controllers to dial down the immersion voltage (power). The node red/venus in my poor mans setup is installed on a raspbbery PI 3, with another PI running home assistant. 

Edited by Russ T

#6
59 minutes ago, Chris John said:

Can you explain what node red is please 🤷🏻‍♂️(in thicko language please🤭) 

A system for controlling home automation. https://nodered.org/

#7
5 minutes ago, eightacre said:

A system for controlling home automation. https://nodered.org/

I would say that node red is a flow based visual programming tool, though it can be used in home automation. Home Assistant is more associated with home automation, and of course, can incorporate node red into its software via the add on feature.

  • Author
#8

yes, pretty much that.
It's a flow graph. You start with an empty canvas where you can place nodes. These nodes have different functions. Then you connect the nodes to send messages between them.

for example, 

image.jpeg.bda2191ee19851d666bc07af98fe6a40.jpeg

The node on the left, sends the mppt state to the next node. The second node checks that state, and if it is float, it goes to the next node. The third node creates the message that will tell the switch to turn on, and sends it to the switch, which is the node on the right.

This can easily get more complex and more useful, with many nodes interacting with each other and setting conditions, actions, etc.

#9

And my attempt at a simple description.

 

Node-RED is a visual tool used for connecting different pieces of hardware, software, and online services together. Instead of writing long lines of code, you build "flows" by dragging and dropping boxes called nodes onto a canvas and drawing lines between them to connect their inputs and outputs. It is a way to create automation logic by connecting these building blocks.

 

image.thumb.png.b95b9591bc41fe6fb0f1be8a7950c630.png

 

System Overview


This flow connects four nodes to create a logic-based automation system. The input comes from a Victron SmartShunt, which monitors the battery's State of Charge (SoC). This data is fed into the "MASTER CONTROL" function node, which acts as the core logic processor. The output of this node then commands the connected solar charge controllers to turn on or off based on the battery’s status. Within the Master control node is the logic to make that happen.


Operational Logic
Standard Weekday Operation (Monday–Saturday): The system manages the battery by turning the chargers on when the SoC drops below 90% and turning them off once it reaches 95%.


Evening Override: Regardless of the current charge level, the logic is programmed to force the chargers on at  18:00 to ensure the battery reaches 100% capacity.


Sunday Maintenance: To support shunt synchronization, the logic allows the solar chargers to remain on throughout the day on Sundays until a 100% SoC is reached.

#10

Where do you set the switching values, or are you relying on the MPPT to tell the next mode it has gone into float with no values involved apart from those internal to the MPPT?

 

If you set the values in the second node then how do you distinguish between a true float voltage and a well discharged battery under a higher load voltage. I suppose this is more likely on an LA system, but interested to know.

#11
14 minutes ago, Tony Brooks said:

Where do you set the switching values, or are you relying on the MPPT to tell the next mode it has gone into float with no values involved apart from those internal to the MPPT?

 

If you set the values in the second node then how do you distinguish between a true float voltage and a well discharged battery under a higher load voltage. I suppose this is more likely on an LA system, but interested to know.

My system is for a lithium based battery, so I have it set not to do a traditional LA float, but switch the charge source(s) on and off based on SOC. So the switching logic is set within the nodes itself, with a fail safe that should the system break, the MPPT's resort to their internal settings (which do have a float setting). The voltage is ignored in node red, though it could easily be catered for. Bear in mind I am not professing to be an expert at this, I'm still very much learning.

 

Is it a better system? Probably not, just a different one.

 

ETA, You were probably referring to fers post above mine, sorry.

Edited by Russ T

#12
Just now, Russ T said:

My system is for a lithium based battery, so I have it set not to do a traditional LA float, but switch the charge source(s) on and off based on SOC. So the switching logic is set within the nodes itself, with a fail safe that should the system break, the MPPT's resort to their internal settings (which do have a float setting). The voltage is ignored in node red, though it could easily be catered for. Bear in mind I am not professing to be an expert at this, I'm still very much learning.

 

Is it a better system? Probably not, just a different one.

 

Thanks

#13

Thanks. Think I’ll stick to getting off my arse and switching the immersion on when the batteries are full 🙄

#14
3 minutes ago, Chris John said:

Thanks. Think I’ll stick to getting off my arse and switching the immersion on when the batteries are full 🙄

Good plan.

 

 

until you forget to turn it off.

 

Mind you that is exactly what I did for many years using a smart plug that auto turns off.

Edited by Russ T

#15
3 hours ago, Chris John said:

Thanks. Think I’ll stick to getting off my arse and switching the immersion on when the batteries are full 🙄

 

That's fine if you happen to be on the boat when the sun is shining. 

 

There are other ways to do the same thing without Cerbos or nodes, as described in other threads.

  • Author
#16
17 hours ago, Tony Brooks said:

Where do you set the switching values, or are you relying on the MPPT to tell the next mode it has gone into float with no values involved apart from those internal to the MPPT?

 

If you set the values in the second node then how do you distinguish between a true float voltage and a well discharged battery under a higher load voltage. I suppose this is more likely on an LA system, but interested to know.

I don't have any technical background, and I am not saying this is the way of doing things. It was just a super quick and simple example to illustrate to Chris John how node red can be used.

The great thing about node red is that the user can customise it for their own set up and requirements. It can me tested, tweaked and improved over time. In my to do list is a logging system, so it writes into a file when things are triggered and why.

 

In that example the victron node on the left sends the actual information about the mppt state to the next node.

image.png.cc4473998cef81770f31bea90726b1a3.png 

The second node receives the message (payload), and if it is equal to 5 (float mppt state) then lets the flow continue to the next node.

image.png.4ac97957afe9e3f3d5ad4802a9984816.png

 

 

Not sure I am answering your question.. ?

 

13 hours ago, Chris John said:

Thanks. Think I’ll stick to getting off my arse and switching the immersion on when the batteries are full 🙄

I did that for many years, then swapped the timer switch for a wifi one so I could do it with my phone without getting up of the sofa :) (or when I am not in the boat) A permanent internet connection on the boat is needed for this though.

I always set it with a timer, so it turns itself off. 

 

 

 

#17

@fer, many thanks for that, I am just trying to understand more about these modern systems, not that I am likely to use them unless it is for home automation. I am certainly not passing any comment about the way that you or anyone else is using this stuff.

 

I find it very interesting that the Victron stuff reports what it is doing to the node, and not just the raw voltage.

 

Until your post and the explanations I think that if I wanted to do this sort of thing it would have involved some dialect of BASIC running on a Pi, but your way seems simpler.

Edited by Tony Brooks

#18
18 hours ago, fer said:

yes, pretty much that.
It's a flow graph. You start with an empty canvas where you can place nodes. These nodes have different functions. Then you connect the nodes to send messages between them.

for example, 

image.jpeg.bda2191ee19851d666bc07af98fe6a40.jpeg

The node on the left, sends the mppt state to the next node. The second node checks that state, and if it is float, it goes to the next node. The third node creates the message that will tell the switch to turn on, and sends it to the switch, which is the node on the right.

This can easily get more complex and more useful, with many nodes interacting with each other and setting conditions, actions, etc.

 

So a simplified version of ladder programming 

#19
14 minutes ago, StephenA said:

 

So a simplified version of ladder programming 

Very few similarities to ladder-logic. The 'wires' in a node-red flow take strings of data from one node to the next, not just binary 0 or 1. You can also have multiple flows which run concurrently, unlike rungs in ladder logic.

 

Ladder logic was designed to be similar to electrical diagrams which used relays for logic.

 

It's low code, node based programming - there's a few other industry-specific variants on it too.

  • Author
#20
1 hour ago, Tony Brooks said:

@fer, many thanks for that, I am just trying to understand more about these modern systems, not that I am likely to use them unless it is for home automation. I am certainly not passing any comment about the way that you or anyone else is using this stuff.

 

I find it very interesting that the Victron stuff reports what it is doing to the node, and not just the raw voltage.

 

Until your post and the explanations I think that if I wanted to do this sort of thing it would have involved some dialect of BASIC running on a Pi, but your way seems simpler.

The good thing about victron is that there is plenty of documentation. They explain very well how the VE.direct protocol works, what it reports and how to read it.

https://www.victronenergy.com/upload/documents/VE.Direct-Protocol-3.34.pdf

Previously I had the BMV connected to a Pi via serial, and a python program to deal with it.

Node red just provides all the ground work, and makes things easier. You can use the provided nodes, or you can make your own programs using javascript; which is what Russ T is doing in the orange node (Master control)

#22
13 minutes ago, PeterF said:

Just noticed this topic on the Victron Community, it looks like this is going to be implemented natively in Venus OS and it says it will work with mobile installs like vehicles and boats.

 

https://community.victronenergy.com/t/beta-turn-surplus-solar-into-useful-work-with-gx-opportunity-loads/58711

But you do need to install compatible switching devices like Shelley, you can't use a simple relay (e.g. my immersion connected to ACOUT2).

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.