lprhodes / homebridge-apple-tv

Apple TV 4th & 5th gen plugin for homebridge: https://github.com/nfarina/homebridge
Apache License 2.0
105 stars 15 forks source link

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

Closed jungopro closed 6 years ago

jungopro commented 6 years ago

Hello

I'm posting this after reviewing several similar open issues (#13 #14 & #15 ) I read the threads over and over and couldn't understand if the issue is resolved or not and what steps may help. Excuse me for duplicating

I can't perform the pairing and the error is the "same UUID". Here is the full message for reference:

May 07 21:04:26 raspberrypi homebridge[9934]: [2018-5-7 21:04:26] [Apple TV] [INFO] Discovered Apple TV (Apple TV) at 192.168.14.77
May 07 21:04:26 raspberrypi homebridge[9934]: [2018-5-7 21:04:26] [Apple TV] [INFO] Added pair switch for Apple TV (Apple TV) at 192.168.14.77
May 07 21:04:26 raspberrypi homebridge[9934]: [2018-5-7 21:04:26] [Apple TV] [INFO] Discovered Apple TV (Apple TV) at 192.168.14.77
May 07 21:04:26 raspberrypi homebridge[9934]: [2018-5-7 21:04:26] [Apple TV] [INFO] Added pair switch for Apple TV (Apple TV) at 192.168.14.77
May 07 21:04:26 raspberrypi homebridge[9934]: [2018-5-7 21:04:26] [Apple TV] [CONFIG ERROR] Up; No connected device could be found with a deviceID of "lounge".
May 07 21:04:26 raspberrypi homebridge[9934]: [2018-5-7 21:04:26] [Apple TV] Initializing platform accessory 'Pair Apple TV'...
May 07 21:04:26 raspberrypi homebridge[9934]: [2018-5-7 21:04:26] [Apple TV] Initializing platform accessory 'Pair Apple TV'...
May 07 21:04:27 raspberrypi homebridge[9934]: [2018-5-7 21:04:27] [Apple TV]
May 07 21:04:27 raspberrypi homebridge[9934]: [2018-5-7 21:04:27] [Apple TV] **************************************************************************************************************
May 07 21:04:27 raspberrypi homebridge[9934]: [2018-5-7 21:04:27] [Apple TV] ** Welcome to version 1.0.2 of the Homebridge Apple TV Plugin!
May 07 21:04:27 raspberrypi homebridge[9934]: [2018-5-7 21:04:27] [Apple TV] **
May 07 21:04:27 raspberrypi homebridge[9934]: [2018-5-7 21:04:27] [Apple TV] ** Find out what's in the latest release here: https://github.com/lprhodes/homebridge-apple-tv/releases
May 07 21:04:27 raspberrypi homebridge[9934]: [2018-5-7 21:04:27] [Apple TV] **
May 07 21:04:27 raspberrypi homebridge[9934]: [2018-5-7 21:04:27] [Apple TV] ** If you like this plugin then please star it on GitHub or better yet
May 07 21:04:27 raspberrypi homebridge[9934]: [2018-5-7 21:04:27] [Apple TV] ** buy me a drink using Paypal https://paypal.me/lprhodes or crypto https://goo.gl/bEn1RW.
May 07 21:04:27 raspberrypi homebridge[9934]: [2018-5-7 21:04:27] [Apple TV] **
May 07 21:04:27 raspberrypi homebridge[9934]: [2018-5-7 21:04:27] [Apple TV] ** Keep up to date with this plugin along with everything HomeKit and homebridge
May 07 21:04:27 raspberrypi homebridge[9934]: [2018-5-7 21:04:27] [Apple TV] ** by signing up to my newsletter at http://workswith.io
May 07 21:04:27 raspberrypi homebridge[9934]: [2018-5-7 21:04:27] [Apple TV] **
May 07 21:04:27 raspberrypi homebridge[9934]: [2018-5-7 21:04:27] [Apple TV] ** You can disable this message by adding "hideWelcomeMessage": true to the config (see config-sample.json).
May 07 21:04:27 raspberrypi homebridge[9934]: [2018-5-7 21:04:27] [Apple TV] **
May 07 21:04:27 raspberrypi homebridge[9934]: [2018-5-7 21:04:27] [Apple TV] **************************************************************************************************************
May 07 21:04:27 raspberrypi homebridge[9934]: [2018-5-7 21:04:27] [Apple TV]
May 07 21:04:27 raspberrypi homebridge[9934]: (node:9934) UnhandledPromiseRejectionWarning: Error: Cannot add a bridged Accessory with the same UUID as another bridged Accessory: xxxxx-xxxxxx-xxxxxx
May 07 21:04:27 raspberrypi homebridge[9934]:     at Bridge.Accessory.addBridgedAccessory (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Accessory.js:264:13)
May 07 21:04:27 raspberrypi homebridge[9934]:     at Server.<anonymous> (/usr/lib/node_modules/homebridge/lib/server.js:377:24)
May 07 21:04:27 raspberrypi homebridge[9934]:     at /usr/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/util/once.js:16:19
May 07 21:04:27 raspberrypi homebridge[9934]:     at AppleTVPlatform.accessories (/usr/lib/node_modules/homebridge-apple-tv/node_modules/homebridge-platform-helper/platform.js:50:5)
May 07 21:04:27 raspberrypi homebridge[9934]:     at <anonymous>:null:null
May 07 21:04:27 raspberrypi homebridge[9934]: (node:9934) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
May 07 21:04:27 raspberrypi homebridge[9934]: (node:9934) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Here is the configuration from config.json:

