In our home, we have 2 garage doors with RF remotes in our cars. For most people, this is generally considered “good enough”. I wanted to come up with a way to connect our garage door openers to our home automation system. Doing so would have the added benefit of remote control from anywhere, especially if we are away. This could be useful so that deliveries could be placed in the garage, or for any other reason where we would want to allow someone access to the garage but not the rest of the house. Some folks have a code entry panel that serves this purpose but then you have to share that code and by doing so, can compromise security should the code be shared without your knowledge. With the ability to remotely open the garage, allows access without needing to share a credential.
This article makes the following assumptions:
- You already know how to flash Tasmota onto ESP8266 hardware
- You are familiar with Domoticz home automation console and adding devices
- You use some method of message transport ie. MQTT between Domoticz and your Tasmota powered hardware
View the following video to see a demo of how this works:
Since I already have an in-place home automation system, all I needed to do was configure two buttons on the console that would accept a pushbutton command and send a signal to a relay to open the door. For hardware, I used a dual relay board that has an esp8266 chip. The 8266 chip was flashed with the latest Tasmota release, and configured to operate the relays. The switch output of the relays is wired to the existing wall switches of the garage door so that when tripped, will cause the door to operate just as the physical wall buttons already do.
The Tasmota configuration uses the “Generic” template and configures GPIO0 to be Relay1, and GPIO2 to be Relay2. After setting the GPIOs, I had to enter some settings and a ruleset into the Tasmota Console on the ESP-01. To enable the ESP-01 to talk to the relay serial chip on the board, I had to go to the console and enter the following command and ruleset: (NOTE: some older versions of this dual relay board may use 9600 baud instead of the 115200 baud shown here.) Also, the dual relay board needs to operate in Mode 1 (default mode and indicated by a red LED on the board).
Rule1 on System#Boot do Backlog Baudrate 115200; SerialSend5 0 endon on Power1#State=1 do SerialSend5 A00101A2 endon on Power1#State=0 do SerialSend5 A00100A1 endon on Power2#State=1 do SerialSend5 A00201A3 endon on Power2#State=0 do SerialSend5 A00200A2 endon
Then to enable the above rule:
turns on rule1. Once enabled, I want to ensure that power disturbances do not trigger the relays or cause the ESP-01 to lose it’s config. To ensure that the relays stay OFF when there are power interruptions or power cycles, I needed to enter this command on the Tasmota Console:
I also wanted to make sure the config would remain intact even if there were several power cycles/disturbances (sometimes Tasmota can reset to defaults if there are more than 6 fast consecutive power cycles), so I also entered this command into the Tasmota Console:
Finally, we want the relays to only trigger momentarily when activated so that a pulse is registered to the garage door openers. To do that, we must enter two more commands on the Tasmota Console of the relay board:
PulseTime1 1 PulseTime2 1
Once these changes are set, all that is needed is to set the Domoticz IDX address to match the two pushbuttons that were added to the Domoticz console. At this point it should be possible to remotely trigger the relays from Domoticz and they will trigger ON for 1 second and then switch off when called via Domoticz. All that is left to do is wire the relay N.O. contacts to the physical garage door wall switches in the garage. It will now be possible to open or close the garage doors from the Domoticz console via any mobile device that has access to the Domoticz home automation console.