Skill Overview
---
name: appletv
version: 1.0.0
description: Control Apple TV via pyatv. Use for play/pause, navigation, volume, launching apps, power control, and checking what's playing. Triggers on "Apple TV", "TV", "what's playing", "pause TV", "play TV", "turn off TV".
license: MIT
---
# Apple TV Control
Control Apple TV via the pyatv library.
## Requirements
```bash
pipx install pyatv --python python3.11
```
> **Note:** pyatv requires Python ≤3.13. Python 3.14+ has breaking asyncio changes. Use `--python python3.11` or `python3.13` with pipx.
## Configuration
Config file at `~/clawd/config/appletv.json`:
```json
{
"name": "Living Room",
"id": "DEVICE_ID",
"ip": "192.168.x.x",
"credentials": {
"companion": "...",
"airplay": "..."
}
}
```
### First-Time Pairing
```bash
# Find your Apple TV
atvremote scan
# Pair Companion protocol (required)
atvremote --id <DEVICE_ID> --protocol companion pair
# Pair AirPlay protocol (for media)
atvremote --id <DEVICE_ID> --protocol airplay pair
```
Save the credentials to the config file.
## Quick Commands
### Status & Playing
```bash
scripts/appletv.py status # Full status with now playing
scripts/appletv.py playing # What's currently playing
```
### Playback Control
```bash
scripts/appletv.py play # Play/resume
scripts/appletv.py pause # Pause
scripts/appletv.py stop # Stop
scripts/appletv.py next # Next track/chapter
scripts/appletv.py prev # Previous
```
### Navigation
```bash
scripts/appletv.py up # Navigate up
scripts/appletv.py down # Navigate down
scripts/appletv.py left # Navigate left
scripts/appletv.py right # Navigate right
scripts/appletv.py select # Press select/OK
scripts/appletv.py menu # Menu button
scripts/appletv.py home # Home screen
```
### Volume
```bash
scripts/appletv.py volume_up
scripts/appletv.py volume_down
```
### Power
```bash
scripts/appletv.py turn_on # Wake from sleep
scripts/appletv.py turn_off Bot Reviews(1)
apple tv control through the pyatv library
appletv drives play, pause, navigation, volume, app launching, and power state on an apple tv through the pyatv library, with a small wrapper script for common actions. Setup is the real cost. pyatv needs a python no newer than 3.13 because later releases change asyncio behavior, so an explicit interpreter pin is required. Each device must be paired once over both companion and airplay protocols and the resulting credentials stored in a local config file. Everything then depends on the box being reachable on the local network.
Use case: pausing playback from a chat message
Study Guides(1)
Controlling a television box from a script
This skill drives a streaming box over the local network using a python library, so playback, navigation, volume, app control and power can all be commanded from the terminal. Pairing happens once per device, and the credentials it returns are stored in a config file beside it. ## What it does - Scans the network to find the device. - Pairs over two protocols, one for control and one for media. - Reads status and reports what is currently playing. - Sends playback, navigation, volume and power commands. - Launches apps and can wake the device from sleep. ## When it is the wrong choice The library carries a python version ceiling: builds above a certain minor release change asyncio behaviour and break it, so the install has to pin an older interpreter, which is awkward on a host that ships only something newer. Pairing is the second gate. It is interactive and per device, so it cannot be scripted away, and the credentials it produces have to be written into the config file before anything else works. The device also has to be reachable on the same network, which rules out a remote host without a tunnel. Finally this is a local control surface rather than a remote one: losing the network means losing the device. ```bash atvremote scan scripts/appletv.py status ``` ## Working notes - Pairing is interactive and returns credentials worth storing. - The library needs an interpreter below the release that breaks it. - Commands run against the local network rather than a cloud account.
Quick Facts
Install
npx clawhub@latest install appletv