The Apple TV integration allows you to control an Apple TV (any generation).
There is currently support for the following entities within the Apple TV device:
To add the Apple TV integration to your Home Assistant instance, use this My button:
Apple TV can be auto-discovered by Home Assistant. If an instance was found, it will be shown as Discovered. You can then set it up right away.
If it wasn’t discovered automatically, don’t worry! You can set up a manual integration entry:
The Apple TV media player platform will create a Media Player entity for each Apple TV discovered on your network. This entity will display the active app and playback controls.
You can launch apps using the
media_player.select_source service, or using the
“Apps” folder in the media browser.
media_player.play_media service, you can also use
Deep Links to
launch specific content in applications.
Examples of some
Deep Links for popular applications:
The simplest way to find useful
Deep Links is to use the “Share” feature in iOS
or macOS versions of the App. Share sheets will often have a “Copy” or
“Copy link” feature. For apps that have a web-accessible version, links copied
from the browser usually work too. Such links may not work if a developer
maintains separate iOS and tvOS apps. More methods of discovering links
supported by apps can be found in the
# Open the Netflix app at a specific title
# Open a specific YouTube video:
The Apple TV remote platform will automatically create a Remote entity for each Apple TV configured on your Home Assistant instance. These entities allow you to turn the device on/off and to send control commands.
The following commands are currently available:
NOTE: Not all commands are supported by all Apple TV versions.
entity_id of the Apple TV
|Command, or list of commands to be sent
|Number of times to repeat the commands
|Interval in seconds between one send and another
This is a
float value e.g. 1, 1.2 etc.
Create a script to invoke the Netflix application based on the application icon being in a fixed place on the home screen:
alias: "Select Netflix"
- service: remote.send_command
Script using the
home_hold command to send your Apple TV to sleep and turn off
the Media Player:
alias: "Make the Apple TV sleep"
- service: remote.send_command
- service: media_player.turn_off
left commands with delay between each:
That is correct; it only toggles the power state in Home Assistant. See the
example above to use the
home_hold command. This can be used on Apple TVs
running tvOS 14.0 or later.
This can happen when pairing the AirPlay protocol in case the access settings are wrong. On your Apple TV, navigate to Settings, find the AirPlay menu and make sure that the access setting is set to “Everyone on the same network” and try again.
The tvOS apps themselves decide what commands they support and when they support them. Likely, the app you are using does not support the action you are trying to perform. Before writing an issue about this, verify if the same action is possible with the Remote app in iOS. If that is the case, please write a bug in pyatv and include logs (see Debugging below).
Volume control functionality depends on how the Apple TV is set up. All volume controls should work if the Apple TV is connected to a HomePod or HomePod stereo pair. If the Apple TV is connected to TV speakers and with volume control over HDMI CEC (Settings -> Remotes and Devices -> Volume Control) only volume up/down controls will work. If volume control is over IR then volume cannot be controlled remotely through the Apple TV, but you can integrate your TV or soundbar directly.
The Apple TV is quite picky when it comes to which formats it plays. The best bet is MP4. If it doesn’t work, it’s likely because of the media format.
If you have any problems and intend to write an issue, make sure you have the relevant logs included. For this integration, you can enable them like this:
By providing logs directly when creating the issue, you will likely get help much faster.