Android Tv Service Binding

Hey all.
I know there’s a Plex binding (but don’t think it’s available for OH2 yet), but I also use YouTube and Netflix on our AndroidTVs.

Is there anyone working on being able to bind play/pause on a universal level to OpenHab? I presume it’s possible.

I havent heard of anything but it should surely be possibly… Have you tried installing the android TV app on your phone and “sniff” the traffic as you control the TV with the remote app?

All OH 1 bindings should theoretically work on OH 2. If it isn’t listed as supported by OH 2 it just means no one has tested that it works or not yet. So give it a try and see if it works and report either way back here to let the developers know whether it worked or not. If it worked they will add it to the list. If not they can put in the issue request to fix it.

OH is not architected to work like that. OH provides a layer of abstraction between your HA rules and logic and the specific technologies that implement communication with devices. Each technology has its own way to communicate so a “universal play/pause on a universal level” makes no sense. Android TV works completely different from Roku works completely different from Kodi works completely different from …). It is possible for someone to reverse engineer or research a published API to build an AndroidTV binding.

Hi thanks for the responses.
@TommySharp, The main thing I want to achieve is whether it is already playing or paused, so the remote app here wouldn’t help (apart from what commands to send if I wanted to take control), but might give me more of an insight, so I’ll give it a go.

@rlkoshak, I’ll try the Plex binding this week then, thanks. On the universal part of your comment; I meant universal state of AndroidTV being reported back to OpenHab, not universal across platforms. IE, there must be a state of the AndroidTVOS itself that says if it’s play, intendant of which app is actually playing. I want to be able to capture this, it might be a simple case of polling it if it broadcasts, or writing a service to report it’s state if not.

Further investigation is needed, I’ll see who I can get involved who might know more than me about how to start this off.

So if they are using the built in MediaPlayer class, then we should be able to report the MediaState:
http://developer.android.com/reference/android/media/MediaPlayer.html

I’m going to start learning Java and see if I can cable together a proof, but the chances of spending enough time might be slim. If anyone makes any progress, let me know.

Christian