Open iangrieve opened 3 years ago
I think by creating 2 different platforms in the config and so loading the plugin twice in Homebridge it should be possible, shouldn't cause issues, but who knows? Don't have 2 boxes to try, you can try and let us know :-)
There is a quite simple solution, which generally applies to plugins you want to run multiple instances of: you can set up multiple homebridge instances. For some users, this is also the preferred method for all Homebridge plugins, as crashing plugins don't affect other plugins. If I have time to in the future, I'll implement support for multiple Sync boxes right into the plugin. I'll mark this issue as feature request.
Thank you very much, Lukas. I did indeed figure out to add another instance. Interestingly, although configured the same way as the first instance, and the logs show that the sync box is added and all 3 accessories are set up/added, they don't show up in the home app when I try to add them using the homebridge pairing code. The accessory for power does show up and I was able to successfully configure the API so I've accomplished what I wanted to using the API and shortcuts for instance 2 and using HomeKit Scenes for instance 1.
Are there any updates? I am having the same issue. I am able to create another bridge for a second instance, which is already great. I can also see the main switch for the second sync box. But I can't see my HDMI TV switch for the second sync box. It's a weird behavior, because homebridge shows the second device.
I have implemented support for multiple Philips Hue Sync Boxes. As this is a breaking change, I want to invite you to try out the latest version. Your feedback is appreciated, as I don't own multiple Sync Boxes.
To install this "beta" version, use the following command (it will install the version from the branch "multiple-sync-boxes"):
npm install -g "https://github.com/lukasroegner/homebridge-philips-hue-sync-box.git#multiple-sync-boxes"
Make sure that you change your configuration before restarting Homebridge, as all of the properties are now wrapped in an array of devices (see README in the branch "multiple-sync-boxes").
I can't get that to install on my pi homebridge. It says the directory is private.
Any test results for the "beta" version? Does it work properly for those who have multiple Sync Boxes?
Any test results for the "beta" version? Does it work properly for those who have multiple Sync Boxes?
I wish I could test it but that repo didn't work for me!
It says the directory is private.
This is a rather vague description of the issue you are having. Maybe you can provide more details on which OS you are using and the error message you are getting.
If I had to guess, I would assume that you have to install it with a different user.
RaspberryPI Homekit - fails with and without sudo.
Any thoughts?
Got it installed. Removed and then reinstall worked fine after creating a usable global directory. Breaks homebridge for me though:
[14/04/2022, 19:22:39] TypeError: client.platform.log is not a function at Request._callback (/home/pi/.npm-global/lib/node_modules/homebridge-philips-hue-sync-box/src/philips-hue-sync-box-client.js:81:37) at self.callback (/home/pi/.npm-global/lib/node_modules/homebridge-philips-hue-sync-box/node_modules/request/request.js:185:22) at Request.emit (events.js:400:28) at Request.onRequestError (/home/pi/.npm-global/lib/node_modules/homebridge-philips-hue-sync-box/node_modules/request/request.js:877:8) at ClientRequest.emit (events.js:400:28) at TLSSocket.socketErrorListener (_http_client.js:475:9) at TLSSocket.emit (events.js:400:28) at emitErrorNT (internal/streams/destroy.js:106:8) at emitErrorCloseNT (internal/streams/destroy.js:74:3) at processTicksAndRejections (internal/process/task_queues.js:82:21)
My config:
{
"devices": [
{
"syncBoxIpAddress": "192.168.1.XXX",
"syncBoxApiAccessToken": "XX",
"baseAccessory": "switch",
"tvAccessory": true,
"tvAccessoryType": "tv",
"tvAccessoryLightbulb": false,
"modeTvAccessory": false,
"modeTvAccessoryType": "tv",
"modeTvAccessoryLightbulb": false,
"intensityTvAccessory": false,
"intensityTvAccessoryType": "TV",
"intensityTvAccessoryLightbulb": false,
"entertainmentTvAccessory": false,
"entertainmentTvAccessoryType": "TV",
"entertainmentTvAccessoryLightbulb": false
},
{
"syncBoxIpAddress": "192.168.1.XXX",
"syncBoxApiAccessToken": "XX",
"baseAccessory": "switch",
"tvAccessory": true,
"tvAccessoryType": "tv",
"tvAccessoryLightbulb": false,
"modeTvAccessory": false,
"modeTvAccessoryType": "tv",
"modeTvAccessoryLightbulb": false,
"intensityTvAccessory": false,
"intensityTvAccessoryType": "TV",
"intensityTvAccessoryLightbulb": false,
"entertainmentTvAccessory": false,
"entertainmentTvAccessoryType": "TV",
"entertainmentTvAccessoryLightbulb": false
}
],
"platform": "PhilipsHueSyncBoxPlatform"
}
@lukasroegner any update?
I got this working with child bridges. Question: can you add a serial parameter so we can differentiate between them? Name: works but isn't documented.
I get this error with your multiple sync boxes fork
dding new accessory with kind SwitchAccessory. Error: Cannot add a bridged Accessory with the same UUID as another bridged Accessory: b4b0764a-b898-442a-8f44-6b300388e938 at Bridge.Accessory.addBridgedAccessory (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Accessory.ts:594:15) at Bridge.Accessory.addBridgedAccessories (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Accessory.ts:623:12) at BridgeService.handleRegisterPlatformAccessories (/usr/local/lib/node_modules/homebridge/src/bridgeService.ts:384:17) at HomebridgeAPI.emit (node:events:376:20) at HomebridgeAPI.registerPlatformAccessories (/usr/local/lib/node_modules/homebridge/src/api.ts:340:10) at new SyncBoxDevice (/usr/local/lib/node_modules/homebridge-philips-hue-sync-box/src/sync-box-device.js:165:18) at /usr/local/lib/node_modules/homebridge-philips-hue-sync-box/src/philips-hue-sync-box-platform.js:105:32
here's my config:
{ "devices": [ { "syncBoxIpAddress": "192.168.4.92", "syncBoxApiAccessToken": "XXX", "baseAccessory": "switch", "tvAccessory": false, "tvAccessoryType": "TV", "tvAccessoryLightbulb": false, "modeTvAccessory": false, "modeTvAccessoryType": "TV", "modeTvAccessoryLightbulb": false, "intensityTvAccessory": false, "intensityTvAccessoryType": "TV", "intensityTvAccessoryLightbulb": false, "entertainmentTvAccessory": false, "entertainmentTvAccessoryType": "TV", "entertainmentTvAccessoryLightbulb": false }, { "syncBoxIpAddress": "192.168.4.203", "syncBoxApiAccessToken": "XXX", "baseAccessory": "switch", "tvAccessory": false, "tvAccessoryType": "TV", "tvAccessoryLightbulb": false, "modeTvAccessory": false, "modeTvAccessoryType": "TV", "modeTvAccessoryLightbulb": false, "intensityTvAccessory": false, "intensityTvAccessoryType": "TV", "intensityTvAccessoryLightbulb": false, "entertainmentTvAccessory": false, "entertainmentTvAccessoryType": "TV", "entertainmentTvAccessoryLightbulb": false } ], "_bridge": { "username": "0E:BF:48:98:CC:32", "port": 59450 }, "platform": "PhilipsHueSyncBoxPlatform" }
@wondergit113 Please update the package and try again, I've included a fix for your issue.
it's now working great for me :)
Actually, getting crashing homebridge when i try to set intensity:
TypeError: client.platform.log is not a function
at Request._callback (/home/pi/.npm-global/lib/node_modules/homebridge-philips-hue-sync-box/src/philips-hue-sync-box-client.js:83:37)
at Request.self.callback (/home/pi/.npm-global/lib/node_modules/homebridge-philips-hue-sync-box/node_modules/request/request.js:185:22)
at Request.emit (node:events:527:28)
at Request.
Another bug: crashes Homebridge repeatedly if not available
Thank you very much for this excellent Hue Sync Box integration plugin. I am up and running with the Hue Sync Accessories in Homekit for one Hue Sync box and my question is: Can I add a JSON entry with a different name to support a second Sync box on my network?
I initially tried it yesterday and made the mistake that my JSON file would have had the same Platform name for the second sync box. This of course didn't work and after removing the plugin, I was unable to successfully add the first box back on again. I started with a fresh image of Homebridge and am back in good shape with one sync box working in Homekit.
I can test it now with a second attempt but also wanted to ask if you have done this or if it is possible. I know there are a lot of behind the scene things going on and appreciate your insight in to the possibility of this working.
I have 2 Hue bridges so that the sync boxes are on separate bridges. Interested also if the solution is that 2 Hombridge devices would be recommended?
Thank You in advance