Detect gates opening - RPi maybe

Not sure where to put this, but Integrations it is! I have a gate controller that, quite obviously, controls my powered gates to my yard. I had already planned to integrate my RPi4 and PiRelay to the contacts, so I can open them from other devices, but it occurred to me what happens when someone opens them from the remote, any rules I have to turn on lights, send pushover notification etc won't work. I want to detect when they open from whatever source, so some kind of device that I can put in line with the relay on the controller to send a "gates open" to my C7

So is there a way to detect a GPiO high situation from the Pi over the network, so I can do it all from 1 connected device? I can quite easily rig up a circuit to send a pin high when the gates open, it's just how to get that into HE and my C7, so I can use it to do all kinds of annoying things on gate opening(I'm like that, I have one of those Sonoff zigbee battery buttons that just plays Aqua's Barbie Girl on the daughters bedroom Echo when pressed. No idea why, just amused me and annoys her!)

Any help appreciated

Thanks
James

Did you code the RPi4? You can push Events into Hubitat's MakerAPI over the LAN to do so many things.. including a simple thing like this.. IF you have the programming skills to alter your RPi.

MakerAPI can have multiple instances.. you can install it as many times as you need, each with a specific set of exposed devices. You can have Node-Red running on a RPi and have one instance of MakerAPI for that. Create another instance and just expose a virtual switch called PoweredGate, for example. Using the URL shown in the MakerAPI instance, you can change the virtual switch from your gate's RPi. Lots of fun :smiley:

1 Like

i have a zigbee and zwave contact sensor on my gate and an extender in a plasti covered outdoor outlet.. seems to work fine.. depends how far the gate is from the house..

Yes, I do all my own RPi stuff. Sounds interesting, gives me a start point to get integrated :slight_smile: Thanks @csteele

Gates are quite a way from the hub in the house, so no real Z access over there, prefer something over the LAN/Wifi as I have Unifi NanoStations connecting all my outbuildings, garden office and house together. Thanks though @kahn-hubitat

2 Likes

@csteele Amazing, does exactly what it says on the tin!

Push a virtual button in HE, sends to Node-Red via Maker-API a momentary on-off to a GPIO controlled relay which bridges the manual open button contacts, gates open and lights come on for 5 mins.

Open the gates with a remote, a GPIO pin goes high from a contact on the controller, triggers the lights for 5 mins.

The possibilities are endless!! Might even make Alexa tell me that the gates are opening, so I know when the partner is home, and I can look busy :wink:

Thanks for the pointers!

2 Likes

That's really neat! Thanks for sharing the Node RED flow.

Just to note this is using the node-red-contrib-hubitat add-in in Node Red. The relay is a Device node and the lights are a control node. The comment relates to the GPIO pins my 4 relay PiRelay board uses. One relay for the momentary to the open pins on the gate controller, and 3 I can use to turn on lights locally, ie non smart switch lights not already in HE, such as the mini LED floods that are usually controlled from the gate controller, I can now make them smart without buying Sonoff's or the like.

Thanks

Had a further play, realised that what if it's night and the lights are on anyway, then they would be turned off and stay off, so not ideal! Added a time range switch into the flow:

This is a time suck, but a fun one! Realised it was running the routine twice on each press, ie trigger on state change to on and to off, so added a switch to check the payload for on. Then added the Alexa speak to makes all my echo's say the gates are opening. Very satisfying. Might be useful for no-one, but its documented for me if I lose it!

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.