Open williamli opened 6 years ago
Me too. What is the fix?
I figured it out, Someone else posted their config example. You don't put it in the accessories Array, that is a lie. Paste this: "pairing": "6B413D0D21623AEC", "serviceName": "ACB0F206EF58248D18A4FC4362CFEEB3050D312E" into
{ "platform": "DACP", "devices": [ { "name": "AppleTV", "pairing": "6B413D0D21623AEC", "serviceName": "ACB0F206EF58248D18A4FC4362CFEEB3050D312E", "features": { "alternate-playpause-switch": true } } ] }
let me give it a try.
I meant the device entry with the text. Sorry about the confusion. Will rework this in 1.0.
I am running into this issue as well, I get the same error in the terminal whether I put the pairing & service in accessories or in the devices.
` { "bridge": { "name": "Homebridge", "username": "CC:22:3D:E3:CE:30", "port": 51826, "pin": "031-45-154" },
"description": "This is an example configuration file with one fake accessory and one fake platform. You can use this as a template for creating your own configuration file containing devices you actually own.",
"accessories": [
],
"platforms": [{
"platform": "Nest",
"token": "token",
"clientId": "id",
"clientSecret": "secret",
"code": "code",
"username": "Username",
"password": "Password"
},
{
"platform": "cmdSwitch2"
},
{
"bridge": {
"name": "Bedroom TV",
"username": "AC:BB:CC:DD:EE:FF",
"port": 54718,
"pin": "135-79-864"
},
"platforms": [
{
"platform": "DACP",
"devices": [
{
"name": "Bedroom TV",
"pairing": "8428412ED4133D5A",
"serviceName": "0BA70389F0174F0CA76067647F322E9FAD33B234",
"features": {
"alternate-playpause-switch": true
}
}
]
}
]
}
]
} `
This is the error i get in terminal.
[1/4/2019,10:27:52 AM] Loaded config.json with 0 accessories and 3 platforms. [1/4/2019, 10:27:52 AM] --- [1/4/2019, 10:27:52 AM] Loaded plugin: homebridge-cmdswitch2 [1/4/2019, 10:27:52 AM] Registering platform 'homebridge-cmdswitch2.cmdSwitch2' [1/4/2019, 10:27:52 AM] --- [1/4/2019, 10:27:53 AM] Loaded plugin: homebridge-dacp [1/4/2019, 10:27:53 AM] Registering platform 'homebridge-dacp.DACP' [1/4/2019, 10:27:53 AM] --- [1/4/2019, 10:27:53 AM] Loaded plugin: homebridge-harmonyhub [1/4/2019, 10:27:53 AM] Registering platform 'homebridge-harmonyhub.HarmonyHub' [1/4/2019, 10:27:53 AM] --- [1/4/2019, 10:27:53 AM] Loaded plugin: homebridge-nest [1/4/2019, 10:27:53 AM] Registering platform 'homebridge-nest.Nest' [1/4/2019, 10:27:53 AM] --- [1/4/2019, 10:27:53 AM] Loading 3 platforms... [1/4/2019, 10:27:53 AM] [Nest] Initializing Nest platform... [1/4/2019, 10:27:53 AM] [Nest] Fetching Nest devices. [1/4/2019, 10:27:53 AM] [cmdSwitch2] Initializing cmdSwitch2 platform... /usr/local/lib/node_modules/homebridge/lib/api.js:108 if (name.indexOf('.') == -1) { ^
TypeError: Cannot read property 'indexOf' of undefined
at API.platform (/usr/local/lib/node_modules/homebridge/lib/api.js:108:12)
at Server._loadPlatforms (/usr/local/lib/node_modules/homebridge/lib/server.js:316:45)
at Server.run (/usr/local/lib/node_modules/homebridge/lib/server.js:86:36)
at module.exports (/usr/local/lib/node_modules/homebridge/lib/cli.js:45:10)
at Object.
I found my error. I had "platforms": [
twice in the document.
I am trying to get homebridge-dacp to work with my AppleTV runnign tvOS11.3.
I have added
and used the passcode to successfully pair it with AppleTV.
I was asked to insert
into the accessories array.
On restart, homebridge crash with the following TypeError: