Thank you @sos_nz for the great project! I adopted it and did some improvements:
- I used Shelly Uni instead of Shelly 1 - it has 2 outputs, 2 switch inputs and sensor inputs. The main benefit is you can have separate Open and Close actions - instead of single button, when you never can be sure of the current action (eg. after reset, activating safety). It also has an external antenna, which is great for a gate usually far from home. And it works off 24V. And is even smaller than the 1. And is just as cheap. The full package.
- Output 1 wired to terminal #61 (+#60 COM) - logic set to IC=2 : Open
- Output 2 wired to terminal #62 (+#60 COM) - logic set to IC=3 : Close
- Input 1 wired to terminal #20-21. Logic Aux=6. Normally I have a warning light attached here, which signals that the gate is moving. I can’t change it - but it’s actually very useful to read it, because I have information “gate is moving”. This is easier than detecting signal that goes on-off-on-off with Aux=1 logic.
- Input 2 wired to terminal #26-27. Logic Aux=8 - contact closed if gate is closed. So actually I have a reed sensor. But I’m experimenting with other options ATM.
- As a bonus, you can attach a temperature sensor to one of the dedicated inputs, eg. to detect frost.
Below is how the module looks.
Thanks again @sos_nz, I did all of this thanks to your post