Skip to content

Instantly share code, notes, and snippets.

@bobzer
Forked from mcfrojd/Shield_Intents.MD
Created May 17, 2019 01:48
Show Gist options
  • Save bobzer/6c8bb72b35659276cbda6ee5c38b9624 to your computer and use it in GitHub Desktop.
Save bobzer/6c8bb72b35659276cbda6ee5c38b9624 to your computer and use it in GitHub Desktop.
Working INTENTS to use with Community Hass.io Add-ons: Android Debug Bridge for your Nvidia Shield TV

Updated 2019-03-21 with new "intents" since hassio 0.90, ADB 0.3.0 and the new androidtv component (service "androidtv.adb_command")

Credits and thanks: Home Assistant Forum users: @ocso, @wiphye, @teachingbirds, @tboyce1, @simbesh, @JeffLIrion


Starts specific Twitch stream (If stream is live)

{"entity_id" :"media_player.shield", "command": "am start -a android.intent.action.VIEW -d twitch://stream/frenck"}
{"entity_id" :"media_player.shield", "command": "am start -a android.intent.action.VIEW -d twitch://stream/drzzs"}

Start apps on your Shield

# Starts Netflix (Shows profiles if its the first start.)
{"entity_id" :"media_player.shield", "command": "am start -a android.intent.action.VIEW -d -n com.netflix.ninja/.MainActivity"}

# Starts Twitch
{"entity_id" :"media_player.shield", "command": "am start -a android.intent.action.VIEW -d -n tv.twitch.android.app/tv.twitch.android.apps.TwitchActivity"}

# Starts TV4 Play (swedish streaming)
{"entity_id" :"media_player.shield", "command": "am start -a android.intent.action.VIEW -d -n se.tv4.tv4playtab/se.tv4.tv4play.startup.SplashActivity"}

# Starts SVT Play (swedish streaming)
{"entity_id" :"media_player.shield", "command": "am start -a android.intent.action.VIEW -d -n se.svt.android.svtplay/se.svt.svtplay.tv.ui.StartupActivity"}

# Starts Youtube App
{"entity_id" :"media_player.shield", "command": "am start -a android.intent.action.VIEW -d -n com.google.android.youtube.tv/com.google.android.apps.youtube.tv.activity.ShellActivity"}

# Starts Kodi
{"entity_id" :"media_player.shield", "command": "am start -a android.intent.action.VIEW -d -n org.xbmc.kodi/.Splash"}

Shield navigation and controlling

RIGHT   {"entity_id" :"media_player.shield", "command": "RIGHT"}
LEFT    {"entity_id" :"media_player.shield", "command": "LEFT"}
UP      {"entity_id" :"media_player.shield", "command": "UP"}
DOWN    {"entity_id" :"media_player.shield", "command": "DOWN"}
WAKE    {"entity_id" :"media_player.shield", "command": "MENU"} # use to be the "WAKEUP" command
SLEEP   {"entity_id" :"media_player.shield", "command": "SLEEP"}
ENTER   {"entity_id" :"media_player.shield", "command": "ENTER"}
BACK    {"entity_id" :"media_player.shield", "command": "BACK"}
HOME    {"entity_id" :"media_player.shield", "command": "HOME"}
PLAY    {"entity_id" :"media_player.shield", "command": "input keyevent 126"}
PAUSE   {"entity_id" :"media_player.shield", "command": "input keyevent 127"}
STOP    {"entity_id" :"media_player.shield", "command": "input keyevent 86"}

Intents i'm not using, but someone could have interest in.

(Not tested by me, but tested by people in the Home Assistant Forum.)

