Closed beorn closed 6 years ago
@beorn, Why did you put the platform in config.json three time?
Because I have 200+ devices and homekit only supports 100 devices per accessories, so I am using the workaround you suggested in #80 - each of the platform entries is for a different user that has a non-overlapping set of devices associated with them.
Does it works if you configure a platform at a time?
I can try it next week when I'm home again.
I can start up homebridge if I only include one of the platform entries, all of them work individually. But I always get Error getting data from Home Center: Error: Cannot add a bridged Accessory with the same UUID as another bridged Accessory
if I try to have more than one platform entry.
I'm not sure if that's what you meant by "configuring a platform at a time"?
Yes this is what I asked you. The UUID is calculate starting from the device name and room name and cannot be duplicated so in your case there at least one device shared by the three different accounts.
The devices that are reported as 'duplicated' shouldn't really be duplicated, at least not when I look in the Fibaro HC2 interface they are selected on a mutually exclusive basis between all the accounts. I have it set up so each account only selects devices from certain rooms, in a mutually exclusive basis. Any way I can troubleshoot further?
I never used multiple instances of a plugin on the same homebridge, so I don't know if it works. Try a simple configuration with only one device on each instance.
Okay, now I have a setup of 3 Fibaro HC2 users, as above, and each one has only 1 configured accessory. I get different results each time I run it, sometimes it'll initialize okay, sometimes it'll throw the error below - see log output from both cases, and my cachedAccessories and config.json files attached:
% homebridge
[2/6/2018, 1:39:38 PM] Loaded plugin: homebridge-fibaro-hc2
[2/6/2018, 1:39:38 PM] Registering platform 'homebridge-fibaro-hc2.FibaroHC2'
[2/6/2018, 1:39:38 PM] ---
[2/6/2018, 1:39:38 PM] Loaded config.json with 0 accessories and 3 platforms.
[2/6/2018, 1:39:38 PM] ---
[2/6/2018, 1:39:38 PM] Loading 3 platforms...
[2/6/2018, 1:39:38 PM] [Fibaro HC2 1] Initializing FibaroHC2 platform...
[2/6/2018, 1:39:38 PM] [Fibaro HC2 2] Initializing FibaroHC2 platform...
[2/6/2018, 1:39:38 PM] [Fibaro HC2 3] Initializing FibaroHC2 platform...
[2/6/2018, 1:39:38 PM] Loading 0 accessories...
[2/6/2018, 1:39:38 PM] [Fibaro HC2 3] Configured Accessory: 床灯 Ceiling TV
[2/6/2018, 1:39:38 PM] [Fibaro HC2 3] Configured Accessory: 插座1 Xmas Star
[2/6/2018, 1:39:38 PM] [Fibaro HC2 3] Configured Accessory: Ceiling Strip 1 new
Setup Payload:
X-HM://00240T6M66K52
Scan this code with your HomeKit app on your iOS device to pair with Homebridge:
[... QR code etc...]
[2/6/2018, 1:39:38 PM] [Fibaro HC2 1] didFinishLaunching.
[2/6/2018, 1:39:38 PM] [Fibaro HC2 2] didFinishLaunching.
[2/6/2018, 1:39:38 PM] [Fibaro HC2 3] didFinishLaunching.
[2/6/2018, 1:39:38 PM] Homebridge is running on port 6088.
[2/6/2018, 1:39:38 PM] [Fibaro HC2 1] Loading accessories
[2/6/2018, 1:39:38 PM] [Fibaro HC2 1] Error getting data from Home Center: Error: Cannot add a bridged Accessory with the same UUID as another bridged Accessory: d9bf51ba-fc27-42f0-a5b2-572e8bfd1436
at Bridge.Accessory.addBridgedAccessory (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Accessory.js:264:13)
at Bridge.Accessory.addBridgedAccessories (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Accessory.js:290:10)
at Server._handleRegisterPlatformAccessories (/usr/local/lib/node_modules/homebridge/lib/server.js:451:16)
at Server.<anonymous> (/usr/local/lib/node_modules/homebridge/lib/server.js:41:10)
at API.emit (events.js:160:13)
at API.registerPlatformAccessories (/usr/local/lib/node_modules/homebridge/lib/api.js:159:8)
at ShadowAccessory.resgisterUpdateAccessory (/usr/local/lib/node_modules/homebridge-fibaro-hc2/dist/shadows.js:87:17)
at FibaroHC2.addAccessory (/usr/local/lib/node_modules/homebridge-fibaro-hc2/dist/index.js:166:25)
at LoadAccessories.devices.map (/usr/local/lib/node_modules/homebridge-fibaro-hc2/dist/index.js:113:22)
at Array.map (<anonymous>)
[2/6/2018, 1:39:38 PM] [Fibaro HC2 3] Loading accessories
[2/6/2018, 1:39:38 PM] [Fibaro HC2 3] Added/changed accessory: 床灯 Ceiling TV
[2/6/2018, 1:39:38 PM] [Fibaro HC2 3] Remove accessory 插座1 Xmas Star
[2/6/2018, 1:39:38 PM] [Fibaro HC2 3] Remove accessory Ceiling Strip 1 new
[2/6/2018, 1:39:38 PM] [Fibaro HC2 2] Loading accessories
[2/6/2018, 1:39:38 PM] [Fibaro HC2 2] Added/changed accessory: Ceiling Strip 1 new
^C[2/6/2018, 1:39:41 PM] Got SIGINT, shutting down Homebridge...
% homebridge
[2/6/2018, 1:39:44 PM] Loaded plugin: homebridge-fibaro-hc2
[2/6/2018, 1:39:44 PM] Registering platform 'homebridge-fibaro-hc2.FibaroHC2'
[2/6/2018, 1:39:44 PM] ---
[2/6/2018, 1:39:44 PM] Loaded config.json with 0 accessories and 3 platforms.
[2/6/2018, 1:39:44 PM] ---
[2/6/2018, 1:39:44 PM] Loading 3 platforms...
[2/6/2018, 1:39:44 PM] [Fibaro HC2 1] Initializing FibaroHC2 platform...
[2/6/2018, 1:39:44 PM] [Fibaro HC2 2] Initializing FibaroHC2 platform...
[2/6/2018, 1:39:44 PM] [Fibaro HC2 3] Initializing FibaroHC2 platform...
[2/6/2018, 1:39:44 PM] Loading 0 accessories...
[2/6/2018, 1:39:44 PM] [Fibaro HC2 3] Configured Accessory: 床灯 Ceiling TV
[2/6/2018, 1:39:44 PM] [Fibaro HC2 3] Configured Accessory: 插座1 Xmas Star
[2/6/2018, 1:39:44 PM] [Fibaro HC2 3] Configured Accessory: Ceiling Strip 1 new
Setup Payload:
X-HM://00240T6M66K52
Scan this code with your HomeKit app on your iOS device to pair with Homebridge:
[... QR code etc...]
[2/6/2018, 1:39:44 PM] [Fibaro HC2 1] didFinishLaunching.
[2/6/2018, 1:39:44 PM] [Fibaro HC2 2] didFinishLaunching.
[2/6/2018, 1:39:44 PM] [Fibaro HC2 3] didFinishLaunching.
[2/6/2018, 1:39:44 PM] Homebridge is running on port 6088.
[2/6/2018, 1:39:44 PM] [Fibaro HC2 3] Loading accessories
[2/6/2018, 1:39:44 PM] [Fibaro HC2 3] Added/changed accessory: 床灯 Ceiling TV
[2/6/2018, 1:39:44 PM] [Fibaro HC2 3] Remove accessory 插座1 Xmas Star
[2/6/2018, 1:39:44 PM] [Fibaro HC2 3] Remove accessory Ceiling Strip 1 new
[2/6/2018, 1:39:44 PM] [Fibaro HC2 1] Loading accessories
[2/6/2018, 1:39:44 PM] [Fibaro HC2 1] Added/changed accessory: 插座1 Xmas Star
[2/6/2018, 1:39:44 PM] [Fibaro HC2 2] Loading accessories
[2/6/2018, 1:39:44 PM] [Fibaro HC2 2] Added/changed accessory: Ceiling Strip 1 new
^C[2/6/2018, 1:39:46 PM] Got SIGINT, shutting down Homebridge...
Did you try to launch homebridge after deleting accessories folder?
If I delete accessories
and persist
folders and re-launch, then it works fine the first time. But if I stop it and start it again after that, I get the above problem. I also can't make sense of the way accessories are loaded and unloaded across the home center users (FC 1/2/3)?
I made a change in a file. Try to replace "dist/index.js" in your installation, remove accessories folder and restart.
I'm still getting random occurrences of the same error.
% homebridge
[2/7/2018, 1:33:19 PM] Loaded plugin: homebridge-fibaro-hc2
[2/7/2018, 1:33:19 PM] Registering platform 'homebridge-fibaro-hc2.FibaroHC2'
[2/7/2018, 1:33:19 PM] ---
[2/7/2018, 1:33:19 PM] Loaded config.json with 0 accessories and 3 platforms.
[2/7/2018, 1:33:19 PM] ---
[2/7/2018, 1:33:19 PM] Loading 3 platforms...
[2/7/2018, 1:33:19 PM] [Fibaro HC2 1] Initializing FibaroHC2 platform...
[2/7/2018, 1:33:19 PM] [Fibaro HC2 2] Initializing FibaroHC2 platform...
[2/7/2018, 1:33:19 PM] [Fibaro HC2 3] Initializing FibaroHC2 platform...
[2/7/2018, 1:33:19 PM] Loading 0 accessories...
[2/7/2018, 1:33:19 PM] [Fibaro HC2 3] Configured Accessory: 插座1 Xmas Star
[2/7/2018, 1:33:19 PM] [Fibaro HC2 3] Configured Accessory: 床灯 Ceiling TV
[2/7/2018, 1:33:19 PM] [Fibaro HC2 3] Configured Accessory: Ceiling Strip 1 new
[...QR code...]
[2/7/2018, 1:33:19 PM] [Fibaro HC2 1] didFinishLaunching.
[2/7/2018, 1:33:19 PM] [Fibaro HC2 2] didFinishLaunching.
[2/7/2018, 1:33:19 PM] [Fibaro HC2 3] didFinishLaunching.
[2/7/2018, 1:33:19 PM] Homebridge is running on port 6088.
[2/7/2018, 1:33:19 PM] [Fibaro HC2 2] Loading accessories
[2/7/2018, 1:33:19 PM] [Fibaro HC2 2] Error getting data from Home Center: Error: Cannot add a bridged Accessory with the same UUID as another bridged Accessory: 4695dda7-cc2a-4b50-b1f1-795b06041bb5
at Bridge.Accessory.addBridgedAccessory (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Accessory.js:264:13)
at Bridge.Accessory.addBridgedAccessories (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Accessory.js:290:10)
at Server._handleRegisterPlatformAccessories (/usr/local/lib/node_modules/homebridge/lib/server.js:451:16)
at Server.<anonymous> (/usr/local/lib/node_modules/homebridge/lib/server.js:41:10)
at API.emit (events.js:160:13)
at API.registerPlatformAccessories (/usr/local/lib/node_modules/homebridge/lib/api.js:159:8)
at ShadowAccessory.resgisterUpdateAccessory (/usr/local/lib/node_modules/homebridge-fibaro-hc2/dist/shadows.js:87:17)
at FibaroHC2.addAccessory (/usr/local/lib/node_modules/homebridge-fibaro-hc2/dist/index.js:171:25)
at LoadAccessories.devices.map (/usr/local/lib/node_modules/homebridge-fibaro-hc2/dist/index.js:113:22)
at Array.map (<anonymous>)
[2/7/2018, 1:33:19 PM] [Fibaro HC2 1] Loading accessories
[2/7/2018, 1:33:19 PM] [Fibaro HC2 1] Error getting data from Home Center: Error: Cannot add a bridged Accessory with the same UUID as another bridged Accessory: 9e46f7f7-e186-4aef-a296-0b7c939b1815
at Bridge.Accessory.addBridgedAccessory (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Accessory.js:264:13)
at Bridge.Accessory.addBridgedAccessories (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Accessory.js:290:10)
at Server._handleRegisterPlatformAccessories (/usr/local/lib/node_modules/homebridge/lib/server.js:451:16)
at Server.<anonymous> (/usr/local/lib/node_modules/homebridge/lib/server.js:41:10)
at API.emit (events.js:160:13)
at API.registerPlatformAccessories (/usr/local/lib/node_modules/homebridge/lib/api.js:159:8)
at ShadowAccessory.resgisterUpdateAccessory (/usr/local/lib/node_modules/homebridge-fibaro-hc2/dist/shadows.js:87:17)
at FibaroHC2.addAccessory (/usr/local/lib/node_modules/homebridge-fibaro-hc2/dist/index.js:171:25)
at LoadAccessories.devices.map (/usr/local/lib/node_modules/homebridge-fibaro-hc2/dist/index.js:113:22)
at Array.map (<anonymous>)
[2/7/2018, 1:33:19 PM] [Fibaro HC2 3] Loading accessories
[2/7/2018, 1:33:19 PM] [Fibaro HC2 3] Added/changed accessory: 床灯 Ceiling TV
[2/7/2018, 1:33:19 PM] [Fibaro HC2 3] Remove accessory 插座1 Xmas Star
[2/7/2018, 1:33:19 PM] [Fibaro HC2 3] Remove accessory Ceiling Strip 1 new
^C[2/7/2018, 1:33:21 PM] Got SIGINT, shutting down Homebridge...
I made another change can you try again (same procedure)?
Same as before. It works the first time, then after that I get the error:
% homebridge
[2/7/2018, 2:34:31 PM] Loaded plugin: homebridge-fibaro-hc2
[2/7/2018, 2:34:31 PM] Registering platform 'homebridge-fibaro-hc2.FibaroHC2'
[2/7/2018, 2:34:31 PM] ---
[2/7/2018, 2:34:31 PM] Loaded config.json with 0 accessories and 3 platforms.
[2/7/2018, 2:34:31 PM] ---
[2/7/2018, 2:34:31 PM] Loading 3 platforms...
[2/7/2018, 2:34:31 PM] [Fibaro HC2 1] Initializing FibaroHC2 platform...
[2/7/2018, 2:34:31 PM] [Fibaro HC2 2] Initializing FibaroHC2 platform...
[2/7/2018, 2:34:31 PM] [Fibaro HC2 3] Initializing FibaroHC2 platform...
[2/7/2018, 2:34:31 PM] Loading 0 accessories...
[2/7/2018, 2:34:31 PM] [Fibaro HC2 3] Configured Accessory: 床灯 Ceiling TV
[2/7/2018, 2:34:31 PM] [Fibaro HC2 3] Configured Accessory: 插座1 Xmas Star
[2/7/2018, 2:34:31 PM] [Fibaro HC2 3] Configured Accessory: Ceiling Strip 1 new
[...QR code...]
[2/7/2018, 2:34:31 PM] [Fibaro HC2 1] didFinishLaunching.
[2/7/2018, 2:34:31 PM] [Fibaro HC2 2] didFinishLaunching.
[2/7/2018, 2:34:31 PM] [Fibaro HC2 3] didFinishLaunching.
[2/7/2018, 2:34:31 PM] Homebridge is running on port 6088.
[2/7/2018, 2:34:31 PM] [Fibaro HC2 1] Loading accessories
[2/7/2018, 2:34:31 PM] [Fibaro HC2 1] Unique seed: 插座1 Xmas Star3Fibaro HC2 1
[2/7/2018, 2:34:31 PM] [Fibaro HC2 1] Error getting data from Home Center: Error: Cannot add a bridged Accessory with the same UUID as another bridged Accessory: 9e46f7f7-e186-4aef-a296-0b7c939b1815
at Bridge.Accessory.addBridgedAccessory (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Accessory.js:264:13)
at Bridge.Accessory.addBridgedAccessories (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Accessory.js:290:10)
at Server._handleRegisterPlatformAccessories (/usr/local/lib/node_modules/homebridge/lib/server.js:451:16)
at Server.<anonymous> (/usr/local/lib/node_modules/homebridge/lib/server.js:41:10)
at API.emit (events.js:160:13)
at API.registerPlatformAccessories (/usr/local/lib/node_modules/homebridge/lib/api.js:159:8)
at ShadowAccessory.resgisterUpdateAccessory (/usr/local/lib/node_modules/homebridge-fibaro-hc2/dist/shadows.js:87:17)
at FibaroHC2.addAccessory (/usr/local/lib/node_modules/homebridge-fibaro-hc2/dist/index.js:172:25)
at LoadAccessories.devices.map (/usr/local/lib/node_modules/homebridge-fibaro-hc2/dist/index.js:113:22)
at Array.map (<anonymous>)
[2/7/2018, 2:34:31 PM] [Fibaro HC2 3] Loading accessories
[2/7/2018, 2:34:31 PM] [Fibaro HC2 3] Unique seed: 床灯 Ceiling TV1952Fibaro HC2 3
[2/7/2018, 2:34:31 PM] [Fibaro HC2 3] Added/changed accessory: 床灯 Ceiling TV
[2/7/2018, 2:34:31 PM] [Fibaro HC2 3] Remove accessory 插座1 Xmas Star
[2/7/2018, 2:34:31 PM] [Fibaro HC2 3] Remove accessory Ceiling Strip 1 new
[2/7/2018, 2:34:31 PM] [Fibaro HC2 2] Loading accessories
[2/7/2018, 2:34:31 PM] [Fibaro HC2 2] Unique seed: Ceiling Strip 1 new58Fibaro HC2 2
[2/7/2018, 2:34:31 PM] [Fibaro HC2 2] Added/changed accessory: Ceiling Strip 1 new
^C[2/7/2018, 2:34:35 PM] Got SIGINT, shutting down Homebridge...
Unfortunately it seems that homebridge doesn't call a necessary function for this scenario. You can try to run 3 different instances of homebridge with 3 different config.json file that specify bridge parameters (name, username and port) and a single fibre-hc2 platform in each.
Or submit a bug report to Homebridge about this? I'm not exactly sure what's missing, so would need your help.
The problem is that homebridge stores in the accessories folder the devices based on the platform name without a reference to the specific instance.
@beorn, it is confirmed that the only way to solve your issue is to have multiple instances of homebridge.
Hi,
(Update! I'm actually able to reproduce this error on the first try as well, with one specific device only. If I hide that device it'll run successfully through the first time, but if I restart homebridge it'll fail on several other devices, as described below.)
I have around 200 devices split across 3 Fibaro users, which I have using the 'hotel' feature to restrict access to certain devices, so that each user has less than 100 accessories in HomeKit.
The first time I run (with empty persist and accessories folders) it works, but the second time it fails on several devices:
I've confirmed that the displayName is the same as well as the UUID.
Not sure if it's useful, but here's a snippet from
persist/IdentifierCache.112233445588.json
showing the96856b9a-0231-4085-9d33-e7751e160682
UUID:I've also attached my entire
.homebridge/
folder (hb.zip). hb.zip