[RELEASE] Homebridge Hubitat v2.0

So I have an issue that just cropped up.. For all my hubs - C-4, C-5, & C-7 I tried to add child instances of HBv2 and got this:

[3/8/2021, 9:45:15 AM] Error: Cannot add a bridged Accessory with the same UUID as another bridged Accessory: ef0aba9a-4ac0-435f-bb67-8fb2b092ce2d
    at Bridge.Accessory.addBridgedAccessory (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Accessory.ts:563:15)
    at /usr/lib/node_modules/homebridge/src/bridgeService.ts:326:19
    at Array.filter (<anonymous>)
    at BridgeService.restoreCachedPlatformAccessories (/usr/lib/node_modules/homebridge/src/bridgeService.ts:283:69)
    at Server.start (/usr/lib/node_modules/homebridge/src/server.ts:128:24)

I had no devices selected except one switch on the C-7 and HSM turned off (originally got a conflict there as well).

HB would not restart. I first rebooted the server to see if there was anything cached but no go. I had to remove all instances. Interestingly this does not seem to happen if I add multiple instances using only one hub. Do I need to change something in the config for this to work?

To report back - After messing around with this a bit I found that the issue was not initializing "turning on" the child bridge entries in the "bridge settings". I added each back one at a time and made sure it was turned on before adding the next. This seemed to solve that issue.. Now am getting this error "EADDRINUSE" for port 8000 which seems like a websocket thing.

[3/8/2021, 1:45:43 pm] [Hubitat-C5] INFO: Homebridge Version: 2.7
[3/8/2021, 1:45:43 pm] [Hubitat-C5] INFO: Hubitat-v2 Plugin Version: 2.4.1
[3/8/2021, 1:45:43 pm] [Hubitat-C5] INFO: Checking Package Version for Updates...
Preparing Advertiser for 'Hubitat-C5 0FCE' using ciao backend!
[3/8/2021, 1:45:43 pm] [Hubitat-C5] INFO: Fetching Hubitat-v2 Devices. NOTICE: This may take a moment if you have a large number of devices being loaded!
[3/8/2021, 1:45:43 pm] [Hubitat-C5] GOOD: Refreshing All Device Data | Source: (First Launch)
Starting to advertise 'Hubitat-C5 0FCE' using ciao backend!
[3/8/2021, 1:45:43 PM] Homebridge v1.3.2 (Hubitat-C5) is running on port 34028.
[3/8/2021, 1:45:43 pm] [Hubitat-C4] INFO: Homebridge Version: 2.7
[3/8/2021, 1:45:43 pm] [Hubitat-C4] INFO: Hubitat-v2 Plugin Version: 2.4.1
[3/8/2021, 1:45:43 pm] [Hubitat-C4] INFO: Checking Package Version for Updates...
[3/8/2021, 1:45:43 pm] [Hubitat-C7] INFO: Homebridge Version: 2.7
[3/8/2021, 1:45:43 pm] [Hubitat-C7] INFO: Hubitat-v2 Plugin Version: 2.4.1
[3/8/2021, 1:45:43 pm] [Hubitat-C7] INFO: Checking Package Version for Updates...
[3/8/2021, 1:45:43 pm] [Hubitat-C5] NOTICE: Temperature Unit is Now: (F)
[3/8/2021, 1:45:43 pm] [Hubitat-C5] NOTICE: Updating Global Values | HubIP: 10.10.3.90 | UsingCloud: false
[3/8/2021, 1:45:43 pm] [Hubitat-C5] WARN: Devices to Remove: (0) []
[3/8/2021, 1:45:43 pm] [Hubitat-C5] INFO: Devices to Update: (0)
[3/8/2021, 1:45:43 pm] [Hubitat-C5] GOOD: Devices to Create: (0) []
[3/8/2021, 1:45:43 pm] [Hubitat-C5] ALERT: Total Initialization Time: (0 seconds)
[3/8/2021, 1:45:43 pm] [Hubitat-C5] NOTICE: Unknown Capabilities: []
[3/8/2021, 1:45:43 pm] [Hubitat-C5] INFO: Hubitat DeviceCache Size: (0)
[3/8/2021, 1:45:43 pm] [Hubitat-C5] INFO: WebServer Initiated...
[3/8/2021, 1:45:43 pm] [Hubitat-C5] INFO: Sending StartDirect Request to Hubitat | UsingCloud: (false)
[3/8/2021, 1:45:43 pm] [Hubitat-C5] INFO: Direct Connect Active | Listening at 10.10.3.96:8000
Preparing Advertiser for 'Hubitat-C4 FEA9' using ciao backend!
[3/8/2021, 1:45:43 pm] [Hubitat-C4] INFO: Fetching Hubitat-v2 Devices. NOTICE: This may take a moment if you have a large number of devices being loaded!
[3/8/2021, 1:45:43 pm] [Hubitat-C4] GOOD: Refreshing All Device Data | Source: (First Launch)
Starting to advertise 'Hubitat-C4 FEA9' using ciao backend!
[3/8/2021, 1:45:43 PM] Homebridge v1.3.2 (Hubitat-C4) is running on port 56524.
[3/8/2021, 1:45:43 PM] [Ring] Configuring 3 cameras and 8 devices for location "Haddonfield" - locationId: dr4dum-2iqam-0
[3/8/2021, 1:45:44 pm] [Hubitat-C5] INFO: Hubitat-v2 Hub Communication Established
[3/8/2021, 1:45:44 pm] [Hubitat-C5] INFO: Hubitat-v2 Hub Communication Established
[3/8/2021, 1:45:44 pm] [Hubitat-C5] INFO: Hubitat-v2 Hub Communication Established
[3/8/2021, 1:45:43 pm] [Hubitat-C4] NOTICE: Temperature Unit is Now: (F)
[3/8/2021, 1:45:43 pm] [Hubitat-C4] NOTICE: Updating Global Values | HubIP: 10.10.3.93 | UsingCloud: false
[3/8/2021, 1:45:43 pm] [Hubitat-C4] WARN: Devices to Remove: (0) []
[3/8/2021, 1:45:43 pm] [Hubitat-C4] INFO: Devices to Update: (0)
[3/8/2021, 1:45:43 pm] [Hubitat-C4] GOOD: Devices to Create: (0) []
[3/8/2021, 1:45:43 pm] [Hubitat-C4] ALERT: Total Initialization Time: (0 seconds)
[3/8/2021, 1:45:43 pm] [Hubitat-C4] NOTICE: Unknown Capabilities: []
[3/8/2021, 1:45:43 pm] [Hubitat-C4] INFO: Hubitat DeviceCache Size: (0)
[3/8/2021, 1:45:43 pm] [Hubitat-C4] INFO: WebServer Initiated...
[3/8/2021, 1:45:44 pm] [Hubitat-C4] INFO: Sending StartDirect Request to Hubitat | UsingCloud: (false)
[3/8/2021, 1:45:44 pm] [Hubitat-C4] ERROR: uncaughtException: listen EADDRINUSE: address already in use :::8000
Error: listen EADDRINUSE: address already in use :::8000
    at Server.setupListenHandle [as _listen2] (net.js:1318:16)
    at listenInCluster (net.js:1366:12)
    at Server.listen (net.js:1452:7)
    at Function.listen (/usr/lib/node_modules/homebridge-hubitat-tonesto7/node_modules/express/lib/application.js:618:24)
    at /usr/lib/node_modules/homebridge-hubitat-tonesto7/src/HE_Platform.js:266:24
    at new Promise (<anonymous>)
    at HE_Platform.WebServerInit (/usr/lib/node_modules/homebridge-hubitat-tonesto7/src/HE_Platform.js:260:16)
    at /usr/lib/node_modules/homebridge-hubitat-tonesto7/src/HE_Platform.js:134:22
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
Preparing Advertiser for 'Hubitat-C7 CA7D' using ciao backend!
[3/8/2021, 1:45:43 pm] [Hubitat-C7] INFO: Fetching Hubitat-v2 Devices. NOTICE: This may take a moment if you have a large number of devices being loaded!
[3/8/2021, 1:45:43 pm] [Hubitat-C7] GOOD: Refreshing All Device Data | Source: (First Launch)
Starting to advertise 'Hubitat-C7 CA7D' using ciao backend!
[3/8/2021, 1:45:43 PM] Homebridge v1.3.2 (Hubitat-C7) is running on port 49701.
[3/8/2021, 1:45:44 pm] [Hubitat-C7] NOTICE: Temperature Unit is Now: (F)
[3/8/2021, 1:45:44 pm] [Hubitat-C7] NOTICE: Updating Global Values | HubIP: 10.10.3.97 | UsingCloud: false
[3/8/2021, 1:45:44 pm] [Hubitat-C7] WARN: Devices to Remove: (0) []
[3/8/2021, 1:45:44 pm] [Hubitat-C7] INFO: Devices to Update: (0)
[3/8/2021, 1:45:44 pm] [Hubitat-C7] GOOD: Devices to Create: (1) [ 'Back Porch Light' ]
[3/8/2021, 1:45:44 pm] [Hubitat-C7] INFO: Added Device: (Back Porch Light | 168)
[3/8/2021, 1:45:44 pm] [Hubitat-C7] ALERT: Total Initialization Time: (0 seconds)
[3/8/2021, 1:45:44 pm] [Hubitat-C7] NOTICE: Unknown Capabilities: []
[3/8/2021, 1:45:44 pm] [Hubitat-C7] INFO: Hubitat DeviceCache Size: (1)
[3/8/2021, 1:45:44 pm] [Hubitat-C7] INFO: WebServer Initiated...
[3/8/2021, 1:45:44 pm] [Hubitat-C7] INFO: Sending StartDirect Request to Hubitat | UsingCloud: (false)
[3/8/2021, 1:45:44 pm] [Hubitat-C7] ERROR: uncaughtException: listen EADDRINUSE: address already in use :::8000
Error: listen EADDRINUSE: address already in use :::8000
    at Server.setupListenHandle [as _listen2] (net.js:1318:16)
    at listenInCluster (net.js:1366:12)
    at Server.listen (net.js:1452:7)
    at Function.listen (/usr/lib/node_modules/homebridge-hubitat-tonesto7/node_modules/express/lib/application.js:618:24)
    at /usr/lib/node_modules/homebridge-hubitat-tonesto7/src/HE_Platform.js:266:24
    at new Promise (<anonymous>)
    at HE_Platform.WebServerInit (/usr/lib/node_modules/homebridge-hubitat-tonesto7/src/HE_Platform.js:260:16)
    at /usr/lib/node_modules/homebridge-hubitat-tonesto7/src/HE_Platform.js:134:22
    at processTicksAndRejections (internal/process/task_queues.js:93:5)

