I’m working on making a pool control system in HA, and I’m using node-red for the system logic. (I’m terrible at writing code, so any visual sort of editor is a godsend.) My system has a bunch of Pi GPIO switches controlling the pool systems, and then I have helper switches to control the GPIO in a way that makes sense for people using the system. (I’m emulating the way my old Compool system works.)
The problem I’m running into is I can’t figure out how to make a flow trigger when two of the helper switches are off. The switches are Pool and Spa, and each of them turn the valves to the respective mode, and neither are on at the same time (which is done using node-red as well - when one is turned on, it turns the other off). I also need both switches to turn on the pump GPIO, and that’s where I’m running into trouble. I can’t figure out a reliable way to create this: if either switch is on, pump is on; if both are off, pump is off.
The best method I have so far is with the Ultimate Boolean add-on logic gate, but it needs two of those gates, and for some reason the pump flicks off and back on instead of staying on, probably because of the millisecond when the switch is turned on and the other one is turning off. (And now I’m trying to get that method to work again, and I can’t.) Is there a better and more reliable way to do this, without having to write lines of code in a function node?
Oh, and once I get that working, my next challenge is to add in some way of checking the state of another gpio switch, and adding in a delay (for the heater) if the switch is on, before shutting the pump off.