htreu / OpenHAB-HomeKit-Bridge

Bridging OpenHAB items to the HomeKit Accessory Protocol
Apache License 2.0
171 stars 32 forks source link

Error: Cannot add a bridged Accessory with the same UUID as another bridged Accessory: #60

Closed evansj closed 8 years ago

evansj commented 8 years ago

I'm getting this error:

Starting the bridge OpenHAB-Bridge ...
/opt/openhab/OpenHAB-HomeKit-Bridge/node_modules/hap-nodejs/lib/Accessory.js:219
      throw new Error("Cannot add a bridged Accessory with the same UUID as another bridged Accessory: " + existing.UUID);
      ^

Error: Cannot add a bridged Accessory with the same UUID as another bridged Accessory: 3e1593f2-0af1-4e30-87e7-a426c2a8b761
    at Bridge.Accessory.addBridgedAccessory (/opt/openhab/OpenHAB-HomeKit-Bridge/node_modules/hap-nodejs/lib/Accessory.js:219:13)
    at /opt/openhab/OpenHAB-HomeKit-Bridge/lib/openHABBridge.js:93:19
    at Array.forEach (native)
    at publishOpenHABBridgeAccessory (/opt/openhab/OpenHAB-HomeKit-Bridge/lib/openHABBridge.js:92:22)
    at /opt/openhab/OpenHAB-HomeKit-Bridge/lib/openHABBridge.js:60:7
    at Request._callback (/opt/openhab/OpenHAB-HomeKit-Bridge/lib/RestClient.js:31:11)
sitemap homekit label="HomeKit" {
    at Request.self.callback (/opt/openhab/OpenHAB-HomeKit-Bridge/node_modules/request/request.js:187:22)
    at emitTwo (events.js:106:13)
    at Request.emit (events.js:191:7)
    at Request.<anonymous> (/opt/openhab/OpenHAB-HomeKit-Bridge/node_modules/request/request.js:1044:10)

I have a very simple sitemap and it has no duplicates. I've experimented with commenting out random items and I can eventually get it to start up.

My sitemap currently (working):

sitemap homekit label="HomeKit" {
    Switch item=WorkingInOffice label="Working In Office"

    Switch item=Light_Cloakroom_Ceiling label="Cloakroom"
    Switch item=Light_Bathroom_Ceiling label="Main Bathroom"
    Switch item=Light_XEnsuite_Ceiling label="X's Ensuite"
    Switch item=Light_MasterEnsuite_Ceiling label="Master Ensuite"

    Switch item=Light_Hallway_Ceiling
    Switch item=Light_Hallway_Table
    Switch item=Light_Kitchen_All
    Switch item=Light_Kitchen_Dining
    Switch item=Light_Kitchen_Hob
    Switch item=Light_Kitchen_Island
    Switch item=Light_Porch
    Slider item=Light_Y_Ceiling switchSupport
/*    Slider item=Light_Living_Ceiling switchSupport */
    Slider item=Light_Living_Lava switchSupport
/*    Slider item=Light_X_Ceiling switchSupport */
    Slider item=Light_MasterBedroom_Ceiling switchSupport
/*    Slider item=Light_Office_Ceiling switchSupport */
    Slider item=Light_Office_Desk switchSupport
    Slider item=Light_Office_Spare switchSupport
}

(I've replaced family member's names with X and Y). I don't know why it thinks those commented out items are duplicates.

htreu commented 8 years ago

The UUIDs are generated from the type name (Switch or Slider) and the label of the item. When you do not provide special labels in the sitemap the labels get pulled from the item registry (your .items file). Please ensure the labels in the sitemap and the .items file are unique. Its probably most easy to add labels in your homekit sitemap. this will also give you nice names for Siri control.

evansj commented 8 years ago

Excellent. That fixed it. I didn't realise the UUID was based on the item label, I thought it came from the item id. Thanks for your help.