Skip to content

Instantly share code, notes, and snippets.

@albertcard
Last active March 8, 2024 18:48
Show Gist options
  • Save albertcard/c4930f6975daa37b9f66b90b5cfd7cc8 to your computer and use it in GitHub Desktop.
Save albertcard/c4930f6975daa37b9f66b90b5cfd7cc8 to your computer and use it in GitHub Desktop.
HomeAssistant + MQTT + Ratgdo with Genie 2028 Garage Door Opener

HomeAssistant + MQTT + Ratgdo w/ Genie 2028 Garage Door

Create HomeAssistant Components

  1. Launch a HomeAssistant container and go through the setup
docker run -d \
  --name homeassistant \
  --restart=always \
  -v /data/homeassistant:/config \
  -v /run/dbus:/run/dbus:ro \
  -v /var/run/docker.sock:/var/run/docker.sock \
  --network=host \
  homeassistant/home-assistant:latest
  1. Launch an MQTT container and go through the setup
docker run -d \
  --name=mqtt \
  -p 1883:1883 \
  -p 0.0.0.0:9001:9001 \
  -v /data/mosquitto/config:/mosquitto/config \
  -v /data/mosquitto/data:/mosquitto/data \
  -v /data/mosquitto/log:/mosquitto/log \
  --restart always \
  eclipse-mosquitto:latest
  1. Login to MQTT container and generate an MQTT user/pass file and exit MQTT container (you'll need this info later)
$ docker exec -it mqtt sh
$ cd /mosquitto/config/
$ mosquitto_passwd pwfile <username> <password>
$ exit
  1. Create an MQTT config
$ vi /data/mosquitto/config/mosquitto.conf
allow_anonymous false
listener 1883
listener 9001
protocol websockets
persistence true
password_file /mosquitto/config/pwfile
persistence_file mosquitto.db
persistence_location /mosquitto/data/
socket_domain ipv4
  1. Restart the MQTT container
$ docker restart mqtt
  1. In HomeAssistant navigate to 'Settings' > 'Devices & Services' and 'Add Integration' and add 'MQTT'
  - Broker: <IPofHostWhereMQTTContainerIS>
  - Port: 1883
  - Username: <mqttusername>
  - Password: <mqttpaddword>
  - ClientID: <leave empty>
  - Time between sending keep alive: 60 seconds
  - Use a client certificate: disabled
  - Ignore broker certification validation: enabled
  - MQTT Protocol: 3.1.1
  - MQTT Transport: TCP
  - Enable Discovery: enabled
  - Discovery Prefix: homeassistant
  - Enable birth message: enabled
  - Birth message topic: homeassistant/status
  - Birth message payload: online
  - Birth message QoS: 0
  - Birth message retain: disabled
  - Enable will message: enabled
  - Will message topic: homeassistant/status
  - Will message payload: offline
  - Will message QoS: 0
  - Will message retain: disabled

Flash the Ratgdo Firmware

  1. Connect Ratgdo to Macbook with USB

  2. With Google Chrome, go to Website, scroll down to MQTT and select drop-down for flashing 'ratgdo v2.57, Security +1.0, 2.0 & Dry Contact'

  3. Configure Wifi on Ratgdo

  4. Navigate to the IP of the Ratgdo in the browser and login (configure password)

  5. Set the following settings on ratgdo, save and reboot:

  - Device Name: ratgdo
  - Password: <ratgdopassword>
  - IP Address: <staticIPofRatgdo>
  - SSID: <wifiSSID>
  - Password: <wifiSSIDPassword>
  - Enable MQTT: YES
  - MQTT Server IP: <IPofHostWhereMQTTContainerIS>
  - MQTT Server Port: 1883
  - MQTT Server User: <mqttusername>
  - MQTT Server Pass: <mqttpassworde>
  - MQTT Topic Prefix: <leave_empty>
  - Home Assistant Discovery Prefix: homeassistant
  - Garage Door Control Protocol: Dry Contacts (beta testing)

Installing Ratgdo

  1. Buy the following items (additional to ratgdo kit)
  1. Cabling the Ratgdo to the Genie 2028 (we won't use the black cable supplied in the Ratgdo kit) PXL_20240308_180041962 PXL_20240308_180143372

  2. Cabling the Open/Close sensors (Reed Switches) to the Ratgdo

  • With door closed, mount one of the COM/NC/NO (this goes on rail) pieces next to the eachother (magnet with on moving chain) PXL_20240308_181426124 PXL_20240308_181448439 PXL_20240308_181630549

  • The other COM/NC/NO can be mounted on top like such PXL_20240308_181412057

  • Cabling the reed switches to the ratgdo looks like the following: Screenshot 2024-03-08 at 12 40 43 PM


Test it out in HomeAssistant

  1. Navigate to 'Settings' > 'Devices & Services' > 'MQTT' and you should see the 'ratgdo' Device

Screenshot 2024-03-08 at 12 43 13 PM

  1. Door Shut

Screenshot 2024-03-08 at 12 45 25 PM

  1. Door Open

Screenshot 2024-03-08 at 12 45 39 PM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment