HA, docker and ADB (for NVIDIA SHIELD)

Hi guys, wanted to hook up my android tv box (NVIDIA SHIELD TV) to home assistant and followed the instructions here:


but I think I’m missing some components. The box has developer mode enabled, same as the network debugging option (usb disabled). The box is hardwired, no wifi.

I just upgraded my docker container to the latest build 0.103. But its not yet working:

Platform androidtv not ready yet. Retrying in 180 seconds.
4:24 PM helpers/entity_platform.py (WARNING) - message first occurred at 3:49 PM and shows up 12 times
Could not connect to Shield TV at <Android_device_IP>:5555 using Python ADB implementation with adbkey='/config/.storage/androidtv_adbkey'
4:24 PM components/androidtv/media_player.py (WARNING) - message first occurred at 3:41 PM and shows up 17 times
Couldnt connect to host <Android_device_IP>:5555. TcpTimeoutException: Reading from <Android_device_IP>:5555 timed out (10.0 seconds)
4:24 PM components/androidtv/media_player.py (WARNING) - message first occurred at 3:41 PM and shows up 17 times

Opened up a shell inside the container and I can ping the box.
tried running adb connect <Android_device_IP>:5555
but get the error:
bash: adb: command not found
But of course that is not working as HA doesn’t include the SDK for android. Any commands I can try from shell to use the adb-shell Python package that is included as of v0.101?
Or is there a docker adb server I could use?

Any thoughts are appreciated!

Did you get any further?

nope, not yet :cry:

Look at the troubleshooting section of the documentation; in particular, look at 3-5.

https://www.home-assistant.io/integrations/androidtv#adb-troubleshooting

  • What does your configuration look like?
  • Are you running an ADB server? If so, the Python ADB implementation (adb-shell) won’t work.
    • I recommend that the ADB server approach should only be utilized if the Python ADB approach is unreliable.
  • Did you approve the connection on your device?

revoke keys on the shield (developer settings -> revoke usb keys) and doublecheck if network mode is enabled. I have the same setup and it works fine (but I had to revoke the default keys first).

try to connect to your adb port from a different machine to (telnet shield_ip 5555) to verify adb is running

So I actually got it working.

I manage to install the ADB from the Hass.io add-on store and then on my NVIDIA SHIELD, I enabled the network debugging feature.

Now I can control Shield and I even got notifications up and run as well (just needed to install notifications for Android on the Shield as well).

good news! Yeah I use androidtv notifications for bathroom occupancy notifications :slight_smile: Other than that I launch youtube and stuff. Here’s a gem for you

1 Like

ok, revoking worked like a charm. got a new request to allow a new key and shield is already recognized in HA. Thanks mate!

1 Like