Community Hass.io Add-on: ADB - Android Debug Bridge

hassio-repository
hassio-addon
Tags: #<Tag:0x00007fd073df6ee8> #<Tag:0x00007fd073df6d80>

#62

Thanx, it works!!!

And thanx to @teachingbirds for the remote code (from Github)!


#63

It works here with this config

service: media_player.androidtv_key
  data:
    entity_id: media_player.shield_tv
    key: 'KEYCODE_ENTER'

Make sure to use media_player.androidtv_key as service.


#64

I cannot get Plex to start. What intent do you use? i use

-n com.plexapp.android/com.plexapp.plex.activities.SplashActivity

i cannot get it to work.


#65

I have this entities:
tv.emby.embyatv/.startup.StartupActivity
com.nst.iptvsmarterstvbox/.view.activity.SplashActivity
Where can I add it, can’t find where hassio stores all the other entities…


#66

See my previous comment if you just want it to work without messing around too much. In short, the intent you want is (including the leading semicolon)

; am start -a android.intent.action.MAIN -c android.intent.category.LEANBACK_LAUNCHER -n com.plexapp.android/com.plexapp.plex.activities.SplashActivity

The better way is in my followup comment but requires a modified androidtv.py (here).

Really, you should use one of those methods for every app if you’re launching via an activity. The “-n” flag doesn’t really get handled the way I thought it did and the fact that it works for most apps is just luck.


#67
127|once:/ $ pm list packages | sed -e "s/package://" | while read x; do cmd package resolve-activity --brief $x | tail -n 1 | grep -v "No activity found"; done
y --brief $x | tail -n 1 | grep -v "No activity found"; done                  <
com.mxtech.videoplayer.pro/.ActivityWelcomeMX
com.plexapp.android/com.plexapp.plex.activities.SplashActivity
com.crunchyroll.crunchyroid/.ui.views.activities.SplashActivity
de.cyberdream.androidtv.notifications.google/de.cyberdream.androidtv.notifications.StartActivity
com.silicondust.view/.App
com.android.vending/com.google.android.finsky.tvmainactivity.TvMainActivity
com.google.android.tv/com.android.tv.TvActivity
com.rcreations.WebCamViewerPaid/.IpCamViewerActivity
com.android.gallery3d/.app.GalleryActivity
tv.twitch.android.app/tv.twitch.android.apps.TVLandingActivity
org.xbmc.kodi/.Splash
com.facebook.katana/.Fb4FireTVLaunchActivity
com.google.android.youtube.tv/com.google.android.apps.youtube.tv.activity.ShellActivity
com.accuweather.android/com.accuweather.accutv.core.MainActivity
com.google.android.tv.remote.service/.settings.SettingsActivity
com.netflix.ninja/.MainActivity
com.nousguide.android.rbtv/com.redbull.launch.SplashActivity
com.yodo1.crossyroad/com.unity3d.player.UnityPlayerActivity

So the HD HomeRun package is com.silicondust.view/.App But im not sure how to find out what to send to it, to go to a specific channel?

Or can I use the inbuilt android TV Channels thing and send intents to that? Im not sure how to find the intents either for that…


#68

I’ve been looking into doing the Live Channels and honestly can’t figure it out. The best I’ve gotten is opening the app with

content://android.media.tv/channel

I can get it to go to channel 1 with

content://android.media.tv/channel/1

but no other channels seem to work.

You can also open (and close) the program guide with

content://android.media.tv/program

That’s as far as I was able to get. I think the other way would be to just have a script that opens the app, types in the channel number, and hits enter.

'live_channel_nasa':
  alias: "NASA Live Channel"
  sequence:
  - service: script.live_channels
  - delay:
      milliseconds: 250
  - service: media_player.androidtv_key
    data:
      entity_id: media_player.shield_tv
      key: 13
  - service: media_player.androidtv_key
    data:
      entity_id: media_player.shield_tv
      key: 11
  - service: media_player.androidtv_key
    data:
      entity_id: media_player.shield_tv
      key: 10
  - service: media_player.androidtv_key
    data:
      entity_id: media_player.shield_tv
      key: 66

The script.live_channels just opens up the live channels app. I use a modified custom component to send the ADB command to start com.google.android.tv/com.android.tv.MainActivity, but any way that gets the app opened should work.


#69

Amazing job. Thank you for sharing this. I use most of your config for the shield and it works very well.


#70

Anyone else having issues after 0.88 with loading the custom component?


#71

Checking the config with addon I get this. Dont know how to solve it though.

Failed config
General Errors:
- Platform not found: media_player.androidtv
- Platform not found: media_player.androidtv


#72

Yeah same for me after 0.88.0


#73

Here is the migration guide for custom components: https://developers.home-assistant.io/blog/2019/02/19/the-great-migration.html
Hope it helps, I plan to upgrade to 0.88 soon.


#74

I havent upgraded yet. Just checked with addon to see what issues I would get. Fixed all but mentioned adb addon.


#75

Tried to follow the guide and changed the directory to custom_components/androidtv/media_player.py but still doesn’t work. Something I have missed?


#76

I have just recently updated to 0.87.1 and moved the component to this structure:
/config/custom_components/androidtv/media_player.py
also added an empty __init__.py file to the same folder.

The media player entity was created as before but its state was unknown. A restarted hassio host and after just sent an intent to start kodi and the media player state with attributes became available again.

I am using the latest androidtv.py from here: https://github.com/hassio-addons/addon-adb/blob/master/custom_components/media_player/androidtv.py
(changed 7 days ago)


#77

Thanks! Downloaded the latest version and now everything seems to work again!


#78

You downloaded the latest Androidtvpy. What else did you do to get it working with 88.0?


#79

I also did this


#80

I did this but I’m still getting the error. I have also updated it to the most recent version.


#81

Thanks! Works great!