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.
Install / setup the Android Debug Binding and connect it manually to each Nvidia unit
Define items (Android Debug Bridge - Bindings | openHAB)
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 = [
"com.android.systemui/.Somnambulator"="Screen Saver (select twice)",
Open URL Item (examples):
mappings = [
"https://www.rainviewer.com/map.html?loc=41.9615,-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", "http://192.168.0.32:8080/habpanel/index.html#/view/Cameras"="OH Cameras"]
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
* bit.ly/dlbrp - a browser plugin
* bit.ly/ccccctv - Chrome itself
Now that we know the mappings of item syntax, we can integrate commands via Alexa to control the Nvidia via voice.
Hey @jwiseman Thanks for this post.
I’m curious if you’ve used the
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
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.
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.