Following on my other posts about my gates, I thought I would document this a bit better.
So I have a pretty standard Roger swing gate system, with just the standard keyfob and manual exit/entry button/keylock. Works well, but it is pretty much standalone. I wanted to be able to kick off other things, turn on lights etc when they are activated.
So I picked up a PiRelay board for a spare Pi3 I had laying about and went about working out what I wanted:
A virtual gate opening button in HE, so I can open from my mobile or open them in another scene/flow.
Same things to happen when a caveman opening is performed, ie from keyfob or manual button.
So armed with the Pi, relay board, I installed Node-Red and the integrations for Pi and Hubitat
I wired the open gate contact on the controller through the NO circuit on relay 1 on the PiRelay
I picked a spare GPIO pin and used a 24v relay connected to the 24v courtesy light circuit on the gate controller and connected that GPIO to 0v through the NO on that relay.
Then I set about working out flows in Node-Red and asked a load of questions and did my research and came up with:
So now if I press the Virtual switch in HE, it sends a 1 second up and down to the GPIO pin attached to the first relay, which effectively acts like a key press on the fob or manual button, it then used Echo Speaks to announce to 2 of my echo's that the gate is opening, and turns on a Tasmota attached flood light, which stays on for 5 minutes. It also checks it's night time and the light isn't already on, otherwise I could find myself turning off a light in 5 minutes time that I wanted to stay on, and no point for the flood light to come in the day time!
If I press the keyfob button, NR see's the GPIO pin go low(using internal pull up) and then kicks off the same sequence.
Switched have been used to "filter" out changing states of GPIO pins and the virtual button, as otherwise it will do things twice.
Pretty simple flow and hardware was a little head scratchy, but overall I am happy with it, and gives me a lot more scope using NR and my C7.
Hope it helps anyone else wanting to smarten up something that was never meant to be!