"platforms":[
    {
      "platform":"AppleTV",
      "name":"Apple TV",
      "devices": [ ],
      "accessories": [
        {
          "deviceID":"lounge",
          "name":"Up",
          "command": "up"
        }
      ]
    },
...

I reviewed issues #13 #14 & #15 but I couldn't understand what am I doing wrong... I tried deleting the cachedAccessories file but that didn't help

Any help is highly appreciated.

Environment Information:

Device: Raspberry Pi 3 Model B+ Homebridge: 0.4.38

systemd configuration:

$ cat /etc/systemd/system/homebridge.service

[Unit]
Description=Node.js HomeKit Server
After=syslog.target network-online.target

[Service]
Type=simple
User=pi
EnvironmentFile=/etc/default/homebridge
ExecStart=/usr/bin/homebridge $HOMEBRIDGE_OPTS
Restart=on-failure
RestartSec=10
KillMode=process

[Install]
WantedBy=multi-user.target

$ cat /etc/default/homebridge

# Defaults / Configuration options for homebridge
# The following settings tells homebridge where to find the config.json file and where to persist the data (i.e. pairing and others)
HOMEBRIDGE_OPTS=-U /var/homebridge

# If you uncomment the following line, homebridge will log more
# You can display this via systemd's journalctl: journalctl -f -u homebridge
# DEBUG=*

$ ls -R /var/homebridge/

/var/homebridge/:
accessories  auth.json  config.json  persist  plugin-persist

/var/homebridge/accessories:
cachedAccessories

/var/homebridge/persist:
AccessoryInfo.CC223DE3CE30.json  IdentifierCache.CC223DE3CE30.json

/var/homebridge/plugin-persist:
homebridge-broadlink-rm

/var/homebridge/plugin-persist/homebridge-broadlink-rm:
BrandonHacks commented 6 years ago

Your best bet is to install the appletv command line(found at the bottom as credited). Use that tool to pair your device manually and configure homebridge platform to ignore the automatic pairing.

jungopro commented 6 years ago

Hi @BrandonHacks Thank you very much, this has worked like a charm! I now have an issue to create a complex command with multiple commands in it, but I will review the documentation and if I can't make it I will open a new issue

Much appreciated!

kevindesgagnes commented 6 years ago

Hi @BrandonHacks,

What is the "appletv command line tool" you are referring to ? I cannot see any referrence to this in this page.

Thanks

hopkapi commented 6 years ago

@kevindesgagnes Found it here though it's the wrong way around, should be this: npm install -g -unsafe-perm node-appletv