Android Debug Binding (ADB) - Notes for others

I wanted to get OH to control my three Nvidia Shield’s that are Android based TV streaming platforms. Not a lot of information on OH about how to do this.

After spending a few days reading other non OH forums, here’s what I have setup that I hope others can reduce their time finding these things.

  1. Install / setup the Android Debug Binding and connect it manually to each Nvidia unit

  2. Define items (Android Debug Bridge - Bindings | openHAB)

  3. Define the sitemap - which these item mappings work:

Shutdown/Reboot Item :

mappings = [ "NULL"="No Action", "POWER_OFF"="Power OFF", "REBOOT"="Reboot"]

Start Package Item :

mappings = [
  ""="No Action",
  ""="Screen Saver (select twice)",
  ""="HBO Max",	
  ""="Apple TV",	
  ""="YouTube" ]

Open URL Item (examples):

mappings = [
 ""="No Action",
""="Coin 360", 
",-87.7423,8\\&oFa=0\\&oC=0\\&oU=0\\&oCS=1\\&oF=0\\&oAP=0\\&rmt=0\\&c=1\\&o=83\\&lm=0\\&th=0\\&sm=1\\&sn=1"="Rain",	 ""="OH Cameras"]
  1. Installing Chrome on Nvidia (which is called side loading)
    Install a downloader from Google Play Store (it’s an orange icon called Downloader)
    Open Downloader and install these in order using the URL’s

       * - a browser plugin
       * - Chrome itself

Now that we know the mappings of item syntax, we can integrate commands via Alexa to control the Nvidia via voice.

Best, Jay

1 Like

Hey @jwiseman Thanks for this post.

I’m curious if you’ve used the current-package and stop-current-package channels with your Nvidia Shield. From what I can see, current-package is not being populated. And, as a result, stop-current-package doesn’t work.

My debug log shows that the binding is unable to get the package name.

2022-04-09 09:03:49.908 [DEBUG] [droiddebugbridge.internal.AndroidDebugBridgeDevice] - a.b.c.d - shell:dumpsys window windows | grep mFocusedApp
2022-04-09 09:03:49.937 [WARN ] [roiddebugbridge.internal.AndroidDebugBridgeHandler] - Unable to refresh play status: Unable to read package name
2022-04-09 09:03:49.938 [DEBUG] [droiddebugbridge.internal.AndroidDebugBridgeDevice] - a.b.c.d - shell:dumpsys window windows | grep mFocusedApp
2022-04-09 09:03:49.978 [WARN ] [roiddebugbridge.internal.AndroidDebugBridgeHandler] - Unable to refresh current package: Unable to read package name
1 Like

Hey Mark,

I’m actually NOT using either of those items from the SmartJ binding version.

I’m not using stop but instead using the control item for play and pause.


Here’s the syntax to start a package:


My issue with the binding is the CEC powering on command sequence. My setup is Nvidia → Receiver ← TV. I have an older Samsung TV so sometimes the TV goes on and sometimes it doesn’t. The Samsung BETA binding can shut the TV off but not turn it on. I gave up after spending 8 hours trying to get it to work.

Best, Jay

Ok, thanks.

I’m using the key-event channel for most everything. But I wanted a way to be able to exit (stop) the currently running app. From what I’ve read so far, the method the binding is using to get the current package (mFocusedApp) doesn’t work in all cases. :frowning_face: