Node-Red flow for hot water diversion

I’m not a coder and new to Node-Red so finding it tricky to create a flow, and now find the problem is how to implement ‘and’ for the parameters I’d like to trigger the relay. I’m not really sure what to input in the function json, and I couldn’t get a Boolean palette node to work.

This is my test flow so far:

Does anyone have any pointers to combine them, or a working flow they can share?

Hot Water Diversion Test Flow.json.zip (3.2 KB)

Explain what exactly you want to happen

You only want it to switch on
above a certian soc
Under a certain load
And during a certain charge state?

With a manual override from the cerbo relay?

Hi,

Yeah I’d like to be able to control the GX relay (to trigger the Quattro ACout2) based on:

  1. Load ( From Quattro: Is the load low enough to turn on the immersion - with hysteresis to stop flapping)
  2. SOC (From Shunt: Is the battery charged enough - on and then off percentages)
  3. Charge mode (From BatteryAggregator Dbus: Check for instance; the batteries are in “Float” mode so they have done their balancing)
  4. Manual 0verride - Would be handy but not critical, it was initially in my flow for testing the relay)

So far I got each individual section working but it’s trying to make them work together in parallel with some kind of ‘and/or’ function I’m not sure with my current format?

I have spent the last few days looking around the old forum, YT and tutorials but haven’t found any other relatively simple Node-Red excess solar diversion flows so maybe this would be useful too for others, that need better control than Assistants while there’s still no dedicated Victron method for relay 2.

Use a function node with if/then statements

1 Like

Here is the syntax for an AND statement in the json function code.

if (BattV >= 14.38 && BattA < 24) {
FloatFlag = 1
msg.payload = 13.7
}
return msg;

1 Like

Update* Tested and working. :slight_smile:

Thanks all, I think I have a working flow, I ended up prompting ChatGPT for a few hours and it looks like it helped me make a flow to work how I want after quite a bit of trial and error with GPT. My first time for both a working Node-Red flow and programming with AI. *I’ll test it properly tomorrow. - Now Tested, just need to clean up some unused UI Dashboard contexts, but it all works as expected.

Hot Water Diversion GPT.json.zip (3.5 KB)

1 Like

I just shared some of my work for learning purposes: UpCycle Hybrid DESS Trade

1 Like