This is my first time working with Node-RED and I have created a flow to switch a water heater on and off based on battery SoC. As this system is not deployed yet I created a virtual slider switch to simulate SoC and the flow seems to work how I want it too as I alter the SoC. I would like the ability to have manual control over the water heater to set it to off or automatic using a virtual toggle switch.
The 3 state virtual switch is perfect for this application in our RV. I use node red to watch shore power to switch between electric & gas operation. Same with the absorption refrigerator.
There seems to be no way to attach a flow, but I do have some snips that can get you there with a bit of work. On Start keeps the errors down, and Setup for the extra output.
Lines 38 & 39 are ternary operators.