AndroidTV Binding [3.2.0;4.2.0)

If you tell me what I should look for or report back to you I am very happyy to assist. However, this morning I’ve installed the new binding at gave it a quick run. The App Name appears correctly. I have not tried Kodi as that requires me to turn on the system and screen to select the app manually and not through the drop down menu. I will comment further towards the end of the week when I do get some time to try out the new binding.

Sounds good. I’ll post something more in depth on doing the trace logs later.

I do have good news for everyone. I think I found the fix for the bug that we’ve been seeing where the app name wasn’t updating until a button was pushed. I hope to implement that and test in the next few days. The long story short, I found a command that basically says “what app is currently running”. I’m going to embed it into the keepalive so the worst case scenario the app would update every 5 seconds if it didn’t already update from a button push.

I also think I figured out how to make keyboard entry work, but again implementation and testing time needed. For the keyboard, I have two options and I think I’ll probably implement both. Option 1 will be a keyboard channel. Basically whatever you type would send as an entire payload to the shield. This could be good for things like usernames/passwords/etc. Option 2 would be to add a new parser and do something like KEY_A, KEY_1, KEY_z. Basically KEY_* where if * is a single ascii character send it as a button push.

Thoughts?

Version 0.05 (3dd2aa1) posted. This has some app fixes and adds the keyboard/key_ items mentioned above. You will need a new item/channel entry for the keyboard. In theory, the app channel should always be accurate now from the moment of connection on, irrespective of key presses. Worst case, it may lag behind by as much as 5 seconds if you catch it just at the right moment and it hasn’t requested a periodic update. Also, there was an issue with some invisible ascii characters sneaking in and causing issues, I think those have been fixed now as well.

I haven’t had a whole lot of time to test the keyboard and key press. I know it’s not crashing anything and seems ok, but it does seem like the shield behavior is different app to app. I’d very much appreciate some feedback as to what works and what doesn’t between different apps. Also, please don’t try to send any non ascii weird characters to it, I have no idea what it will do. I’ll put a filter in later to block this.

I’ve pushed a small update to yesterday’s release which makes two changes.

  1. It looks like KEY_ENTER doesn’t work like I had hoped with some of the searches when using the KEY_(ASCII) type input. Behind the scenes when you use KEYBOARD it sends the string and then another command that looks to be something like submit/done/etc. I’m added a KEY_SUBMIT so that users who are doing the ASCII inputs can also hit go. To note, SUBMIT seems to work like ENTER but also does more. It’s not entirely clear to me why they have this.

  2. I implemented a sorter so that the DynamicCommand for app is alphabetical by the readable name for those using that.

At this point, I believe we’ve mirrored the android app as much as I can find buttons to mirror. If there is a function in the app that hasn’t been mirrored, please let me know so I can go capture and add.

Is there any functionality that isn’t in this binding that the ADB binding is providing? I think maybe power state may be the only thing? Anything else that I can try to add?

Assuming that’s all that’s left, I’m going to shift focus now on adding the googletv protocol to the binding. I was waiting to get the shieldtv robust and done so that I could hopefully copy/paste that code into the googletv side. I think I’m more or less there at this point.

1 Like

May I say it is an incredible amount of work you have put into this binding. I will not have time to test your latest up-dates until the weekend. I will get back to you as soon as I can. In the meantime, thank you for all the hard work. It is really great not having to switch between apps, web browsers, etc. and to have almost everything in one place. I only wish someone would provide an easy reomte to configure with the various bindings and maybe a binding for the StormAudio prepros…

I do really appreciate that. This has been a fun learning experience for me. For remotes, I have two that I use here. I still have 2 of the old Neeo remotes that are now EoS. I also have a raspberry pi mounted in a 7" touchscreen case that has HabPanel running on it. It sits next to my couch on the end table. I find myself using the pi almost exclusively these days.

Picture of the pi…

1 Like

@morph166955 I have tried the new binding and have the following issues:

  1. Cannot get the selection tab in HABpanel to identify automatically the installed apps. Still works by inputing the name of the apps manually. Using OVERVIEW it works fine.
  2. Cannot get the PIN request to function. Openhab simply connects even if I uninstall everything and cancel the model and thing.

For the keyboard to work, do I have to write all the letters to the command option?

There is a bug in HABpanel where it only displays state options. I fixed that bug in 4.0 here, but it still exists in 3.4.

If you have already run the PIN process, and OH is logging in, then it won’t let you do it again. PIN only runs if it hasn’t successfully logged into the device. Once it logs in, the channel is basically disabled. The PIN process produces a certificate that is used for login. You can see them in /var/lib/openhab/androidtv/. If you delete them, and then restart the binding, rebuild the thing, restart OH, etc, then you will be able to run PIN. The file names are determined by the thing name so if you always name it livingroom then it will always produce androidtv.livingroom.keystore as the filename. So destroying and rebuilding the thing will still use the original keystore.

Thank you for the explenation, but still don’t understand what I have to do.

Thank you. It is very clear.

If you’re running 3.4, there’s nothing you can do unless the fix I submitted for 4.0 is back-ported to a 3.4 patch release.

1 Like

@Norixone FYI 3.4.2 was just released and it contains the HABpanel fix.

1 Like

I have updated openhab to 3.4.2 (thank you @mhilbush ) and can now confirm full support of the Shield TV 2019 model P3430 with Android 11 and firmware 9.1.1. I have not tried the keyboard, but I also have to admit I am not very much interested in the function.

My congratulations to @morph166955 for making all this work.I am now only missing something that allows me to control volume, presets and inputs of the preamplifier and then I have everything I desire on the openhab app.

What brand/model of preamp do you have?

Stormaudio Core 16. I saw you actually developped the binding for Anthem receivers.

I see it has an IR input port on the back panel. The easy “no work” solution would be to get a GlobalCache IP2IR or WF2IR and use the GlobalCache binding (I also wrote that binding) to send it IR codes. Note I haven’t looked at the IR codes so I don’t know if it has discrete power and input selection commands. I hate devices that only have a power toggle IR command. But at this price point, I would assume it has discrete codes for everything. :wink:

Yeah, I was using a GlobalCache to control it. But I prefer IP control, and this was a pretty easy binding to write (about 1 day of work to get basic functionality working).

Is there a spec for the Stormaudio that shows the IP protocol used to control it? If similar to the Anthem, it might be a simple adaptation of the Anthem binding.

You beat me by 2 minutes @mhilbush. I also highly recommend the GC products. I’ve used them for years with great success. Also fully agreed, go buy a cable to use the IR plug in the back. I used one for my shield, my denon, and my sony projector before the bindings came into existence.

Thank you @Norixone ! It’s been a long but fun road.

For those eager for the googletv protocol, hold tight! I’ve made significant progress on the protocol decodes over the last week. There’s still a long road to a working binding, but as it sits right now the only thing stopping me is keyboard time.

1 Like