Motivation
I equipped my gate with an automatic gate opener. Here in Germany, the brand “Sommer” is probably the market leader for such systems, so I choose the Sommer Twist 200e. It seems to do a good job at what it was designed for - opening and closing the gate - but lacks smart home compatibility.
Although Sommer sells a product (SOMweb) to integrate their Systems into Google Home, IFTT and Alexa, I decided to find a DIY solution, since the OEM solution
- comes at a price tag of 150€
- does not integrate into HomeAssistant
- probably not transmit whether the gate is open or closed in combination with my gate opener
- probably relies on their cloud service
- may not even be compatible with my specific gate opener, not sure though
With the help of an ESP microcontroller and the ESPHome plattform I want to integrate the gate opener into Home Assistant. Compared to just buying a double relay switch, this also gives me the possibility to monitor the state of the gate (open/moving/closed)
Controlling the gate
The controller of the gate opener system twist 200e provides several connectors for the external components such as the motor, a key switch, an electronic lock… These connectors are pretty interesting for our smart device, as they are easily accessible without modifying the controller.
With the help of the connectors for a key switch, it should be possible to control the gate. There are two inputs for a key switch with two contacts each. If both contacts are connected, the controller starts the corresponding action. The first input “Impuls” opens/stops/closes both wings of the gate, the second input “Gehtür” (german for pedestrian gate) only opens/stops/closes one of the wings. To simulate the connection of both contacts a key switch would make, we are going to use an optocoupler. This gives us the possibility to control the gate. What is left is monitoring the state of the gate
Monitoring the gate
After investigating how the controller operates, it seems like the controller only takes an educated guess, of whether the gate is opened or closed. It does that by monitoring the current both motors take. If the current drops, the motor has stopped and reached it’s final position, if the current rises, the gate probably ran into an obstacle. Monitoring the motor current is not an option, since grabbing the corresponding signal would require modifying the controller itself. Instead, I am going to use one of the following methods:
Method 1: Monitoring the motor supply polarity
Both motors are controlled by applying a positive or negative voltage of 24V to them. Depending on the polarity, the motor will open or close until it reaches an end stop. Knowing the polarity of the motor supply would give us information on whether the gate is opening or closing. Since each open/close process should take approximately the same time, we can determine if the gate was fully opend/closed or not.
Method 2: Reed Sensor
To eliminate the guesswork, we could also use a reed sensor to determine if the gate if closed or not. This probably is the most reliable method.
As this project is not finished yet, I will update this post with further information as soon as I made progress