question

chris-wilberg avatar image

Venus Node-RED - Example flow: Temperature controlled relay

Does anyone have a good example of flows for maintaining lithium battery temperature via GX relays?

I have one that I slapped together but it's pretty basic and I don't really have a very good grasp on node-red yet.

Seeing as how this is one of the most common reasons for someone to want node-red, I'm pretty surprised that I can't find this already out there! The flows/dashboard from section 6.2 of the following link are very similar to what I am trying to do....but I can't see the rest of the flow and I'm lost. https://www.victronenergy.com/live/venus-os:large?utm_source=offline&utm_medium=qr&utm_campaign=qr%20code%20products#


I would also like to throw in some other variables such as warming the batteries to a higher temperature when the PV & battery voltage is above a certain threshold, and disabling warming when the battery voltage is too low.




temperatureNode-RED
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

2 Answers
Mark avatar image
Mark answered ·

Hi Chris,

To assist yourself and others, I have created a NodeRED flow example that:

  • Allows a relay to be controlled based on temperature (with only minor changes this same flow could be adapted to use any input or control any output)
  • Has separate ON and OFF thresholds (hysteresis) that can be dynamically set
  • Has separate ON and OFF time delays that can be dynamically set

1614606982674.png

To keep this flow simple, I have not used any 'function nodes' with code and also not incorporated any dashboard nodes; creating a dashboard would allow the ON/OFF thresholds and time delays to be set dynamically and the status to be monitored live via the user interface screen.

This flow is within the ZIP file attached, since JSON files cannot be directly uploaded; just unzip and import it into your NodeRED editor.

Regards, Mark.

210302 VenusNodeRED Temp Controlled Relay.zip


2 comments
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

Mark, thaks for taking the time to put this together! I'm sure it will be quite helpful for many users. The function nodes definately had me scratching my head more than the others and that's what I kept trying to use. Also I'm finding the dashboard nodes to be easy to set up, other than a decimal rounding problem that displays ridiculously long decimal places at times. I have gotten around that by using a conversion node that has a check box for decimal rounding. I'm sure there is a better way, but I haven't found it yet.

Another interesting challenge I'm having is making a mobile link to the dashboard that doesn't require altering the url multiple times. Is this even possible through VRM or do I need to use dyndns and port forwarding for this?

No problem Chris.

There are many ways to round to a given number of decimal places, the simplest is probably to use another change Node with a JSON expression - like this:

PS. Change the digit after the comma to specify how many decimal places you want, you can also specify a negative number to round to 10's, 100's, 1000's...1614650663340.png

1614650687046.png


As for the UI link, it should remain static/does not change - so once the proxy interface is open you can save the full link, or save it and edit down to just https://12345-nodered.proxyrelay3.victronenergy.com/ui/. The only complication is that after 30min of inactivity the proxy interface will automatically shut down, so then it just needs to be re-opened from the the proxy page (before opening/refreshing the UI link).

Once fully implemented the plan is to have direct links to the Node-RED editor and UI in VRM.

Regards, Mark.

1614650663340.png (10.2 KiB)
1614650687046.png (15.5 KiB)
ulrikmailand avatar image
ulrikmailand answered ·

@Mark

Just wanted to say thanks for your node-red example flow, awesome work!

Managed to use that flow to control my dieselheater though the Cerbo GX so it turns on if the temperature goes below 4 degrees centigrade and off againg when it reaches 15. Couldn't have done it without your flow.


THANKS!

Br

Ulrik

5 comments
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

Hi Ulrik,

Your welcome and I am glad that you got it working for your application. Thanks for the feedback.

Regards, Mark.

I @Ulrikmailand,

off topic question: wonder what the brand of the diesel heater is and how you switch the diesel heater off, completely de-power or a control wire?
Most diesel heaters require power for the time until they are cooled down, which usually take a couple of minutes. Mine is a Webasto and I've found no other way to control it remotely other than using an expensive Webasto brand remote box (via SMS), which is not really state of the art.

Hi Stefanie


It is an eberspacher heater approx 10 yers old, believe the name is D4 - airtronic.

What i have done is to put the Cerbo GX in between the controller and the actual heater, so i leave the control unit always on at a specific level (approx 50%) and then i use relay2 in the Cerbo GX so when the relay is open the connection between the control box and the heater is disconnected and when closed connected and the heater then turns on and is managed by the control unit.

I can't turn the temperature up and down remotely, but that is ok i use it to keep the boat safe from freezing or to turn the heat on before arriving at the boat and for that it is ok that i can't turn the heat ekstra up or down. When i'm at the boat i just use the heater as always and can turn the level up and down as i please.

When at the boat, I either disable the node-red flow of just set the turn off temperature at a highlevel so the automation doesn't kick in.

Heres a picture of the control unit:



controlunit.jpg




controlunit.jpg (48.7 KiB)
Thanks for the explanation, Ulrik.


Ah yes, I had the same Eberspaecher until it died last year after 27 years of service.

Unfortunately this is not possible with the Webasto. My unit talks W-Bus between the remote controller (display) and the control box inside the heater. The protocol is not reverse engineered fully atm, at least not that I know, thus I have no idea what the control box like to see in order to switch off in a controlled way. It's definitely not a simple on/off signal.

FYI you can control the Chinese copies using the Afterburner: http://www.mrjones.id.au/afterburner/