Instantly share code, notes, and snippets.

Embed
What would you like to do?
Working INTENTS to use with Community Hass.io Add-ons: Android Debug Bridge for your Nvidia Shield TV

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


Starts Netflix (Shows profiles if its the first start.)

{"entity_id" :"media_player.shield", "intent": "-n com.netflix.ninja/.MainActivity"}

Starts Twitch (Starts to play the stream)

{"entity_id" :"media_player.shield", "intent": "twitch://stream/frenck"}
{"entity_id" :"media_player.shield", "intent": "twitch://stream/drzzs"}

Starts Twitch

{"entity_id" :"media_player.shield", "intent": "-n tv.twitch.android.app/tv.twitch.android.apps.TVLandingActivity"}

Starts TV4 Play (swedish streaming)

{"entity_id" :"media_player.shield", "intent": "-n se.tv4.tv4playtab/se.tv4.tv4play.startup.SplashActivity"}

Starts SVT Play (swedish streaming)

{"entity_id" :"media_player.shield", "intent": "-n se.svt.android.svtplay/se.svt.svtplay.tv.ui.StartupActivity"}

Starts Youtube App

{"entity_id" :"media_player.shield", "intent": "-n com.google.android.youtube.tv/com.google.android.apps.youtube.tv.activity.ShellActivity"}

Starts Kodi

{"entity_id" :"media_player.shield", "intent": "-n org.xbmc.kodi/.Splash"}

Remote key presses

{"entity_id" :"media_player.shield", "key": "KEYCODE_DPAD_RIGHT"}
{"entity_id" :"media_player.shield", "key": "KEYCODE_DPAD_LEFT"}
{"entity_id" :"media_player.shield", "key": "KEYCODE_DPAD_UP"}
{"entity_id" :"media_player.shield", "key": "KEYCODE_DPAD_DOWN"}
{"entity_id" :"media_player.shield", "key": "KEYCODE_WAKEUP"}
{"entity_id" :"media_player.shield", "key": "KEYCODE_SLEEP"}
{"entity_id" :"media_player.shield", "key": "KEYCODE_ENTER"}
{"entity_id" :"media_player.shield", "key": "KEYCODE_BACK"}
{"entity_id" :"media_player.shield", "key": "KEYCODE_HOME"}
{"entity_id" :"media_player.shield", "key": "KEYCODE_MEDIA_PLAY"}
{"entity_id" :"media_player.shield", "key": "KEYCODE_MEDIA_PAUSE"}
{"entity_id" :"media_player.shield", "key": "KEYCODE_MEDIA_STOP"}

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", "intent": "-n com.hulu.livingroomplus/.MainActivity"}
Live Channels { "entity_id": "media_player.shield", "intent": "-n com.google.android.tv/com.android.tv.MainActivity"}
Amazon        { "entity_id": "media_player.shield", "intent": "-n com.amazon.amazonvideo.livingroom/com.amazon.ignition.IgnitionActivity"}
SPMC          { "entity_id": "media_player.shield", "intent": "-n com.semperpax.spmc17/.Splash"}
Haystack      { "entity_id": "media_player.shield", "intent": "-n com.haystack.android/.tv.ui.LoadingActivity"}
PBS           { "entity_id": "media_player.shield", "intent": "-n com.pbs.video/.ui.main.activities.StartupActivity"}
Pluto TV      { "entity_id": "media_player.shield", "intent": "-n tv.pluto.android/.leanback.controller.LeanbackSplashOnboardActivity"}
Spotify       { "entity_id": "media_player.shield", "intent": "-n com.spotify.tv.android/.SpotifyTVActivity" }
HBO Go        { "entity_id": "media_player.shield", "intent": "-n eu.hbogo.androidtv.production/eu.hbogo.androidtv.MainActivity" }
Plex          { "entity_id": "media_player.shield", "intent": "-n com.plexapp.android/com.plexapp.plex.activities.SplashActivity" }

S0undTV for twitch:
"intent":"-n com.s0und.s0undtv/com.s0und.s0undtv.activities.MainActivity"

SmartYoutubeTV:
"intent":"-n com.firsthash.smartyoutubetv2/com.liskovsoft.smartyoutubetv.bootstrap.BootstrapActivity"

Perfect Player:
"intent":"-n com.niklabs.pp/com.niklabs.perfectplayer.MainActivity"


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 need these custom cards

resources:
  - url: /local/lovelace/layout-card.js?v=a313b7
    type: js
  - url: /local/lovelace/card-tools.js?v=297fcc
    type: js
  - url: /local/lovelace/card-modder.js?v=785dd6
    type: js
########################################################################################################################
# View - remote
########################################################################################################################
title: Remote
icon: mdi:remote
cards:
#------------------------------------------------------------------
# SHIELD CONTROLLER
#------------------------------------------------------------------
  - type: custom:layout-card
    layout: vertical
    cards:
      - type: horizontal-stack
        cards:
          - type: custom:card-modder
            card:
              type: picture
              image: /local/lovelace/images/shield.png
            style:
              overflow: hidden
              padding: 10px 10px 10px 10px
              border-radius: 20px
              border: solid 1px rgba(100,100,100,0.3)
              box-shadow: 3px 3px rgba(0,0,0,0.4)
#------------------------------------------------------------------
# Rad 1
#------------------------------------------------------------------
      - type: horizontal-stack
        cards:
          - type: custom:card-modder
            card:
              type: entity-button
              icon: mdi:youtube
              name: YOUTUBE
              entity: input_boolean.shield_dummy
              hold_action: none
              tap_action:
                action: call-service
                service: media_player.androidtv_intent
                service_data:
                  entity_id: media_player.shield
                  intent: "-n com.google.android.youtube.tv/com.google.android.apps.youtube.tv.activity.ShellActivity"
            style:
              background-color: rgba(118,185,0,1)
              border-radius: 20px
              border: solid 1px rgba(100,100,100,0.3)
              box-shadow: 3px 3px rgba(0,0,0,0.4)
          - type: custom:card-modder
            card:
              type: entity-button
              icon: mdi:kodi
              name: KODI
              entity: input_boolean.shield_dummy
              hold_action: none
              tap_action:
                action: call-service
                service: media_player.androidtv_intent
                service_data:
                  entity_id: media_player.shield
                  intent: "-n org.xbmc.kodi/.Splash"
            style:
              background-color: rgba(118,185,0,1)
              border-radius: 20px
              border: solid 1px rgba(100,100,100,0.3)
              box-shadow: 3px 3px rgba(0,0,0,0.4)
          - type: custom:card-modder
            card:
              type: entity-button
              icon: mdi:twitch
              name: TWITCH
              entity: input_boolean.shield_dummy
              hold_action: none
              tap_action:
                action: call-service
                service: media_player.androidtv_intent
                service_data:
                  entity_id: media_player.shield
                  intent: "-n tv.twitch.android.app/tv.twitch.android.apps.TVLandingActivity"
            style:
              background-color: rgba(118,185,0,1)
              border-radius: 20px
              border: solid 1px rgba(100,100,100,0.3)
              box-shadow: 3px 3px rgba(0,0,0,0.4)
          - type: custom:card-modder
            card:
              type: entity-button
              icon: mdi:netflix
              name: NETFLIX
              entity: input_boolean.shield_dummy
              hold_action: none
              tap_action:
                action: call-service
                service: media_player.androidtv_intent
                service_data:
                  entity_id: media_player.shield
                  intent: "-n com.netflix.ninja/.MainActivity"
            style:
              background-color: rgba(118,185,0,1)
              border-radius: 20px
              border: solid 1px rgba(100,100,100,0.3)
              box-shadow: 3px 3px rgba(0,0,0,0.4)
          - type: custom:card-modder
            card:
              type: entity-button
              icon: mdi:youtube
              name: TV4PLAY
              entity: input_boolean.shield_dummy
              hold_action: none
              tap_action:
                action: call-service
                service: media_player.androidtv_intent
                service_data:
                  entity_id: media_player.shield
                  intent: "-n se.tv4.tv4playtab/se.tv4.tv4play.startup.SplashActivity"
            style:
              background-color: rgba(118,185,0,1)
              border-radius: 20px
              border: solid 1px rgba(100,100,100,0.3)
              box-shadow: 3px 3px rgba(0,0,0,0.4)
#------------------------------------------------------------------
# Rad 2
#------------------------------------------------------------------
      - type: horizontal-stack
        cards:
          - type: custom:card-modder
            card:
              type: entity-button
              icon: mdi:power
              name: "ON"
              entity: input_boolean.shield_dummy
              hold_action: none
              tap_action:
                action: call-service
                service: media_player.androidtv_key
                service_data:
                  entity_id: media_player.shield
                  key: KEYCODE_WAKEUP
            style:
              background-color: rgba(118,185,0,1)
              border-radius: 20px
              border: solid 1px rgba(100,100,100,0.3)
              box-shadow: 3px 3px rgba(0,0,0,0.4)
          - type: custom:card-modder
            card:
              type: entity-button
              icon: mdi:arrow-up-bold
              name: "UP"
              entity: input_boolean.shield_dummy
              hold_action: none
              tap_action:
                action: call-service
                service: media_player.androidtv_key
                service_data:
                  entity_id: media_player.shield
                  key: KEYCODE_DPAD_UP
            style:
              background-color: rgba(118,185,0,1)
              border-radius: 20px
              border: solid 1px rgba(100,100,100,0.3)
              box-shadow: 3px 3px rgba(0,0,0,0.4)
          - type: custom:card-modder
            card:
              type: entity-button
              icon: mdi:power-off
              name: "OFF"
              entity: input_boolean.shield_dummy
              hold_action: none
              tap_action:
                action: call-service
                service: media_player.androidtv_key
                service_data:
                  entity_id: media_player.shield
                  key: KEYCODE_SLEEP
            style:
              background-color: rgba(118,185,0,1)
              border-radius: 20px
              border: solid 1px rgba(100,100,100,0.3)
              box-shadow: 3px 3px rgba(0,0,0,0.4)
#------------------------------------------------------------------
# Rad 3
#------------------------------------------------------------------
      - type: horizontal-stack
        cards:
          - type: custom:card-modder
            card:
              type: entity-button
              icon: mdi:arrow-left-bold
              name: "LEFT"
              entity: input_boolean.shield_dummy
              hold_action: none
              tap_action:
                action: call-service
                service: media_player.androidtv_key
                service_data:
                  entity_id: media_player.shield
                  key: KEYCODE_DPAD_LEFT
            style:
              background-color: rgba(118,185,0,1)
              border-radius: 20px
              border: solid 1px rgba(100,100,100,0.3)
              box-shadow: 3px 3px rgba(0,0,0,0.4)
          - type: custom:card-modder
            card:
              type: entity-button
              icon: mdi:camera-control
              name: "ENTER"
              entity: input_boolean.shield_dummy
              hold_action: none
              tap_action:
                action: call-service
                service: media_player.androidtv_key
                service_data:
                  entity_id: media_player.shield
                  key: KEYCODE_ENTER
            style:
              background-color: rgba(118,185,0,1)
              border-radius: 20px
              border: solid 1px rgba(100,100,100,0.3)
              box-shadow: 3px 3px rgba(0,0,0,0.4)
          - type: custom:card-modder
            card:
              type: entity-button
              icon: mdi:arrow-right-bold
              name: "RIGHT"
              entity: input_boolean.shield_dummy
              hold_action: none
              tap_action:
                action: call-service
                service: media_player.androidtv_key
                service_data:
                  entity_id: media_player.shield
                  key: KEYCODE_DPAD_RIGHT
            style:
              background-color: rgba(118,185,0,1)
              border-radius: 20px
              border: solid 1px rgba(100,100,100,0.3)
              box-shadow: 3px 3px rgba(0,0,0,0.4)
#------------------------------------------------------------------
# Rad 4
#------------------------------------------------------------------
      - type: horizontal-stack
        cards:
          - type: custom:card-modder
            card:
              type: entity-button
              icon: mdi:backburger
              name: "BACK"
              entity: input_boolean.shield_dummy
              hold_action: none
              tap_action:
                action: call-service
                service: media_player.androidtv_key
                service_data:
                  entity_id: media_player.shield
                  key: KEYCODE_BACK
            style:
              background-color: rgba(118,185,0,1)
              border-radius: 20px
              border: solid 1px rgba(100,100,100,0.3)
              box-shadow: 3px 3px rgba(0,0,0,0.4)
          - type: custom:card-modder
            card:
              type: entity-button
              icon: mdi:arrow-down-bold
              name: "DOWN"
              entity: input_boolean.shield_dummy
              hold_action: none
              tap_action:
                action: call-service
                service: media_player.androidtv_key
                service_data:
                  entity_id: media_player.shield
                  key: KEYCODE_DPAD_DOWN
            style:
              background-color: rgba(118,185,0,1)
              border-radius: 20px
              border: solid 1px rgba(100,100,100,0.3)
              box-shadow: 3px 3px rgba(0,0,0,0.4)
          - type: custom:card-modder
            card:
              type: entity-button
              icon: mdi:home-circle
              name: "HOME"
              entity: input_boolean.shield_dummy
              hold_action: none
              tap_action:
                action: call-service
                service: media_player.androidtv_key
                service_data:
                  entity_id: media_player.shield
                  key: KEYCODE_HOME
            style:
              background-color: rgba(118,185,0,1)
              border-radius: 20px
              border: solid 1px rgba(100,100,100,0.3)
              box-shadow: 3px 3px rgba(0,0,0,0.4)
#------------------------------------------------------------------
# Rad 5
#------------------------------------------------------------------
      - type: horizontal-stack
        cards:
          - type: custom:card-modder
            card:
              type: entity-button
              icon: mdi:play
              name: "PLAY"
              entity: input_boolean.shield_dummy
              hold_action: none
              tap_action:
                action: call-service
                service: media_player.androidtv_key
                service_data:
                  entity_id: media_player.shield
                  key: KEYCODE_MEDIA_PLAY
            style:
              background-color: rgba(118,185,0,1)
              border-radius: 20px
              border: solid 1px rgba(100,100,100,0.3)
              box-shadow: 3px 3px rgba(0,0,0,0.4)
          - type: custom:card-modder
            card:
              type: entity-button
              icon: mdi:play-pause
              name: "PAUSE"
              entity: input_boolean.shield_dummy
              hold_action: none
              tap_action:
                action: call-service
                service: media_player.androidtv_key
                service_data:
                  entity_id: media_player.shield
                  key: KEYCODE_MEDIA_PAUSE
            style:
              background-color: rgba(118,185,0,1)
              border-radius: 20px
              border: solid 1px rgba(100,100,100,0.3)
              box-shadow: 3px 3px rgba(0,0,0,0.4)
          - type: custom:card-modder
            card:
              type: entity-button
              icon: mdi:stop
              name: "STOP"
              entity: input_boolean.shield_dummy
              hold_action: none
              tap_action:
                action: call-service
                service: media_player.androidtv_key
                service_data:
                  entity_id: media_player.shield
                  key: KEYCODE_MEDIA_STOP
            style:
              background-color: rgba(118,185,0,1)
              border-radius: 20px
              border: solid 1px rgba(100,100,100,0.3)
              box-shadow: 3px 3px rgba(0,0,0,0.4)
#---------------------------------------------------------
@simbesh

This comment has been minimized.

Copy link

simbesh commented Feb 15, 2019

Hi @mcfrojd, since you added these intents the package for "smart youtube tv" has changed here is the new working intent for the latest version. I forked your gist, updated the intent and reformatted my 3 intents to be the same as the ones above
for you to easily update:
https://gist.github.com/simbesh/7b714ca25a68eb35f4fdd5c4226dc5aa

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