Makerapi Hoobs Bridge Errors

First post - long time lingerer, stubborn enthusiast.

After finally dialing in 35 new devices on HE, I decided to bring these into Homekit via HOOBS, utilizing the Makerapi bridge. Everything ported into Homekit just fine, and I can control the devices, however I am seeing all red errors within Hoobs Logs, unit: null, data:null. So it appears I have one way connection to homekit, but not reporting back to the app. Everything is running on port 20011 by default.

When going to the debugging screen {IP address}:20011/event, I receive the following error which I think confirms my suspicions "Sorry, but there is some problem with your connection or the server is down."

Any help is very greatly appreciated. I am a bit stuck.

Is this the same problem that you are seeing?

1 Like

Yep. It seems like it to me. I’m at a loss. It’s not a makerapi problem because when I hit the maker api with curl and set a post url it works correctly. I’m also able to use makerapi nodered without issue.

These two repositories are related to some extent, and my belief is that there is some bug in the way port numbers are being calculated that I’ve tripped on — a race condition of some sort I’d bet. I ran this for well over a year without issue but now it doesn’t work at all.

Frustratingly neither author seems to have any interest in merging pull requests so I don’t think I’m going to even jump into the code, it’s a mess.

Appreciate the response. Yep - this appears to be it. By 3am last night, I landed on it being port related. I initially thought I had some sort of a port open/closed issue in the unifi network, but after reading your logs and matching these up, we're in the same boat. I wish a form of port forwarding would fix this, but at last, It will not.

That's really unfortunate that the authors will not merge in a request. Are we SOL or perhaps there's another solution out there outside of makerapi. I would have thought more people would have run into this issue.

1 Like

Unfortunately I’ve witnessed this same bug in the tonesto homebridge setup as well. Your mileage may vary.

There seems to be some preference for running the Oznu package as opposed to HOOBS. I've always run the Oznu version and have never had an issue.

1 Like

Same, but I know there are others here using HOOBS, so I'm not sure why this issue hasn't been encountered more widely.

1 Like

I’ve never heard of ONZU, I just run homebridge natively on an ancient Mac mini. No fancy installers or kits required.

I've been running Onzu's Homebridge UI for over two years now without any bridge errors or port issues. I started with dan.t's Hubitat MakerAPI App and then moved to Homebridge Hubitat v2.0 when it was released. During the transition I was also running both apps side by side without any issues.

I don't think the bridge errors or port issues are being caused by either Homebridge app or you would see a lot more people complaining.

Here's a link to Oznu's UI

1 Like

Oh, I’m running Homebridge UI to monitor and control homebridge. Previous to using H-UI (aka ONZU), I was just running it as a launchd service directly and had no issues. I don’t believe the problem is with H-UI, but with a recent release of the node package.

1 Like

If it's a node issue then have you considered running it in a Docker container? The Oznu distribution has an official one.

1 Like

What version of node.js are you running?

1 Like

Good question, I should have lead with that on my original posts.

macOS
Nodejs 17.0.1
├── homebridge-config-ui-x@4.41.3
├── homebridge-hubitat-makerapi@0.4.15
├── homebridge@1.3.8

Interesting idea. Happy to give it a whirl this week.

I’m running 16.3.1. with npm version 8.12 on an old iMac running El Capitan.

FYI, homebridge doesn’t support odd versions of nodejs.

3 Likes

Thanks for the reminder. In digging into this I found the problem. I don't think the problem is node17, but it's possible.

My problem was, I had two launch daemons running homebridge on my mac, and that's why the port number being logged in Hubitat was different (and off by one) from the port number being shown in homebridge -- I was looking at the wrong homebridge process.

And since HomeKit runs over Bonjour networking, they were probably intercepting each others messages and fighting in other ways too.

I detected the vestigial LaunchAgent plist in ~/Library/LaunchAgents when I looked for the homebridge-ui-x page after I did hb-service stop. I found that hb-service was launching homebridge-ui-x on port 8581 and the plist I had in place from several years-old homebridge config was launching it on 8080.

A few generations ago, the best way to have homebridge running on a mac as a daemon was to manually construct a plist and register it as a LaunchAgent. Then HOOBS came around and I never tried it, but now homebridge-ui-x is the new shiny.


Along the way I used brew to update nodejs from v10.x and it went all the way to v17. I backed it out using this sequence:

  • brew uninstall node
  • brew install node@16 -- node will forever be pinned at version 16 until I manually update it.
  • npm update -g npm
  • hb-service rebuild --all
  • hb-service uninstall
  • hb-service install --port=8080

After removing the LaunchAgent and asking hb-service to reconfigure the new LaunchDaemon, all is working!

3 Likes

Awesome to hear, thanks for updating!

Unfortunately I am running a native HOOBS box; the encapsulated, glorified, pi in a box. I must have another culprit. Glad to hear you figured this out.