Broke my Homebridge Integration

Hi everyone!

I'm a recent ST convert as of last week. Ordered HE to test and 12 hours later there are no devices on my ST hub anymore...ha ha!

well, I've screwed something up with my Homebridge setup and I cannot figure it out. Any advice?

It was working as of last night, but I was trying to figure out how to setup AlexaCookieNodeJs on my pi and might have screwed with my Homebridge setup...
I'm fairly new to all this...as you can tell, thanks in advance!

I notice 0.0.0.0:8005 <-- that can't be right.

You're using Tonesto7's version, which is fine, but it's known to add a burden to the hub. There's a Hubitat specific version now that put's no load on the hub. Instead of installing Tonesto7's app, you install a native Hubitat app called MakerAPI and then reconfig your rPi to use that version to listen to MakerAPI.

1 Like

I know. You can see the 10.0.1.15 address is my HE, so I don't know where the 0.0.0.0 is coming from.

I have read the the Homebridge app can be taxing of the HE hub. I like the idea of using the MakerAPI. I think I will make the switch!

Well....kinda the same issue!

Try using another port other than 80.


My Apache server is running on port 80.
You can check what ports are in use with, sudo netstat -tlnpu

The indication is, it knows your Hub's address but not it's own.

Try adding:
"local_ip" : "" <-- with your rpi's address.

you're not supposed to need it, but it also doesn't hurt (if done right) :slight_smile:

I was not sure exactly where to put it so I tired it in both platform and bridge with no change.

	"bridge": {
		"name": "Homebridge",
		"username": "REMOVEDMAC",
		"port": 51826,
		"pin": "011-30-880"
	},
	"platforms": [{
"platform": "Hubitat-MakerAPI",
"name": "Hubitat",
"app_url": "http://10.0.1.15/apps/api/97",
"access_token": "REMOVEDTOKEN",
"polling_seconds": 300,
"local_ip": "10.0.1.16",
"temperature_unit": "F",
"mode_switches": false,
"hsm": true
}]
}

ENETUNREACH is of course "network unreachable" and your rPi is unable to reach that IP apparently. I'm guessing this is the same rPi that worked for homebridge on ST but ST is a different address and I'm wondering if there's some firewall or firewall like function preventing traffic (reply) from that IP?

From your rPi you should be successful at:
curl 10.0.1.15/apps/api/97
You should get an instant json formatted data saying the token is bad.. LOL

maybe something like this:
<error_description>null</error_description>invalid_token

If you get a timeout, then you will want to track that down.

You are correct. I get an oauth token error.

I was not using Homebridge with ST (I was but I stoped it). This is a new setup from scratch with HE. It was working fine until I tried to setup the Pi as an Alexa Token server.

I don't know where I am going wrong...I formatted my Pi this morning and completed the following steps:

  • Reinstalled OS using NOOBS
  • Ran updates
  • Deleted MakerAPI app on HE, reinstalled
  • Updated config.json with new MakerAPI URL & Token
  • Installed homebridge
  • Installed homebridge-hubitat-makerapi
  • Configured Homebridge to run on startup via systemd

Still getting the following:

Here's my config.json file

	"bridge": {
		"name": "Homebridge",
		"username": "CC:22:3D:E3:CE:30",
		"port": 51826,
		"pin": "011-30-880"
	},
	"platforms": [{
		"platform": "Hubitat-MakerAPI",
		"name": "Hubitat",
		"app_url": "http://10.0.1.15/apps/api/129",
		"access_token": "this-is-my-token",
		"polling_seconds": 300,
		"temperature_unit": "F",
		"mode_switches": false,
		"hsm": true
	}]
}

I can curl http://10.0.1.15/apps/api/129/devices?access_token=this-is-my-token from my rPi and receive a response of devices.

I'm at a loss...

EDIT: I should add there is nothing hitting the HE logs for MakerAPI (except when I curl)

I've never used Homebridge MakerAPI til 5 mins ago.

I had a working Homebridge HubConnect running on my rPi.

Installed homebridge-hubitat-makerapi
I altered config.json to be:
"platforms": [
{
"platform": "Hubitat-MakerAPI",
"name": "HomebridgePi",
"app_url": "http://192.168.7.65/apps/api/4",
"access_token": "this-is-my-token",
"mode_switches": true
}
]

[5/27/2019, 10:36:09] [HomebridgePi hhm:0.2.8] Fetching Hubitat-MakerAPI devices. This can take a while depending on the number of devices are configured!
[5/27/2019, 10:36:09] [HomebridgePi hhm:0.2.8] Refreshing All Device Data
[5/27/2019, 10:36:09] Homebridge is running on port 51826.
[5/27/2019, 10:36:09] [HomebridgePi hhm:0.2.8] Received All Device Data 
[5/27/2019, 10:36:09] [HomebridgePi hhm:0.2.8] Loading Modes
[5/27/2019, 10:36:09] [HomebridgePi hhm:0.2.8] Processing Modes
[5/27/2019, 10:36:09] [HomebridgePi hhm:0.2.8] Device Added - Name Mode - Day, ID Day HomebridgePi
[5/27/2019, 10:36:09] [HomebridgePi hhm:0.2.8] Device Added - Name Mode - Evening, ID Evening HomebridgePi
[5/27/2019, 10:36:09] [HomebridgePi hhm:0.2.8] Device Added - Name Mode - Night, ID Night HomebridgePi
[5/27/2019, 10:36:09] [HomebridgePi hhm:0.2.8] Device Added - Name Mode - Away, ID Away HomebridgePi
[5/27/2019, 10:36:09] [HomebridgePi hhm:0.2.8] attempt connection to ws://192.168.7.65/eventsocket
[5/27/2019, 10:36:09] [HomebridgePi hhm:0.2.8] latest version on npmjs is 0.2.8
[5/27/2019, 10:36:09] [HomebridgePi hhm:0.2.8] your version of the plugin is up2date
[5/27/2019, 10:36:09] [HomebridgePi hhm:0.2.8] connection to ws://192.168.7.65/eventsocket established

You are definitely failing at the operating system TCP level.... this is not at the plugin level yet. I have never used noobs but do it use something like selinux?

No. I did just install a new Unifi gateway and switch on Friday when this stopped working....

Or are you running Homebridge in a docker image?

Running it on a rPi B+

I assume the Pi and Hubitat are on the same switch, correct? Are there any application level firewalls on the Unifi system that might block you? I would concentrate on the network layer to see if you can see any kind of blocking happening there right now

Same switch. No blocks that I know of.

If I can curl from the PI to HE, isn't it doing the same thing?

Not necessarily, an application level firewall can treat things differently. You are running Homebridge as a service / systemd, right? Have you tried not running it as a service and running it as the same user that you used for curl? You can just type “homebridge” and it will try to start. You might have to copy the config to that users home directory. Just tying to isolate where the problem might be...

Interesting results!

I can add the bridge to the Home app but no devices come over.

Never tried this version of Homebridge either, but you might try not using noobs. It can be problematic with Homebridge I recall reading somewhere.

You’re also dealing with a number of variables which is going the increase the difficulty in troubleshooting this. I too would not suggest systemd until you get this running correctly. Just makes it that much more difficult to see what’s going on. Maybe also take the Unifi out of the loop for now.