Native support for Android TV / Android devices

So I think this has something to do with my “2017 Shield” androidtv entry that has the adbkey field set. I just got the RSA fingerprint of my existing key and it has the same fingerprint that keeps showing up on my new Shield. Here is my config for reference (Basement Shield TV is the shield with the issue):

media_player:
  - platform: androidtv
    name: Shield TV
    device_class: androidtv
    host: shieldtv.home
    adbkey: "/config/adbkey"
    apps:
      "com.plexapp.android": "Plex"
      "com.netflix.ninja": "Netflix"
      "com.google.android.youtube.tv": "YouTube"
      "com.amazon.amazonvideo.livingroom": "Prime Video"
      "com.alexvas.dvr.pro": "tinyCam"
      "org.jellyfin.androidtv": "Jellyfin"
      "com.liskovsoft.videomanager": "Smart Youtube"
      "com.google.android.youtube.tvunplugged": "Youtube TV"
  - platform: androidtv
    name: Basement Shield TV
    device_class: androidtv
    host: 192.168.1.34
    apps:
      "com.plexapp.android": "Plex"
      "com.netflix.ninja": "Netflix"
      "com.google.android.youtube.tv": "YouTube"
      "com.amazon.amazonvideo.livingroom": "Prime Video"
      "com.alexvas.dvr.pro": "tinyCam"
      "org.jellyfin.androidtv": "Jellyfin"
      "com.liskovsoft.videomanager": "Smart Youtube"
      "com.google.android.youtube.tvunplugged": "Youtube TV"

I think I’m going to try just using the auto-generated key for both Shields.

OK nevermind. I think I’m confused about this RSA fingerprint thing. When I run:

awk '{print $1}' < .storage/androidtv_adbkey | openssl base64 -A -d -a | openssl md5 -c

I always get back that same fingerprint, even when I regenerate the key pair and verify they’re different.

I don’t see why /config/adbkey should affect the 2019 Shield… If you set the log level for the component (homeassistant.components.androidtv.media_player) to debug, it will tell you the key that it used.

Here’s the fix: https://github.com/home-assistant/core/pull/38471

Hey Jeff,

Sorry about late response. I am running a 4k FireTV Stick. I installed the androidTV settings in my configuration.yaml after the 0.113 update(s). I am not use an adb server. I also have not forced a key but it is the same key each time. Thoughts?

It’s fixed in 0.113.4 (or 0.114 if they don’t make a 0.113.4 release). You can either wait for that release or use this custom component: https://github.com/JeffLIrion/ha-androidtv

If you use the custom component, after you tell it to remember the connection you can remove the custom component and go back to using the native component and the connection will be remembered.

1 Like

I am a n00bie on some of this. I assume I just drop this in the custom components directory? Anything else to do besides grab the code?

Yeah, that’s it. But I think that 0.113.4 should be released soon, so if you don’t use the custom component you won’t have long to wait.

1 Like

Worked perfectly btw

I’m having problems with starting some of the apps on the shield using the media_player.select_source.
The apps that are predefined by the integration work fine, but the others don’t. I’m running latest Hassio (113.3)

I have found the following app IDs: nl.nlziet, com.ziggo.tv and nl.rtl.videoland.

This does NOT work

    - service: media_player.select_source
      data:
        entity_id: media_player.nvidia_shield
        source: 'com.ziggo.tv'

This starts Netflix

    - service: media_player.select_source
      data:
        entity_id: media_player.nvidia_shield
        source: 'com.netflix.ninja'

Im pretty sure I have the correct IDs, as I extracted them with NodeRed and als the naming of the app to include it in the source list works. Is this a known error, or am I overlooking something?

@Try2Fly and anyone else trying to launch apps, try this (replace com.ziggo.tv with the app you want to launch):

- service: androidtv.adb_command
  data:
    entity_id: media_player.example
    command: "monkey -p com.ziggo.tv -c android.intent.category.LAUNCHER --pct-syskeys 0 1"
1 Like

Thanks, unfortunately that didn’t work. I get no reaction after sending the command.

Later I found a command that does work (for the Ziggo app):

command: "am start -a android.intent.action.VIEW -d -n com.ziggo.tv/.ui.splash.SplashActivity"

hello
I have MI android tv box which is connected to home-assistant via suggested integrations, so everything works but the state of android tv changes sometimes and third-party apps don’t work.
For this, I have checked the internet and found a solution via addon in ha ie ADB so, I have installed everything and also done with configuration but the problem comes here
I cannot see the new entity in states :frowning: don’t know why.
I have checked addon logs and also home assistant logs and restarted many times, everything is ok and they say connected but no entity
And by the way after addon installation, I removed previous media player integration so now even that is not coming I am struck here

how can my problem be solved, please help

did they kill 0.113.4?
how can i tell if there will be a .4?

edit* no help needed

Hello.

I have 2 FireStick 4K working via ADB connected via hass.io add-on, without too many issues (unavailability).

Still then, I found that if I use the Wireless Display functionality from Windows10 (it is what I tried in both FireSticks), once you cancel this connection, FireStick becomes immediately unavailable.

Don’t know exactly if all needed, but only got it to work properly again (back online) after rebooting the FireStick itself and then HA. Restarting the hass.io add-on didn’t seem to do the trick, for an availability perspective.

Has anyone else experienced this issue or is this something new? Can I provide any more useful info for this to be looked at?

Thanks in advance for the amazing work on this component.

I have a new Xiaomi TV Stick and connected via ADB. Source, title and state work fine but I get no artwork. Anybody seen this before?

Never mind. I used the wrong entity. The stick was picked up by the Google Cast integration as well. I had to use the androidtv media player.

@Try2Fly is this still working for you?
I don’t get it to work.

No unfortunately it does not work anymore. I’m not using it that often, and have not looked for a fix.

1 Like