OpenGarage › Forums › OpenGarage Firmware › MQTT Help
Tagged: MQTT, OpenGarage
- This topic has 12 replies, 5 voices, and was last updated 5 years, 10 months ago by sirotkaslo.
-
AuthorPosts
-
March 20, 2018 at 12:46 pm #1081
atatistcheffParticipantI’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!
April 14, 2018 at 8:34 am #1122
atatistcheffParticipantBump, somebody (Ray?) must know something about MQTT in opengarage. After all, it is an option in the latest firmware. Anyone?
April 14, 2018 at 9:30 am #1123
atatistcheffParticipantBTW, 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?
April 14, 2018 at 9:03 pm #1124
qingzParticipantIs there a way to set username and password and port number for MQTT server?
June 2, 2018 at 2:40 pm #1160
RayKeymasterThe current OpenGarage firmware (1.0.8) has MQTT support. Did you try it out?
June 2, 2018 at 6:31 pm #1161
atatistcheffParticipantYes, 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?
June 9, 2018 at 10:28 am #1169
RayKeymasterI 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.
July 6, 2018 at 6:08 am #1210
spikebikeParticipantI 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.
July 6, 2018 at 6:13 am #1211
spikebikeParticipantSorry, it works, I cut/paste from one of the web pages and managed to get some unicode character instead of double quotes.
July 6, 2018 at 8:30 pm #1214
spikebikeParticipantCan 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”?
July 6, 2018 at 8:40 pm #1215
spikebikeParticipantSorry 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 OPENVery 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).
July 15, 2018 at 2:03 am #1221
RayKeymasterYes, 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.
November 25, 2018 at 1:23 pm #1334
sirotkasloParticipantHi,
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 5 years, 10 months ago by sirotkaslo.
-
AuthorPosts
- You must be logged in to reply to this topic.
OpenGarage › Forums › OpenGarage Firmware › MQTT Help