I can give you some tips on this.
Firstly, most of the signals that go through gate switch sensors are way higher than 5v. This is so there is no signal loss over distance, electrical noise from motor etc. Mine was between 25 - 30v depending on if the unit was running on mains voltage or battery backup. That probably will fry something you connect to it.
Also, as I just mentioned, it can be a very noisy environment. So modifying things like battery powered zigbee window sensors etc won’t work well as the electrical noise is usually higher than the signals they use to trigger.
In my case, where my front gate is, it’s just on the edge of my home wifi signal, so that was very unreliable.
I find zigbee reaches it better.
Also keep in mind that for a decent wifi extender you are looking around $100, where as to extend zigbee, you just put another zigbee mains device and it extends the mesh. (zigbee mains device could just be a simple switch modulen($10). I put one on my carport which is halfway between the gate and house. Problem solved there with signal getting to gate and now I can control lights on my carport as a bonus.
As for the “sensor” at the gate, I used another simple zigbee switch module that had a connection for an external switch. The zigbee module is powered by the 240v that the gate uses. As I said, don’t use low powered battery powered zigbee devices here because of electrical noise.
So all you do is use home assistant to monitor the state of that zigbee switch module as your sensor. Home assistant will know if it’s ON or OFF. You are not actually using it to switch anything on or off, nothing is connected to the output side of its relay.
And here is the magic that ties this all together.
You just need a switched output from the gate controller to switch the external button connection of the zigbee module.
If your gate controller has something usable use it.
If not, you can physically add it like this:
Most gate controllers have a physical limit switch to know if the gate has finished opening or closing so it doesn’t destroy itself. As I’ve mentioned, the sensing voltage going through the switch is probably about 24 volts or so. The safest way to do all this is to add another switch piggyback style on top.
That way, you have your own switch that won’t have any electrical noise / weird voltages going through it.
Note that even with this independent switch, it’s still probably not going to work with a battery powered zigbee device as the environment is still too noisy so don’t bother trying that… Trust me, days of pulling my hair out and swearing is the research behind that statement
just use mains powered zigbee device.
Here is a photo of how I did it…
So originally, there were two micro switches, (one for opening limit switch and one for closing)
I’ve added a third micro switch on the top (yellow arrow) and just put longer bolts holding it there
I’ve also added a little metal flange to the top micro switch (blue arrow) so that when the switch under it gets triggered, it also mechanically triggers the additional switch. That way I have a totally electrically isolated switch that the gate can trigger. ![:grin: :grin:](https://community.home-assistant.io/images/emoji/twitter/grin.png?v=10)
SO IN SUMMARY:
-
I’ve added a extra micro switch to my gate
-
The gate opening / closing triggers that extra micro switch
-
that extra micro switch is connected to the on/off button input on a mains powered zigbee module
-
home assistant monitors that zigbee module to see if it’s on or off
-
automations are triggered by the on / off state of that module.