OpenGarage Forums OpenGarage Firmware MQTT Help

Tagged: ,

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #1081

    atatistcheff
    Participant

    I’m just getting started with MQTT on my Domoticz server and am looking for some help/pointers on getting the notifications working. I have mosquitto working for some Sonoff switches but am not seeing the opengarage devices communicate with my server at all. I’ve added the server IP to the integration page on the opengarage devices but looking at the mosquitto logs I see no contacts from the OG devices logged. What am I missing? Are there instructions for integration with Domoticz available anywhere?

    Thanks!

    #1122

    atatistcheff
    Participant

    Bump, somebody (Ray?) must know something about MQTT in opengarage. After all, it is an option in the latest firmware. Anyone?

    #1123

    atatistcheff
    Participant

    BTW, just to mention what I have done so far. I have a MQTT server (mosquitto) running and I’ve put that server’s IP into the MQTT field in opengarage. Running tcpdump I see no MQTT traffic to/from the opengarage device. I also tried ip:port (1883) and this produced the same result. I’m wondering if the MQTT feature is enabled?

    #1124

    qingz
    Participant

    Is there a way to set username and password and port number for MQTT server?

    #1160

    Ray
    Keymaster

    The current OpenGarage firmware (1.0.8) has MQTT support. Did you try it out?

    #1161

    atatistcheff
    Participant

    Yes, that is the crux of my question. I did try it out and nothing is happening. Is the extent of the support a field which says “MQTT Server”? Is there any other configuration? As I mentioned, I added my Mosquitto server’s IP to that field and the server logs show no communications from OpenGarage. Is there some kind of documentation for the use of MQTT with OpenGarage?

    #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.

    #1210

    spikebike
    Participant

    I was hoping for exactly this functionality, push based notifications without depending on an external cloud service.

    However I installed mosquitto and the mosquitto-clients, and named my device “myog” without quotes.

    From the command line I ran:
    $ mosquitto_sub -t “myog/OUT/STATE”

    In the mosquitto log I see:
    1530875249: New connection from 127.0.0.1 on port 1883.

    Then I point my OG at it and I see:
    1530874937: New connection from 192.168.3.101 on port 1883.
    1530874937: New client connected from 192.168.3.101 as myog (c1, k15).

    But when I open or close the door I don’t see any messages. I don’t think it’s a firewall since I’m successfully connecting.

    #1211

    spikebike
    Participant

    Sorry, it works, I cut/paste from one of the web pages and managed to get some unicode character instead of double quotes.

    #1214

    spikebike
    Participant

    Can OpenGarage be controlled by MQTT to open/close the door? What string to I publish to, something like <OG name>/OUT/STATE? What do I send as a message? “OPEN”?

    #1215

    spikebike
    Participant

    Sorry to answer my own question again. I read the source and open/close is supported.
    $ mosquitto_pub -m “Button” -t “myog/IN”

    I’m listening with MQTT in another window and sure enough:
    18:37:26 Garage door OPEN

    Very cool. So now I can control the door via web API or MQTT from anywhere on my network. Now to get something working with HTTPs and IPv6 (I’d rather not use someone else’s cloud).

    #1221

    Ray
    Keymaster

    Yes, as you have figured out, it does support control as well. Sorry that this is not well documented. We will add documentation to the user manual.

    #1334

    sirotkaslo
    Participant

    Hi,
    I’m using FW v.1.09 and can’t seem to get mqtt control to work. <OG name>/OUT/STATE with message button does nothing.

    also found this on github:

    ‘OGNAME/IN/STATE’ with a message of ‘close’ or ‘open’, it will trigger the door action. OGNAME is your OpenGarage device’s name (you can change it in Settings).

    out/notify does work.

    EDIT:
    It works after a restart! Thanks

    • This reply was modified 6 years ago by sirotkaslo.
Viewing 13 posts - 1 through 13 (of 13 total)
  • You must be logged in to reply to this topic.

OpenGarage Forums OpenGarage Firmware MQTT Help