OpenGarage Forums OpenGarage Firmware MQTT Help Reply To: MQTT Help

#1169

Ray
Keymaster

I realized the documentation doesn’t contain any information about MQTT. We are working to add this information. In the meantime, here is a quick tutorial. First, you should install mqtt, say on your Linux computer, by following:
https://www.vultr.com/docs/how-to-install-mosquitto-mqtt-broker-server-on-ubuntu-16-04
you only need to read up to Step 2, because that explains the basics of how MQTT works (including pub and sub).

Then, once you have a mqtt server, you should go to OpenGarage Settings -> Integration, and type in the mqtt server IP.

In the OpenGarage firmware, it primarily uses MQTT for sending notifications. For example, when the door opens or closes, the following line:
https://github.com/OpenGarage/OpenGarage-Firmware/blob/master/OpenGarage/main.cpp#L843
sends out a MQTT message with the topic “your_opengarage_name/OUT/NOTIFY”, where your_opengarage_name is the name of your OpenGarage (which you can change in Edit Options). For example, if my OpenGarage has a name RaysOG, you should have a MQTT subscriber that subscribes to the topic RaysOG/OUT/NOTIFY.

The firmware also sends the current state of the door to topic “your_opengarage_name/OUT/STATE”. So if you subscribe to that topic, you will get messages about the current state.