grover / homebridge-dacp

Remotely control Apple TV and iTunes via HomeKit.
MIT License
151 stars 14 forks source link

Input Controls Missing #26

Open stephenwoodford opened 6 years ago

stephenwoodford commented 6 years ago

Updated to 0.9 last night and tried enabling input controls but had no controls show up in Eve or Home. I've tried unpairing and re-pairing, as well as setting up a separate Apple TV to avoid any accessory cache, but still haven't gotten the input controls to show up at all. Here's my config:

        {
            "platform": "DACP",
            "devices": [
                {
                    "name": "Bedroom Apple TV",
                    "pairing": "VALID",
                    "serviceName": "VALID",
                    "features": {
                        "no-volume-controls": true,
                        "alternate-playpause-switch": true,
                        "alternate-input-controls": true,
                        "album-artwork": "/tmp/nowplaying.png"
                    }
                }
            ]
        }

I tried many other configs to try and get something to show up, but was never able to. Here are some example feature configs I've tried:

"features": {
    "no-volume-controls": true,
    "alternate-input-controls": true
}

"features": {
    "alternate-input-controls": true
}

"features": {
    "input-controls": true
}

"features": {
    "input-controls": ["menu", "topmenu"]
}

Thanks for any support you can provide!

grover commented 6 years ago

Should be fixed in 0.9.1, which I just released.

stephenwoodford commented 6 years ago

I'm now receiving a new error when starting homebridge. I haven't had a chance to do much troubleshooting yet but wanted to see if it was related to this. I don't believe I've changed anything else besides updating to 0.9.1. My config is same as above.

[2/27/2018, 6:37:29 PM] [DACP] Initializing DACP platform...
[2/27/2018, 6:37:29 PM] [DACP] DACP Platform Plugin Loaded - Version 0.9.1
[2/27/2018, 6:37:29 PM] [DACP] Found accessory in config: "Bedroom Apple TV"
[2/27/2018, 6:37:29 PM] [DACP] Initializing platform accessory 'Bedroom Apple TV'...

/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Accessory.js:150
      if (service.subtype.toString() === existing.subtype.toString())
                                                          ^
TypeError: Cannot read property 'toString' of undefined
    at Accessory.addService (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Accessory.js:150:59)
    at /usr/local/lib/node_modules/homebridge/lib/server.js:432:19
    at Array.forEach (<anonymous>)
    at Server._createAccessory (/usr/local/lib/node_modules/homebridge/lib/server.js:412:14)
    at Server.<anonymous> (/usr/local/lib/node_modules/homebridge/lib/server.js:374:32)
    at /usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/util/once.js:16:19
    at DacpPlatform.accessories (/usr/local/lib/node_modules/homebridge-dacp/src/index.js:195:5)
    at Server._loadPlatformAccessories (/usr/local/lib/node_modules/homebridge/lib/server.js:364:20)
    at Server._loadPlatforms (/usr/local/lib/node_modules/homebridge/lib/server.js:308:16)
    at Server.run (/usr/local/lib/node_modules/homebridge/lib/server.js:85:36)
    at module.exports (/usr/local/lib/node_modules/homebridge/lib/cli.js:40:10)
    at Object.<anonymous> (/usr/local/lib/node_modules/homebridge/bin/homebridge:17:22)
    at Module._compile (module.js:660:30)
    at Object.Module._extensions..js (module.js:671:10)
    at Module.load (module.js:573:32)
    at tryModuleLoad (module.js:513:12)

EDIT after some troubleshooting:

Modifying my config to remove any DACP devices allows homebridge to start, so seems to be something with DACP.

        {
            "platform": "DACP",
            "devices": []
        }

EDIT 2:

Just removing "alternate-input-controls": true fixes it, so seems to be something with the input control accessories. On the bright side, regular "input-controls" does seem to be working.

StewartSnow commented 6 years ago

Just +1-ing this. I'm seeing the exact same issue using alternate-input-controls:true on v 0.9.1 :

/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Accessory.js:150
      if (service.subtype.toString() === existing.subtype.toString())
                                                          ^
TypeError: Cannot read property 'toString' of undefined

Remove that feature and it's fine. Same behaviour if you specify individual buttons instead of just true.

inotna commented 6 years ago

I this still a issue? The only thing I can get to show up in Home app is the alternate play pause control button. Can't get the app to show menu and top menu button.

grover commented 6 years ago

It is. Haven't published a fix yet due to lack of time on my part. Sorry for the wait.

inotna commented 6 years ago

Any Update on this? Have you found a fix? :-)

PJMikols commented 5 years ago

Still Occurring. in 9.2.
Any Resolutions?

zabaya commented 5 years ago

Found an solution: Somehow the alternate-playpause button and alternate-input-controls or the macro's couldn't be used together, that's why i couldn't get it to work for automation. But by pairing the same apple tv twice i could use the the first 'device' to do the alternate play-pause button and the second to do the alternate buttons and macro's. So now i have the best of both worlds. Fully automatable triggers without third party apps. I still think it should have worked straight out of the box but if it works, it works.