Home Assistant Sommer Pro+ / Base+ Garage Door Opener
This is my version of the excellent garage_pi project by Daniel that uses a WeMos D1 mini instead of a Raspberry Pi Zero.
The project is available here:https://github.com/jampez77/garage_door_sensor/releases
Prerequisites
Software
- Arduino IDE - I’m using v1.8.12
- Arduino JSON - v6.15.1
- PubSubClient - v2.7.0
- ESP8266WiFi
- ArduinoOTA
Hardware
- Sommer Pro+ / Base+
- Sommer Conex Adapter
- Sommer Output OC Adapter
- Wemos D1 Mini
- 1 Channel Relay Shield
- A 24V to 12v USB Power Adaptor
- Wemos D1 Mini Relay Case
Setup
Flashing project to the WeMos
Once you have setup your software, you first need to download this project, by clicking clone -> Download ZIP
.
Unzip the file and navigate to the contents. you should see a file named My_Helper_sample.h
, go ahead and rename it to My_Helper.h
.
Now open garage_door_sensor.ino
. Doing so should open it in the Arduino IDE.
You do not need to make any changes to the garage_door_sensor
script itself!
Click on the My_Helper.h
tab, that is where you will add your WiFi credentials for your home network & your MQTT details.
Wiring
You will need to solder a wire to G
and A0
on the bottom of the D1 Mini. Plug these into the GND
and OUT
pins on the Output OC PCB respectively.
Connect the relay to the Sommer Conex PCB. The NO
terminal should connect to T1
on the Conex, NC
to T2
, with COM
terminal connecting to the centre pin.
Finally the USB power Adapter needs to be plugged into the 24v
and Ground
of the Sommer circuit board.
Upload
The next step, once you’re happy with the details is to upload the project to the Wemos D1 Mini.
To do that you select Tools
from the top menu within the IDE.
Then you need to set the upload parameters to the following;
The next step is to simply plug your device in the computer, Go to Tools -> Port
and select it.
For me this usually says something dev/usbserial...
You will only need the device plugged in on your first upload, after that you should see your devices name and it’s IP address in the port list.
Now you just click on the upload button in the top left corner of the IDE, it’s the right-facing arrow.
After a bit of time compiling, the script should be uploaded to the device and begin scanning for the car.
You can see what the device is doing by going to Tools -> Serial Monitor
If the upload doesn’t work the most likely cause is that you forgot to rename the My_Helper_sample.h
file or import the above libraries.
Integrating with Home Assistant
The simplest way to integrate with Home Assistant is to turn on MQTT discovery. With this activated the device will be added automatically.
Alternatively you can add a new cover
to the configuration.yaml
like this:
cover:
- platform: mqtt
name: Garage Door
command_topic: "garage/door/output"
state_topic: "garage/door"
state_open: "open"
state_opening: "opening"
state_closed: "closed"
state_closing: "closing"
payload_open: "OPEN"
payload_close: "CLOSE"
qos: 1
optimistic: true
device_class: garage
Here is what the final project looks like for me now: