OpenGarage Forums OpenGarage Firmware MQTT and home assistant

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #1872

    idxman01
    Participant

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

    idxman01
    Participant

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

    #1875

    idxman01
    Participant

    Issue #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?

    #2012

    Anonymous
    Inactive

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

    #2042

    Mr_Flibble
    Participant

    I 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)

    #2043

    idxman01
    Participant

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

    #2047

    Mr_Flibble
    Participant

    I 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

    #2056

    jagos
    Participant

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

    #2057

    Mr_Flibble
    Participant

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

    jagos
    Participant

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

    Mr_Flibble
    Participant

    Ok, 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.

    #2065

    jagos
    Participant

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

Viewing 12 posts - 1 through 12 (of 12 total)
  • You must be logged in to reply to this topic.

OpenGarage Forums OpenGarage Firmware MQTT and home assistant