Native support for Android TV / Android devices

Are you sure you had this on your android device ?

image
but no RSA key

The integration should have generated one for you. Did you already have a key ?

Could you please tell me in which step I should get it?

The integration should have done this for you. Try this :

  1. remove integration from config
  2. remove adbkey and adbkey.pub from \HASSIO\config.storage
  3. remove debugger authorization on android device
  4. restart hassio
  5. add integration WITHOUT adb server (juste the basic integration)
  6. restart hassio
1 Like

“integration WITHOUT adb server” you mean in configuration.yaml?:

media_player:
  - platform: androidtv
    name: Tablet A
    host: 192.168.1.71

Done. No media_player.tablet_a, In ADB add-on logs Connection refused, files adb comes back

@QbaF first of all, close the ports that you opened on your router. That’s irrelevant and insecure.

@Amaurgit @paddy0174 I think @QbaF’s issue is that with a tablet, before you can connect via ADB over WiFi, you first have to connect over USB and issue the command adb tcpip 5555 (I think that’s right). And if you restart the tablet, then you’ll need to repeat that step. At least, that was the case for my Kindle Fire tablet when I tried it a year or two ago.

1 Like

Thanks @JeffLIrion. It looks like we are closer. I connected tablet to PC, get key, made adb tcpip 5555 and it is now connected to 192.168.1.71:5555. Also via WiFi

I did try to connect it as well to RPI (is it needed?), get info about charging but this time no RSA key message provided. Is it ok?
And what next steps? Supplement integration with adb server and start ADB add-on?

https://developer.android.com/studio/command-line/adb#wireless

I would try it without the add-on, using the basic config you posted in Native support for Android TV / Android devices.

It used to be the case that the Python implementation was unreliable for newer devices, making it necessary to use an ADB server (such as the add-on). But I rewrote the backend Python library used for sending ADB commands and it’s been solid for a handful of releases. At least, I haven’t heard of any issues with it. The ADB server approach is still supported because

  • I can’t guarantee that the Python ADB implementation is as reliable as using the official ADB binary (running separately and acting as a middleman)
  • Forcing people to use the Python implementation would be a breaking change
  • A small percentage of people might already have an ADB server up and running that they use for reasons outside of HA
1 Like

Working! great! Thanks @JeffLIrion, @Amaurgit and @paddy0174

Is there a chance to have more than one device over WiFi? On USB there is second device listed but when I try to do again adb tcpip 5555 i got error

error: more than one device/emulator

I just started using the Android TV integration with my Fire TV 4K stick and it works well when it works :slight_smile:

I am trying to figure out a problem where my device state goes to Unavailable and logs indicate that the Fire TV can’t be connected to. I tried both the built in python adb implementation as well as running an adb server locally. I can still ping the Fire TV so i know it’s online and I can see that the 5555 adb port is open with nmap. I try to manually connect using the adb command line and although it shows as connected, it is not listed in ‘adb devices’.

I suspect that the Fire TV might kill all adb connections after being off for some time. The only way I can get the integration working again, is to toggle the ADB Debugging setting from On to Off in the Fire TV settings. Has anyone faced a similar issue or have a suggestion here?

I have it working with a ugreen Ethernet adapter on a mibox s, I had issues with the mibox going into wifi sleep mode and only staying connected to my 2.4 wifi and Plex was suffering. The only way to get it off the 2.4 was to disable wifi and re-enable and it would connect to the right band again. The Ethernet adapter works but it’s a little finicky, basically with USB debugging enabled the adapter won’t power on you have to go into developer settings and disable USB debugging then Ethernet will connect but before you re-enable USB debugging you have to select the USB configuration and change it from charging to RNDIS (USB Ethernet) after that is selected you can enable USB debugging again and everything will work. This works perfectly until the mibox reboots and then you have to do it again. It’s not that big of a deal as it doesn’t reboot often but it does do it randomly sometimes which I am sure anyone with a mibox has experienced.

1 Like

Thanks for the reply! I’ll try to see if I can replicate that using your method.
I’ve tried all of the above, but not necessarily in that order. Spose to rain all day tomorrow anyway so maybe I can find some time to play with it.

Let me know how it goes, I’ve tested speed with it and I get a steady 200mbps x 200mbps. Just after I wrote that reply up my Plex was stuttering again even with the Ethernet connected I was only getting 20mbps, I had to reboot and reconfigure but it all worked like a charm after.

I’m facing exactly the same issue where it works fine and then all of a sudden I can’t connect and get the error message:

using Python ADB implementation with adbkey='/config/.storage/androidtv_adbkey'
Failed to call service system_log/clear. undefined

and the only way to get it working again is to turn OFF/ON ADB Debugging. Would love to know why but my python is lacking!

Anyone happen to find a way to recognize which Hdmi input a FireTV (Toshiba) is on? It seems that the “wakelock size” etc is the same for all 3 HDMI inputs… unless I am missing something

You could check here for some ideas: question: determine state of connected tv/display

1 Like

Hi,
replying to the old question, it is possible to use the addon through the ethernet port too,
just need a first connection via wifi for enable the port and to authorize the connection (remember to check the box to authorize permanently) and then in the developer menu “Select USB Configuration” and choose RNDIS (USB Ethernet) and that’s it. Little problem, the box loose this config every time reboot so you’ll see the box doesn’t have connection (Wifi is off), but it is fast to reconfigure it.

I played around with the settings and got all sources to be shown, but I don’t see all apps, for an example netflix and spotify is not shown.

I tried to ad them manually, ie “com.netflix.ninja”, but still it not shown, if I choose an available source and rename them, they are shown with my custom name. Any idea why I don’t see all apps?

Hello not sure if this is the right place but I am trying to get my amazon fire tv set up in to home assistant however, I am almost certain I have done everything right but I there is no device appearing.
Please see below for my settings.
image
image
image