A homebridge plugin that exposes Apple TV devices to Homekit, along with it's current Power State, Playback State and Now Playing Information.
This plugin exposes the Apple TV as a switch device, with the switch power state representing the Apple TV power state. The playback state is exposed through the Active charceristic and all other now playing information get's exposed through customised characteristics.
The media type is calculated by checking artist and album information. This characterist comes in handy if you would like to setup automations that dim light for only videos and not music.
Note: The now playing information are exposed as custom charactersitics, which means that the Apple Home App will not be able to read these. You will need to use an app such as Home+ 4 or Eve for Homekit.
The TV Accessory is an experimental feature, so please use it expecting things to not work.
Configuration can be done using Homebridge Config UI X.
{
"platform": "AppleTvNowPlayingPlatform",
"debug": true,
"devices": [
{
"name": "Lounge Apple TV",
"credentials": "C8309D5A-4AAD-4338-8B45....",
"showTVAccessory": true,
"inputs": [
{
"name": "Netflix",
"index": 9,
"applicationId": "com.netflix.Netflix"
}
]
}
]
}
In order to retrieve credentials for your Apple TV, please follow these step
Execute the cli application bundled with this package from the package directory.
You should be able to run npm root -g
to find the NPN installation location, or if you are using the Docker image from Oznu it should be /homebridge/node_modules/homebridge-appletv-now-playing
/path/to/homebridge-appletv-now-playing $ node .\bin\cli.js
Example:
/path/to/homebridge-appletv-now-playing $ node .\bin\cli.js
Scanning for devices...
These Apple TVs were found:
1 : Lounge [C8309D5A-XXXX-XXXX-XXXX-2F7F2E813680]
Pair with Apple TV (enter index) : 1
Attempting to connect to Lounge [C8309D5A-XXXX-XXXX-XXXX-2F7F2E813680]...
Attempting to pair with Lounge [C8309D5A-XXXX-XXXX-XXXX-2F7F2E813680]...
Enter PIN shown on Lounge [C8309D5A-XXXX-XXXX-XXXX-2F7F2E813680] : 1234
Successfully paired with Lounge [C8309D5A-XXXX-XXXX-XXXX-2F7F2E813680].
Please update your configuration with the following credentials for this device:
C8309D5A-XXXX-XXXX-XXXX-2F7F2E813680:27y934hj523843kj2432423j4234kj23423kj4234j......