Hulu              {"entity_id" :"media_player.shield", "command": "am start -a android.intent.action.VIEW -d -n com.hulu.livingroomplus/.MainActivity"}
Live Channels     {"entity_id" :"media_player.shield", "command": "am start -a android.intent.action.VIEW -d -n com.google.android.tv/com.android.tv.MainActivity"}
Amazon            {"entity_id" :"media_player.shield", "command": "am start -a android.intent.action.VIEW -d -n com.amazon.amazonvideo.livingroom/com.amazon.ignition.IgnitionActivity"}
SPMC              {"entity_id" :"media_player.shield", "command": "am start -a android.intent.action.VIEW -d -n com.semperpax.spmc17/.Splash"}
Haystack          {"entity_id" :"media_player.shield", "command": "am start -a android.intent.action.VIEW -d -n com.haystack.android/.tv.ui.LoadingActivity"}
PBS               {"entity_id" :"media_player.shield", "command": "am start -a android.intent.action.VIEW -d -n com.pbs.video/.ui.main.activities.StartupActivity"}
Pluto TV          {"entity_id" :"media_player.shield", "command": "am start -a android.intent.action.VIEW -d -n tv.pluto.android/.leanback.controller.LeanbackSplashOnboardActivity"}
Spotify           {"entity_id" :"media_player.shield", "command": "am start -a android.intent.action.VIEW -d -n com.spotify.tv.android/.SpotifyTVActivity" }
HBO Go            {"entity_id" :"media_player.shield", "command": "am start -a android.intent.action.VIEW -d -n eu.hbogo.androidtv.production/eu.hbogo.androidtv.MainActivity" }
Plex              {"entity_id" :"media_player.shield", "command": "am start -a android.intent.action.VIEW -d -n com.plexapp.android/com.plexapp.plex.activities.SplashActivity" }
Perfect Player    {"entity_id" :"media_player.shield", "command": "am start -a android.intent.action.VIEW -d -n com.niklabs.pp/com.niklabs.perfectplayer.MainActivity" }
S0undTV (twtich)  {"entity_id" :"media_player.shield", "command": "am start -a android.intent.action.VIEW -d -n com.s0und.s0undtv/com.s0und.s0undtv.activities.MainActivity" }
SmartYoutubeTV:   {"entity_id" :"media_player.shield", "command": "am start -a android.intent.action.VIEW -d -n com.liskovsoft.videomanager/com.liskovsoft.smartyoutubetv.bootstrap.BootstrapActivity" }

ADB command to find out the intent from diffrent apps:

adb shell pm dump org.xbmc.kodi | grep -A 1 "MAIN" | grep org.xbmc.kodi | awk '{print $2}' | grep org.xbmc.kodi

adb shell pm dump tv.twitch.android.app | grep -A 1 "MAIN" | grep tv.twitch.android.app | awk '{print $2}' | grep tv.twitch.android.app

adb shell pm dump se.tv4.tv4playtab | grep -A 1 "MAIN" | grep se.tv4.tv4playtab | awk '{print $2}' | grep se.tv4.tv4playtab

adb shell pm dump se.svt.android.svtplay | grep -A 1 "MAIN" | grep se.svt.android.svtplay | awk '{print $2}' | grep se.svt.android.svtplay

adb shell pm dump com.google.android.youtube.tv | grep -A 1 "MAIN" | grep com.google.android.youtube.tv | awk '{print $2}' | grep com.google.android.youtube.tv

adb shell pm dump com.netflix.ninja | grep -A 1 "MAIN" | grep com.netflix.ninja | awk '{print $2}' | grep com.netflix.ninja


Tested @tboyce1 command on my Shield and this is what i came up with:

(https://community.home-assistant.io/t/community-hass-io-add-on-adb-android-debug-bridge/96375/23)

Started the consol in the ADB container in Portainer.

adb shell
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

And got this:

  • de.blinkt.openvpn/.activities.MainActivity
  • com.plexapp.android/com.plexapp.plex.activities.SplashActivity
  • com.nvidia.tegrazone3/.LaunchActivity
  • com.android.documentsui/.LauncherActivity
  • com.plexapp.mediaserver.smb/com.plexapp.mediaserver.ui.main.MainActivity
  • com.spotify.tv.android/.SpotifyTVActivity
  • com.android.vending/com.google.android.finsky.tvmainactivity.TvMainActivity
  • se.viafree.android/com.viafree.android.SplashActivity
  • com.nvidia.inputviewer/.MainActivity
  • tv.emby.embyatv/.startup.StartupActivity
  • se.tv4.tv4playtab/se.tv4.tv4play.startup.SplashActivity
  • com.android.gallery3d/.app.GalleryActivity
  • tv.twitch.android.app/tv.twitch.android.apps.TVLandingActivity
  • com.nvidia.ota/.ui.LauncherActivity
  • org.xbmc.kodi/.Splash
  • pl.solidexplorer2/pl.solidexplorer.SolidExplorer
  • com.google.android.youtube.tv/com.google.android.apps.youtube.tv.activity.ShellActivity
  • com.joaomgcd.join/.activity.ActivityMain
  • com.google.android.tv.remote.service/.settings.SettingsActivity
  • com.netflix.ninja/.MainActivity

My LoveLace Remote Card

alt text

You find all info and code here https://github.com/mcfrojd/hassio_lovelace_multiremote

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment