Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error "Cannot add a bridged Accessory with the same UUID" #217

Closed
otherguy opened this issue Nov 20, 2017 · 11 comments
Closed

Error "Cannot add a bridged Accessory with the same UUID" #217

otherguy opened this issue Nov 20, 2017 · 11 comments

Comments

@otherguy
Copy link
Contributor

I have almost the same issue as #14

I'm building some Hue-compatible lights myself (they work perfectly) but the Philips bridge only makes Philips-lights compatible with Homekit. Everything else is not synced to Apple Home.

Unfortunately, Homebridge fails with the "Cannot add a bridged Accessory with the same UUID" error on my custom lights.

Here is the full list of my lights:

{
	"1": {
		"state": {
			"on": false,
			"bri": 0,
			"hue": 0,
			"sat": 0,
			"effect": "none",
			"xy": [0.0000, 0.0000],
			"ct": 0,
			"alert": "none",
			"colormode": "xy",
			"mode": "homeautomation",
			"reachable": false
		},
		"swupdate": {
			"state": "transferring",
			"lastinstall": null
		},
		"type": "Extended color light",
		"name": "Hue Living Room 1",
		"modelid": "LCT001",
		"manufacturername": "Philips",
		"capabilities": {
			"streaming": {
				"renderer": false,
				"proxy": false
			}
		},
		"uniqueid": "00:17:88:01:00:ff:65:2f-0b",
		"swversion": "5.23.1.13452"
	},
	"3": {
		"state": {
			"on": false,
			"bri": 0,
			"hue": 0,
			"sat": 0,
			"effect": "none",
			"xy": [0.0000, 0.0000],
			"ct": 0,
			"alert": "none",
			"colormode": "xy",
			"mode": "homeautomation",
			"reachable": false
		},
		"swupdate": {
			"state": "transferring",
			"lastinstall": null
		},
		"type": "Extended color light",
		"name": "Hue Living Room 2",
		"modelid": "LCT001",
		"manufacturername": "Philips",
		"capabilities": {
			"streaming": {
				"renderer": false,
				"proxy": false
			}
		},
		"uniqueid": "00:17:88:01:00:fd:1f:77-0b",
		"swversion": "5.23.1.13452"
	},
	"7": {
		"state": {
			"on": false,
			"bri": 126,
			"hue": 14974,
			"sat": 140,
			"effect": "none",
			"xy": [0.4570, 0.4098],
			"ct": 362,
			"alert": "none",
			"colormode": "xy",
			"mode": "homeautomation",
			"reachable": true
		},
		"swupdate": {
			"state": "noupdates",
			"lastinstall": "2017-10-19T12:10:14"
		},
		"type": "Extended color light",
		"name": "Hue Terrace 1",
		"modelid": "LCT003",
		"manufacturername": "Philips",
		"capabilities": {
			"streaming": {
				"renderer": true,
				"proxy": true
			}
		},
		"uniqueid": "00:17:88:01:00:f1:0c:42-0b",
		"swversion": "5.105.0.21536"
	},
	"8": {
		"state": {
			"on": false,
			"bri": 126,
			"hue": 14974,
			"sat": 140,
			"effect": "none",
			"xy": [0.4570, 0.4098],
			"ct": 362,
			"alert": "none",
			"colormode": "xy",
			"mode": "homeautomation",
			"reachable": true
		},
		"swupdate": {
			"state": "noupdates",
			"lastinstall": "2017-10-19T12:10:41"
		},
		"type": "Extended color light",
		"name": "Hue Terrace 2",
		"modelid": "LCT003",
		"manufacturername": "Philips",
		"capabilities": {
			"streaming": {
				"renderer": true,
				"proxy": true
			}
		},
		"uniqueid": "00:17:88:01:00:f1:81:27-0b",
		"swversion": "5.105.0.21536"
	},
	"11": {
		"state": {
			"on": false,
			"bri": 254,
			"ct": 366,
			"alert": "none",
			"colormode": "ct",
			"mode": "homeautomation",
			"reachable": true
		},
		"swupdate": {
			"state": "noupdates",
			"lastinstall": "2017-10-19T12:10:52"
		},
		"type": "Color temperature light",
		"name": "Bedroom Ceiling 1",
		"modelid": "LTW001",
		"manufacturername": "Philips",
		"capabilities": {
			"streaming": {
				"renderer": false,
				"proxy": false
			}
		},
		"uniqueid": "00:17:88:01:10:4f:b0:6e-0b",
		"swversion": "5.105.0.21536"
	},
	"12": {
		"state": {
			"on": false,
			"bri": 254,
			"ct": 366,
			"alert": "none",
			"colormode": "ct",
			"mode": "homeautomation",
			"reachable": true
		},
		"swupdate": {
			"state": "noupdates",
			"lastinstall": "2017-10-19T12:10:08"
		},
		"type": "Color temperature light",
		"name": "Bedroom Ceiling 2",
		"modelid": "LTW001",
		"manufacturername": "Philips",
		"capabilities": {
			"streaming": {
				"renderer": false,
				"proxy": false
			}
		},
		"uniqueid": "00:17:88:01:10:25:df:2c-0b",
		"swversion": "5.105.0.21536"
	},
	"13": {
		"state": {
			"on": false,
			"bri": 170,
			"hue": 10742,
			"sat": 238,
			"effect": "none",
			"xy": [0.5519, 0.4025],
			"ct": 500,
			"alert": "none",
			"colormode": "xy",
			"mode": "homeautomation",
			"reachable": true
		},
		"swupdate": {
			"state": "noupdates",
			"lastinstall": "2017-10-19T12:10:05"
		},
		"type": "Extended color light",
		"name": "Hue Bedroom Bowl",
		"modelid": "LCT007",
		"manufacturername": "Philips",
		"capabilities": {
			"streaming": {
				"renderer": true,
				"proxy": true
			}
		},
		"uniqueid": "00:17:88:01:10:25:53:e4-0b",
		"swversion": "5.105.0.21536"
	},
	"14": {
		"state": {
			"on": false,
			"bri": 0,
			"hue": 0,
			"sat": 0,
			"effect": "none",
			"xy": [0.0000, 0.0000],
			"ct": 0,
			"alert": "none",
			"colormode": "xy",
			"mode": "homeautomation",
			"reachable": false
		},
		"swupdate": {
			"state": "transferring",
			"lastinstall": null
		},
		"type": "Extended color light",
		"name": "Hue Living Room 3",
		"modelid": "LCT001",
		"manufacturername": "Philips",
		"capabilities": {
			"streaming": {
				"renderer": false,
				"proxy": false
			}
		},
		"uniqueid": "00:17:88:01:00:d3:62:10-0b",
		"swversion": "5.23.1.13452"
	},
	"16": {
		"state": {
			"on": false,
			"bri": 114,
			"hue": 3145,
			"sat": 254,
			"effect": "none",
			"xy": [0.6274, 0.3564],
			"ct": 153,
			"alert": "none",
			"colormode": "xy",
			"mode": "homeautomation",
			"reachable": true
		},
		"swupdate": {
			"state": "noupdates",
			"lastinstall": "2017-10-14T12:57:19"
		},
		"type": "Extended color light",
		"name": "Hue Bed Lightstrip",
		"modelid": "LST002",
		"manufacturername": "Philips",
		"capabilities": {
			"streaming": {
				"renderer": true,
				"proxy": true
			}
		},
		"uniqueid": "00:17:88:01:01:1e:1e:bb-0b",
		"swversion": "5.105.0.21169"
	},
	"17": {
		"state": {
			"on": false,
			"alert": "none",
			"mode": "homeautomation",
			"reachable": false
		},
		"swupdate": {
			"state": "notupdatable",
			"lastinstall": null
		},
		"type": "On/Off plug-in unit",
		"name": "Fairy Lights",
		"modelid": "Plug 01",
		"manufacturername": "OSRAM",
		"capabilities": {
			"streaming": {
				"renderer": false,
				"proxy": false
			}
		},
		"uniqueid": "7c:b0:3e:aa:00:a3:99:4c-03",
		"swversion": "V1.04.12"
	},
	"18": {
		"state": {
			"on": false,
			"bri": 254,
			"alert": "select",
			"mode": "homeautomation",
			"reachable": false
		},
		"swupdate": {
			"state": "notupdatable",
			"lastinstall": null
		},
		"type": "Dimmable light",
		"name": "Dimmable light 1",
		"modelid": "PeeVeeOne",
		"manufacturername": "Pee",
		"capabilities": {
			"streaming": {
				"renderer": false,
				"proxy": false
			}
		},
		"uniqueid": "00:15:8d:00:01:9a:1b:35-03",
		"swversion": "1000-9999"
	},
	"19": {
		"state": {
			"on": false,
			"bri": 254,
			"alert": "select",
			"mode": "homeautomation",
			"reachable": false
		},
		"swupdate": {
			"state": "notupdatable",
			"lastinstall": null
		},
		"type": "Dimmable light",
		"name": "Dimmable light 2",
		"modelid": "PeeVeeOne",
		"manufacturername": "Pee",
		"capabilities": {
			"streaming": {
				"renderer": false,
				"proxy": false
			}
		},
		"uniqueid": "00:15:8d:00:01:9a:1b:35-04",
		"swversion": "1000-9999"
	},
	"20": {
		"state": {
			"on": true,
			"bri": 240,
			"alert": "select",
			"mode": "homeautomation",
			"reachable": false
		},
		"swupdate": {
			"state": "notupdatable",
			"lastinstall": null
		},
		"type": "Dimmable light",
		"name": "Dimmable light 3",
		"modelid": "PeeVeeOne",
		"manufacturername": "Pee",
		"capabilities": {
			"streaming": {
				"renderer": false,
				"proxy": false
			}
		},
		"uniqueid": "00:15:8d:00:01:9a:1b:35-05",
		"swversion": "1000-9999"
	},
	"21": {
		"state": {
			"on": true,
			"bri": 178,
			"alert": "select",
			"mode": "homeautomation",
			"reachable": false
		},
		"swupdate": {
			"state": "notupdatable",
			"lastinstall": null
		},
		"type": "Dimmable light",
		"name": "Dimmable light 4",
		"modelid": "PeeVeeOne",
		"manufacturername": "Pee",
		"capabilities": {
			"streaming": {
				"renderer": false,
				"proxy": false
			}
		},
		"uniqueid": "00:15:8d:00:01:9a:1b:35-06",
		"swversion": "1000-9999"
	}
}

Since #4 is still open, could you please add an exception for lights with the PeeVeeOne model id? The PeeVeeOne firmware is for NXP chips and is open-source, so I'm sure more people will use it in the future!

@ebaauw
Copy link
Owner

ebaauw commented Nov 20, 2017

The uniqueid is the ZigBee mac address followed by the ZigBee endpoint. The Pee lights above should be exposed as a single accessory, with multiple Lightbulb services. See my homebridge-hue plugin.

@otherguy
Copy link
Contributor Author

I am using the homebridge-hue plugin :)

The error I'm getting is:

[2017-11-20 11:21:30] [Hue] Initializing platform accessory 'Dimmable light 1'...
[2017-11-20 11:21:30] [Hue] Error: Cannot add a Service with the same UUID '00000043-0000-1000-8000-0026BB765291' as another Service in this Accessory without also defining a unique 'subtype' property.
    at Accessory.addService (/usr/local/share/.config/yarn/global/node_modules/hap-nodejs/lib/Accessory.js:142:15)
    at /usr/local/share/.config/yarn/global/node_modules/homebridge/lib/server.js:432:19
    at Array.forEach (<anonymous>)
    at Server._createAccessory (/usr/local/share/.config/yarn/global/node_modules/homebridge/lib/server.js:412:14)
    at Server.<anonymous> (/usr/local/share/.config/yarn/global/node_modules/homebridge/lib/server.js:374:32)
    at /usr/local/share/.config/yarn/global/node_modules/hap-nodejs/lib/util/once.js:16:19
    at HuePlatform.<anonymous> (/homebridge/node_modules/homebridge-hue/lib/HuePlatform.js:562:5)
    at Function.then (/homebridge/node_modules/deferred/_ext.js:60:18)
    at Deferred._settle (/homebridge/node_modules/deferred/deferred.js:84:26)
    at Deferred.resolve (/homebridge/node_modules/deferred/deferred.js:127:15)

@ebaauw
Copy link
Owner

ebaauw commented Nov 20, 2017

I am using the homebridge-hue plugin

Sorry, my bad.

Error: Cannot add a Service with the same UUID

Service, not Accessory. This is unrelated to #4. The issue is that services of the same accessory need to be a different type or a different subtype. Currently, I only set the subtype for the dresden elektronik ballast. I want to set it regardless (see

// this.config.subtype = this.obj.uniqueid.split('-')[1];
), but I fear this would be a breaking change, in that HomeKit will no longer recognise existing accesssories. Need to do some more testing to confirm.

I’m currently traveling, but if you uncomment the above line, it should work. When I return, I can add the logic for the Pee lights, adding them to the list of known lights as well. What ranges of colour and colour temperature do they support? Do you connect them using a Hue bridge? What bridge firmware?

@otherguy
Copy link
Contributor Author

Yes, I'm connecting them through the Hue bridge -- latest firmware.

The Pee lights are not really lights per-se. It's a custom firmware (with a custom vendor id and a custom device id) for JN5168 chips, like the ones made by NXP.

Depending on which firmware you flash on the chip, it supports a different number of light endpoints. I could change the manufacturer and model id to whatever I want, but most people that do this will use the existing firmware created by Peter Visser (which has the manufacturer id Pee).

He created 5 firmware versions for dimmable lights (no color temperature selection), with 1 through 5 endpoints and 9 firmware versions for RGB lights (1 through 4 endpoints, inverted [common anode] and regular [common cathode] plus one original version for a single common anode RGB endpoint).

So, in total, he created 14 different versions of firmware that expose a different amount of light endpoints with different capabilities (RGB and regular dimmable). You can differentiate by the Philips Hue service type (Dimmable light in my case and Color light for the RGB lights). Currently, there is no firmware for tuneable white lights like the Hue White Ambiance.

Personally, I'm using the one with 4 dimmable non-RGB endpoints (which is why you see 4 endpoints in the /lights API request).

@otherguy
Copy link
Contributor Author

Thanks for pointing me in the right direction! I added the subtype conditionally:

  if (this.obj.modelid === "PeeVeeOne") {
    this.config.subtype = this.obj.uniqueid.split('-')[1];
  }

That seems to work fine for now! I do get some warnings, but that is to be expected!

[2017-11-20 16:06:24] [Hue] Philips hue: BSB002 bridge v1711151408, api v1.22.0
[2017-11-20 16:06:24] [Hue] Philips hue: warning: not using recommeneded Hue bridge api version 1.21.0
[2017-11-20 16:06:24] [Hue] Philips hue: /lights/18: warning: unknown light model {"state":{"on":false,"bri":254,"alert":"select","mode":"homeautomation","reachable":false},"swupdate":{"state":"notupdatable","lastinstall":null},"type":"Dimmable light","name":"Dimmable light 1","modelid":"PeeVeeOne","manufacturername":"Pee","capabilities":{"streaming":{"renderer":false,"proxy":false}},"uniqueid":"00:15:8d:00:01:9a:1b:35-03","swversion":"1000-9999"}
[2017-11-20 16:06:24] [Hue] Philips hue: /lights/19: warning: unknown light model {"state":{"on":false,"bri":254,"alert":"select","mode":"homeautomation","reachable":false},"swupdate":{"state":"notupdatable","lastinstall":null},"type":"Dimmable light","name":"Dimmable light 2","modelid":"PeeVeeOne","manufacturername":"Pee","capabilities":{"streaming":{"renderer":false,"proxy":false}},"uniqueid":"00:15:8d:00:01:9a:1b:35-04","swversion":"1000-9999"}
[2017-11-20 16:06:24] [Hue] Philips hue: /lights/20: warning: unknown light model {"state":{"on":true,"bri":240,"alert":"select","mode":"homeautomation","reachable":false},"swupdate":{"state":"notupdatable","lastinstall":null},"type":"Dimmable light","name":"Dimmable light 3","modelid":"PeeVeeOne","manufacturername":"Pee","capabilities":{"streaming":{"renderer":false,"proxy":false}},"uniqueid":"00:15:8d:00:01:9a:1b:35-05","swversion":"1000-9999"}
[2017-11-20 16:06:24] [Hue] Philips hue: /lights/21: warning: unknown light model {"state":{"on":true,"bri":178,"alert":"select","mode":"homeautomation","reachable":false},"swupdate":{"state":"notupdatable","lastinstall":null},"type":"Dimmable light","name":"Dimmable light 4","modelid":"PeeVeeOne","manufacturername":"Pee","capabilities":{"streaming":{"renderer":false,"proxy":false}},"uniqueid":"00:15:8d:00:01:9a:1b:35-06","swversion":"1000-9999"}

@otherguy
Copy link
Contributor Author

I made a PR: #218

@ebaauw
Copy link
Owner

ebaauw commented Nov 20, 2017

Yes, I'm connecting them through the Hue bridge -- latest firmware.
[2017-11-20 16:06:24] [Hue] Philips hue: BSB002 bridge v1711151408, api v1.22.0

Odd, I haven’t seen this version nor state.mode nor capabilities before. Looks like the Hue Entertainment stuff.

I made a PR: #218

Thanks, I’ll have a look when I’ll be back.

@otherguy
Copy link
Contributor Author

Well🙈 You should not see this version in the wild yet!

@otherguy
Copy link
Contributor Author

Thanks for accepting the PR. Once you release .46 I will test it in production.

ebaauw added a commit that referenced this issue Nov 24, 2017
@ebaauw
Copy link
Owner

ebaauw commented Nov 24, 2017

I want to set it regardless, but I fear this would be a breaking change, in that HomeKit will no longer recognise existing accesssories. Need to do some more testing to confirm.

Did some more testing. HomeKit still recognises the same Accessory (so room assignment remains intact), but sees a different Service (so scene and automation assignments are lost). This change will have to wait for the next major release. For now, v0.5.46 adds the subtype to the PeeVeeOne light as per the PR.

@otherguy
Copy link
Contributor Author

otherguy commented Nov 26, 2017

Thank you! Works perfectly!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants