question

derrick thomas avatar image
derrick thomas asked

Help with node red flow

I realize there is no official "support" for os large and node red, but I'm hoping someone might be able to help steer me in the right direction. I am fairly illiterate when it comes to programming although I can follow directions. (Mostly lol)

I am using a very basic flow to switch a water heater on and off based on active ac input. That was not difficult to figure out. Next I want to incorporate a water pump (12volt in an RV) into the gx control. The current setup has 2 momentary switches (one in the bathroom and one in the kitchen) which control a latching relay that switches ground to the pump and an indicator light next to the switches. I realize I can do the simple way and just abandon all that and control the pump via manual relay switching through the gx, but I would really like to retain the switch in the bathroom for those times when you step into the shower and realize you forgot to turn the pump on.

if I could create a flow that uses a digital input (switched from the remote in the bathroom) to trigger a relay state change that would be ideal. Problem is I can't figure it out. I don't want to just set digital input active turns it on and digital input inactive turns it off because if it's already turned on by the remote switch I want to be able to turn it off by the gx, and vice versa. So is there some way to simply setup so a change in digital input state triggers a change in relay state? Regardless of what the initial state is? Hope this makes sense.

Anyone help me out?

Node-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.

1 Answer
derrick thomas avatar image
derrick thomas answered ·

I just wanted to come back and post a follow-up. After much searching and watching several YouTube videos on node red I was able to figure it out and got it working exactly as I had envisioned. I am able to control the water pump from the cerbo as well as the remote switch and both will turn it on or off regardless of the state of the switch or the relay. Works great.


For those that are interested, I used the change node to set a message holder for the current relay state, then used a digital input (controlled by the remote pump switch) to trigger a node red switch which reads the current relay state and then changes it to the opposite state. I used a filter so that when the digital input state changes it triggers the relay switch part of the flow.

2 |3000

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