This is a Homebridge plugin that exposes Apple TVs to HomeKit, noteably the power state as a switch and optionally the device state (playing, paused, etc.) as motion sensors.
To make this plugin work you need to install PyATV. To ensure you did it right run
atvremote --version
Configuration can be done using Homebridge Config UI X.
{
"platform": "AppleTV",
"devices": [
{
"name": "Living Room",
"host": "192.168.0.36",
"credentials": "...",
"device_state_sensors": [
"idle",
"paused",
"playing"
],
"app_sensors": [
"Netflix",
"Disney+"
],
"generic_sensors": [
{
"property": "mediaType",
"values": [
"music",
"tv",
"video",
"unknown"
]
},
{
"property": "genre",
"values": [
"Pop"
]
}
]
}
]
}
In order to retrieve credentials for your Apple TV, please follow these step
atvremote scan
atvremote -s {YOUR-APPLE-ID-IP-ADDRESS} --protocol companion pair