Skip to content

About

No description, website, or topics provided.

Resources

Stars

7 stars

Watchers

0 watching

Forks

Latest commit

 

History

167 Commits

Folders and files

Repository files navigation

Control4 Apple TV Driver

A self-contained Control4 driver for Apple TV (tvOS) that talks to the Apple TV directly over Apple's Companion and AirPlay protocols. No bridge, server or cloud service needed.

  • Remote control with real press-and-hold
  • Launch apps by name, bundle id or deep link, and Control4 Mini Apps
  • Power, screensaver, Home screen, play state and now playing as properties, variables, events and conditionals
  • Optional Halo push-to-talk voice

Two Builds

Both are built from the same driver.lua and differ only in driver.xml.

File Use it when
control4_apple_tv.c4z You want to keep Control4's own Apple TV driver. Installs alongside it.
appleTV.c4z You want Halo push-to-talk on this driver. Replaces Control4's appleTV.c4z.

Halo voice only works for a driver installed as appleTV.c4z (see docs/halo-voice.md). Installing the voice build updates every native Apple TV device in the project in place, keeping rooms, bindings and programming, and asks for a Director restart.

Setup

  1. Add the driver (or update the native Apple TV devices to the voice build) and set Apple TV Address.
  2. Run Pair Apple TV and enter the PIN shown on the TV in Pairing PIN. AirPlay, which carries now playing, is paired with the same credentials automatically.
  3. Run Refresh App List.

For the voice build also:

  1. Keep AppleBridge in the project and its HomeKit setup working, as for the native driver.
  2. Choose the Apple TV in Apple TV Selector; Voice Status should read Active.
  3. Turn off auto-update for appleTV.c4z in Composer's Manage Drivers, so a Control4 update can't replace it. To go back, update the devices to Control4's appleTV.c4z again.

With the standard build, Halo voice can still go through the native driver: set After Mini App Launch = Select Native Apple TV Driver and pick the native device in Native Apple TV Driver (run Refresh Native Apple TV Drivers first). Keep the native source in the room's Watch menu.

Mini Apps

Bind Universal Minidrivers to the MiniApp inputs on the App Switcher proxy. Selecting one launches the matching Apple TV app, matched against the app list by name, bundle id and common aliases (Netflix, YouTube, DirecTV, Hulu, Disney+, Max, Peacock, Prime Video and others).

Remote

Navigator long presses and keypad press/release hold the button down on the Apple TV until it's released, so scrubbing and context menus work. If a release never arrives, the button is released after Max Hold Time and Hold Timed Out fires. The MENU, GUIDE, INFO, CANCEL and colour buttons can be remapped in properties.

Programming

  • Events: Playback Started / Paused / Stopped, Now Playing Changed, Powered On / Off, Screensaver Started, Home Screen Shown, App Changed, Apple TV Connected / Disconnected, Hold Timed Out
  • Conditionals: playing, paused, asleep, screensaver, connected, current app
  • Variables: POWERED_ON, DISPLAY_STATE, PLAY_STATE, CURRENT_APP, CURRENT_APP_ID, TITLE, ARTIST, ALBUM, SERIES, CONNECTED
  • Commands: Home, Menu, Guide, Select, Play/Pause, Channel and Page Up/Down, Volume Up/Down, Control Center, App Switcher, Sleep, Wake, Launch App, Launch App By ID

Now playing needs the AirPlay pairing. Navigators don't draw media info for this kind of device, so the Now Playing card stays generic; use the variables and events.

Development

lua tests/test_driver.lua
python3 tools/package_driver.py

The second command builds both control4_apple_tv.c4z and appleTV.c4z.

  • driver.lua: the driver, including the Companion, AirPlay/MRP and crypto code
  • driver.xml: the standard build's package definition; the voice build adds push-to-talk, the voice properties and the native driver's connections at packaging
  • tests/: local tests with a mocked Control4 runtime
  • docs/: protocol, crypto, testing and hardware notes

About

No description, website, or topics provided.

Resources

Stars

7 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages