Support for multiple instances of same platform
See original GitHub issueAfter troubleshooting for some time with the Fibaro-HC2 plugin it seems it’s an issue that has to be fixed in Homebridge proper, so posting here.
To get around the HomeKit 100-accessories-per-bridge limitation, I’ve partitioned up my Fibaro-HC2 installation into 3 subsets of accessories, each controlling less than 100 accessories. For an example setup see Fibaro-HC2 issue 81 and this config.json.
Homebridge runs successfully the first time, but the second time I run into Error: Cannot add a bridged Accessory with the same UUID as another bridged Accessory
, as described in Fibaro-HC2 issue 80.
The conclusion is that it’s impossible to use multiple instances of the same platform with Homebridge as Homebridge doesn’t store the specific platform instance identifier with the accessory in the accessories
folder. See example run with one accessory per platform instance (with some additional output to show the unique seed):
% 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...
Any thoughts on if this seems accurate, and if so how/where to fix this?
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (1 by maintainers)
Top GitHub Comments
Beorn - Its actually pretty easy to work around this limitation. Simply divide your config.json file into two or more files each named config.json but which are then stored in different directories. As an example, create two directories /var/homebridge/instance1 and /var/homebridge/instance2 . Into each of these directories, place a config.json file with less than 100 accessories. Also, make sure that you change the bridge’s “username” and port number in the second config.json file so it does not match the first config.json. For example, use ports 51828 and 51829. Also, on Linux, make sure the two directories have full rwx permissions. Now just start two instances of homebridge using the -U option to specify the two different folders (instead of relying on the default). I.e., execute:
homebridge -U /var/homebridge/instance1
homebridge -U /var/homebridge/instance2
This will then create two bridges, each of which can have up to 100 accessories. You’ll have to add them as two separate pairings to the Home app, but once that’s done, you’re all set.
This issue has been automatically marked as stale because it has not had recent activity, and will be closed if no further activity occurs. If this issue was overlooked, forgotten, or should remain open for any other reason, please reply here to call attention to it and remove the stale status. Thank you for your contributions.