markus7017 / org.openhab.binding.appletv

Appl-TV Binding for openHAB 2
Eclipse Public License 2.0
8 stars 2 forks source link

Apple-TVBinding (org.openhab.binding.appletv)

This openHAB 2 Binding implements control for the Apple-TV devices. This includes sending remote keys (control the Apple-TV from openHAB). An upcoming version will also process the status updates to provide information about the media being played.

Author: Markus Michels (markus7017) Check https://community.openhab.org/t/binding-for-apple-tv for more information, questions and contributing ideas. Any comment is welcome!

Release: alpha2, check master branch for stable release


Known issues:

Please note: This is a beta release, it has bugs, requires manual install etc. Questions, feedback and contributions are welcome (e.g. improving this documentation).

Looking for contribution: If you are familar with HTML and CSS you are welcome to contribute a nice HABpanel widget. ;-)


Supported Devices, Platforms

Devices

Platforms

Supported Things

Thing Type
device Represents an Apple-TV device

Discovery

The binding supports auto discovery of Apple-TVs on the local network. Once the Apple-TV (using atvremote) the binding could discover the device. Integration of pairing functionality is planned for an upcoming release. For now you need to pair your device first (using atvremote cli) before performing auto discovery in Paper UI.

Proceed with Thing Configuration below.

Binding installation

For now the bindinng is not available on the Eclipse Smart Home Market Place nor part of the openHAB distribution so you need to install it manually.

As described the binding integrates the Phyton-based PyATV project so you need to install Python 3.5 and the required modules:

Binding Configuration

There are no textual configuration files.

Thing Configuration

Before adding the thing make sure that all pre-requisites are met and all modules have been installed (see above).

You could use Paper UI to run auto discvery from the Inbox or to add a thing manually

Channels

Group Channel Type
control remoteKey Send a key or key sequence to the Apple-TV, see below for valid keys
----------- ----------- ----------------------------------------------------------------------------------
playStatus playMode Current play mode: No Media/Idle/Loading/Playing/Paused/Fast Forward/Fast Backward
mediaType Media type being played: None/Music/Video/TV/Unknown ]
title Title of current media. ]
artist Artist - only for Media Music ]
album Album - only for Media Music ]
genre Genre - only for Media Music ]
position Position within the media. While playing the position gets updated in intervals. ]
The position could be changed, send the following format to the channel. ]
+: Move forward, e.g. +10 moves 10sec forward; +5:00 moves 5min forward. ]
-: Move reverse, e.g. -10 moves 10sec backward; +7:00 moves 7min backward. ]
totalTime Total time/duration of the media currently plaing. Note: could be 00:00:00! ]
shuffle Music Shuffle Mode - True: shuffeling, False: no shuffeling ]
repeat Music Repeat Mode - Off: no repeat, Track: repeat track, All: repeat playlis ]

Keys

The following keys could ne semd with channel remoteKey

There are special keys, which will be mapped into a key sequence:

The key sequences can be configured in the thing settings if the defaults don't work for your setup. RThe sequence must match the order of the menu items on the main menu.

Note: You could also send a key sequence, e.g. "top_menu up up left left select"

Full Example

Note: PaperUI is recommended, if you want to use text files make sure to replace the thing id from you channel definition

Notes

It integrates the PyATV Python library, which implements the protocol layer. The binding includes also platform specific stuff (jpy Java/Phyton bridge). All modules are included in the binding package and the binding tries to auto-select them. An upcoming version will allow to overwrite this auto-detection in case something went wrong or you have specific installation requirements.

Thanks postlund for his great work in contributing the PyATV library (https://github.com/postlund/pyatv) and the jpy team (https://github.com/bcdev/jpy).