Okay to respond back once more - apologies for clogging up the thread. The answer is adding "direct_port" to each of your platform entries in "JSon Config"...

I added these and when I saved/restarted HB everything was clean.

C5 Hub

    "direct_port": 8000,

C7 Hub

    "direct_port": 8001,

C4 Hub

    "direct_port": 8002,

Note: I'm still testing things.. but everything looks good so far. So to recap - make sure you turn on each platform child instance in bridge settings AND use "direct_port" for each platform entry to differentiate instances.

1 Like

Is there a way to map 'double tap' to a button exposed to HomeKit now with this support?
(Sorry if I missed this elsewhere, I did search for the question/answer)

yes if you add it to the double tap input in the hubitat app. Push, Held, Double tap are all supported

1 Like

@tonesto7, @jk12 I've done some more testing and discovered that the virtual switches are turning off in Homebridge only when the "off" was issued by a Hubitat rule. When I turn the switch off via a dashboard tile or the device page, the homebridge log indicates that an off event happened, but the state of the accessory does not change to off.

I've also noticed that when the virtual switch is turned off by a rule, it seems to cause a refresh of the accessory device states in HB (similar to the result I'm seeing when the accessory page is refreshed). Here is an example:

Two virtual switches Switch A and Switch B are setup in Homebridge v2 app.

  1. I turn on switch A via a dashboard tile, corresponding accessory in HB turns on
  2. I turn off switch A via a dashboard tile, HB log indicates an off event for Switch A; however, corresponding accessory in HB remains ON
  3. A Hubitat rule turns on Switch B, corresponding accessory in HB turns on
  4. Same Hubitat rule turns off Switch B, corresponding accessory in HB turns off; also, switch A turns off at the same time as Switch B

@tonesto7 - I have the debugging turned on for the plugin in HB, but I don't see any difference in the log entries when a switch gets turned on/off by a rule vs. manually by a dashboard tile.

Any ideas what may be causing this behavior or how to fix it? Thank you.

I'm not sure what to do with this. I have about 20+ virtual switches going into Homebridge and have never seen this behavior. All apps that subscribe to device events work off when the device driver emits an attribute update it's seen by the subscribing app which in this case is the homebridge hubitat app that relays it to the homebridge plugin.

Whenever I've seen issues with the state being incorrect in homekit I've checked the device in Hubitat and it's state was incorrect there.
I'm not guaranteeing it's the problem but I see device states out of sync more often then I should in hubitat.

This is my experience too. Seems it’s just when a rule triggers the off that the tile wil not update. Could it be a Hubitat bug instead of homebridge or plugin?

I replicated your testing and I'm not seeing this behavior either so I'm not sure what is wrong. However, I'm pretty sure that its not an issue with the app.

Screenshot

You might want to try creating a HomeBridge virtual switch and see if it does the same thing.

@Vettester you’re using a rule to toggle the virtual switch, correct?

I’ve been having this problem only recently, but it’s a rule on Home that changes a virtual switch in HE. I have no problems changing the switch in Home or Hubitat, as it syncs to the other just fine. Also, it’s my virtual presence switch and I’m not having problems with my wife’s or children’s presence switches (all iPhones). I’m on the latest ios beta and everyone else is on 14.4. I’m wondering what version others here are using that are having issues. I only went back to the beta so my watch could unlock my iPhone when I’m at work or out shopping with a mask on.

I tried it three ways, toggling it with a rule and using a tile within HomeKit and HomeBridge. I got the same results with all three methods.

I am using the same driver and I cannot get any of my RGBW lights to go white. They will go red, blue, etc but not white.

This past Saturday (3/6) I upgraded homebridge and plugins, that's when the accessories created by Hubitat-v2 stopped turning off in Homebridge. Before those upgrades the hubitat virtual switch would stay in sync with the HB accessory.

Earlier I had mentioned that Hubitat rules would successfully turn the HB accessory off, but now I'm seeing this is not true 100% of the time. I've just watched two rules run where the virtual switches turned off but the accessories stayed on - earlier today the accessories were turning off (same rule).

Not sure where to go at this point. 4-5 months ago I went down this path of using homebridge and various plugins to replace IFTTT. Maybe I should give IFTTT another chance.

Apologies on maybe a silly question - did you update your system and reboot your server? What version of Node.js are you running? Also are you running any child instances?

Here are my specs:
My HB is "v1.3.2" and Node is "v14.16.0".. am running on an RPi 4 with 4 GBs RAM and Ubuntu 64bit server edition. Also running Node-RED on same box.

Not sure it will make a difference of course...

I'm not sure which system you're referring to - I upgraded homebridge to 1.3.2 and about 9 different plugins. The server (rpi) has been rebooted several times since the upgrade.

  • Hubitat App Version: v2.4.1
  • Homebridge Plugin Version: v2.4.1
  • Homebridge Version: 1.2.5, 1.3.2 (tried both versions)
  • NodeJS Version: 13.11.0

No child instances.

Sorry meant the HomeBridge server...well I'm confuzzled :thinking:, wish I had more / better advice to give.

If it matters, think our issue sounds very similar if not the same, and I'm not using Node. I'm on synology w/docker container for homebridge.

Seems this actually is more than just "cosmetic" for me as it throws off certain logic with the state inaccurately represented. It's very strange that refreshing the homebridge accessories pages causes the tile to properly refresh/update. I've no idea where to even look since the logs reveal everything looks as expected. It just doesn't work tho.

Our problems are identical from what I’ve read. I’m using a raspberry pi w/ homebridge, no docker, no synology. Did your problems start after upgrading homebridge to 1.3.x?

I’m afraid I have never encountered this. If you add a group device to Home are you able to set color temp? It’s like you have the rgb driver.