OpenGarage › Forums › OpenGarage Firmware › MQTT and home assistant
Tagged: Home Assistant MQTT Mosquito
- This topic has 11 replies, 4 voices, and was last updated 5 years ago by jagos.
-
AuthorPosts
-
September 2, 2019 at 2:23 pm #1872
idxman01ParticipantOG has been working great with Blynk, but I’m not able to integrate with home assistant via MQTT. Admittedly I had to resolve a quirky network vlan issue, but it’s fine now.
I installed the core mosquito addon, temporarily allowed anonymous readwrite and tested pub/sub on my laptop on the same isolated ssid /vlan. (port 1883)
I don’t even see connection attempts in logs or packet captures. The code on GitHub looks straightforward and I’ve configured the HA IP and rebooted.
The OG component using http works, but I’d rather not poll it every 10s.
???
- This topic was modified 5 years, 3 months ago by idxman01.
September 2, 2019 at 11:00 pm #1874
idxman01ParticipantThis was a weird one. It started working and immediately sending mqtt traffic after I added a space after the IP. It was only 9 characters before the space.
September 3, 2019 at 6:01 pm #1875
idxman01ParticipantIssue #43 opened. I’ll do a pull request if I have a chance, but it appears there’s several other recent pulls involving mqtt. (#39 and 40 – which is awesome, I was looking at adding those as well.)
https://github.com/OpenGarage/OpenGarage-Firmware/issues/43
https://github.com/OpenGarage/OpenGarage-Firmware/pull/39
BTW, what is everyone doing with anonymous MQTT? Allowing readwrite to all topics or restricting anonymous connections to specific topics?
October 31, 2019 at 12:10 am #2012
AnonymousInactiveI have a forked build with all of the current Pull Request’s merged in (#39, #40, #41, and #42) and have been running it for a couple of months now, so I have decided to go ahead and post the build I am using!
I have versioned it at 1.2.0 for now and you can download it in the Compiled directory of my fork. If you don’t want to blindly flash a build I have created, you can always pull down my fork and build it yourself! Just make sure to compile the
build
branch (I created my first Pull Request before I anticipated making more changes, so I had to merge all of these changes together in another branch)I plan to work on setting up Home Assistant auto-discovery of OpenGarage devices through MQTT next.
November 20, 2019 at 10:47 pm #2042
Mr_FlibbleParticipantI am having some unusual behavior with MQTT and OpenGarage. I am using home assistant, and it works fine. Currently, I am using the OpenGarage component where it polls every 10 seconds, which is less than ideal.
When I add the IP for my MQTT server, OpenGarage goes “crazy”.
What I mean by crazy, is that the web polling portion ceases to function, and my ability to control it through home assistant vanishes, and it appears offline. Furthermore it forgets all of its settings, and comes back “blank”. It then functions intermittently until I hard reset it and go through the adoption process again.
I would assume this is a one off, but I have 3 of these devices, and I have a large number of devices using MQTT today without issue.
Currently, this is on firmware 1.0.9, so my next step is upgrading.
Has anyone got MQTT working with these and the Home Assistant control portion? (Works just fine as long as I don’t try to enable MQTT)
November 21, 2019 at 1:28 pm #2043
idxman01ParticipantI am still running the http-based OpenGarage HA module and MQTT. Both are working, so I’d definitely upgrade to at least 1.1.1. Mine has been going “crazy” the last 2 days for some reason, though it’s the distance sensor flipping back and forth so it thinks the door is opening all the time. I don’t think this is related to mqtt, but I’m going to disable that for now to test.
November 21, 2019 at 3:03 pm #2047
Mr_FlibbleParticipantI just tested 1.1.0
It suffers the same issues as 1.0.9
When I define an MQTT server, the polling stops functioning correctly. However, this time the interface was stable enough for me to reset the IP of the MQTT server to the following:
-.-.-.-
Doing this, the system recovers and works in Home Assistant with Polling again.I don’t know where I can locate higher firmware versions than 1.1.0
November 22, 2019 at 9:05 pm #2056
jagosParticipantAt https://github.com/OpenGarage/OpenGarage-Firmware/tree/master/Compiled change the branch to dev-1.1.1 to have access to this version.
I do not understand why 1.1.1 has not been properly released.
November 27, 2019 at 6:55 pm #2057
Mr_FlibbleParticipantGot onto the Dev branch, and got v. 1.1.1; but it has exactly the same issues as the other versions.
As soon as I define an MQTT Server IP, the system implodes.
If the screenshots I took upload properly, you can see where I am preparing to save the MQTT server target (am I missing the port? Is that required? I need better docs on this)
The next two screenshots show how the interface begins to freeze as the system goes off the rails (I am going to have to go back out to the garage now and hard-reset it).
Attachments:
You must be logged in to view attached files.November 27, 2019 at 11:36 pm #2062
jagosParticipantI have MQTT working though I am still on 1.1.0. I just put in the IP addr and that is it. I run the MQTT server on a local linux box on a different subnet. I have Door Open and Close checked as well as Notify me for both Open longer than 10 and at UTC time 0. I have witnessed messages for all of those cases.
I do not use IFTTT nor Blynk though the Blynk domain and port were set by default and I did not change that.
No idea what your problem is but I have included an image of my integration page.
Attachments:
You must be logged in to view attached files.November 28, 2019 at 5:28 pm #2064
Mr_FlibbleParticipantOk, I found the problem. Obvious really, but so is any problem like this until you know the answer.
I installed Mosquito MQTT on Home Assistant through the GUI add-on tool, set it up, and set up most of my MQTT devices, and they all worked just fine.
When I tried to connect the Open Garage Units (I have 3 of them) they all started having the issues described above.
The MQTT log showed multiple entries of:
New connection from 192.168.1.161 on port 1883.
Socket error on client <unknown>, disconnecting.
New connection from 192.168.1.161 on port 1883.
Socket error on client <unknown>, disconnecting.
New connection from 192.168.1.161 on port 1883.
Socket error on client <unknown>, disconnecting.Not really obvious what was going wrong.
I thought first it was the way Home Assistant handled the looping from some github posts. But wasn’t it at all.
How I solved it:
I intentionally gave one of my Open Garage devices the wrong IP address for MQTT. It continued to operate normally, and Home Assistant could see it. There was no slowdown in the web interface.
Looking more closely at the MQTT side of the house I found the problem:
}
],
“anonymous”: false,
“customize”: {
“active”: false,
“folder”: “mosquitto”
},As soon as I realized that the default behaviour of Mosquito is “anonymous”: false I realized my mistake.
Setting “anonymous”: true, fixed the issue immediately.
Obvious in hindsight, but I am posting all the gory details here in case someone else with Open Garage and Home Assistant runs into the same problem, then they can google for my idiocy and fix their issue.
November 28, 2019 at 5:37 pm #2065
jagosParticipantGood that you found the problem. But the OG’s should not mess up like that when the server rejects the connection.They should display a useful error message in the Integration page and retry periodically.
-
AuthorPosts
- You must be logged in to reply to this topic.
OpenGarage › Forums › OpenGarage Firmware › MQTT and home assistant