Skip to content

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

Latest Update 2021-03-06 : New image showing the new "Services" in Home Assistant and got some tips from the comments below.

Credits and thanks: Home Assistant Forum users & Github users: @ocso, @wiphye, @teachingbirds, @tboyce1, @simbesh, @JeffLIrion @ff12 @rebmemer @siaox @DiederikvandenB @Thebuz @clapbr @Finsterclown


Start apps on your android device (in the examples below, my Nvidia Shield TV) from Home Assistant

alt text

Starts Youtube App

entity_id: media_player.shield
command: >-
  am start -a android.intent.action.VIEW -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 -n
  org.xbmc.kodi/.Splash

Starts Twitch

entity_id: media_player.shield
command: >-
  am start -a android.intent.action.VIEW -n
  tv.twitch.android.app/tv.twitch.android.apps.TwitchActivity

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


entity_id: media_player.shield
command: >-
  am start -a android.intent.action.VIEW -n
  android.intent.action.VIEW -d -n com.netflix.ninja/.MainActivity

Starts TV4 Play (swedish streaming)

entity_id: media_player.shield
command: >-
  am start -a android.intent.action.VIEW -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 -n
  se.svt.android.svtplay/se.svt.svtplay.tv.ui.StartupActivity

Starts C More (swedish streaming)

entity_id: media_player.shield
command: >-
  am start -a android.intent.action.VIEW -n
  se.cmore.bonnier/.androidtv.splash.TvConfigurationActivity

Starts ViaPlay (swedish streaming)

entity_id: media_player.shield
command: >-
  am start -a android.intent.action.VIEW -n
  com.viaplay.android/.features.home.HomeActivity

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

KILL apps on your Shield from Home Assistant

Kills YOUTUBE App

entity_id: media_player.shield
command: >-
  am force-stop
  com.google.android.youtube.tv

Kills KODI App

entity_id: media_player.shield
command: >-
  am force-stop
  org.xbmc.kodi

Kills TWITCH App

entity_id: media_player.shield
command: >-
  am force-stop
  tv.twitch.android.app

Kills NETFLIX App

entity_id: media_player.shield
command: >-
  am force-stop
  com.netflix.ninja

Kills SVT PLAY App

entity_id: media_player.shield
command: >-
  am force-stop
  se.svt.android.svtplay

Kills TV4 PLAY App

entity_id: media_player.shield
command: >-
  am force-stop
  se.tv4.tv4playtab

Kills C MORE App

entity_id: media_player.shield
command: >-
  am force-stop
  se.cmore.bonnier

Install apps on your Android Device from Home Assistant

Not tested my self, but tips from https://gist.github.com/JeffLIrion

entity_id: media_player.fire_tv_living_room
command: >-
  pm install -r /sdcard/Download/something.apk

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.)

Starts Hulu App

entity_id: media_player.shield
command: >-
  am start -a android.intent.action.VIEW -n
  com.hulu.livingroomplus/.MainActivity

Starts Live Channels App

entity_id: media_player.shield
command: >-
  am start -a android.intent.action.VIEW -n
  com.google.android.tv/com.android.tv.MainActivity

Starts Amazon App

entity_id: media_player.shield
command: >-
  am start -a android.intent.action.VIEW -n
  com.amazon.amazonvideo.livingroom/com.amazon.ignition.IgnitionActivity

Starts SPMC App

entity_id: media_player.shield
command: >-
  am start -a android.intent.action.VIEW -n
  com.semperpax.spmc17/.Splash

Starts Haystack App

entity_id: media_player.shield
command: >-
  am start -a android.intent.action.VIEW -n
  com.haystack.android/.tv.ui.LoadingActivity

Starts PBS App

entity_id: media_player.shield
command: >-
  am start -a android.intent.action.VIEW -n
  com.pbs.video/.ui.main.activities.StartupActivity

Starts Pluto TV App

entity_id: media_player.shield
command: >-
  am start -a android.intent.action.VIEW -n
  tv.pluto.android/.leanback.controller.LeanbackSplashOnboardActivity

Starts Spotify App

entity_id: media_player.shield
command: >-
  am start -a android.intent.action.VIEW -n
  com.spotify.tv.android/.SpotifyTVActivity

Starts HBO Go App

entity_id: media_player.shield
command: >-
  am start -a android.intent.action.VIEW -n
  eu.hbogo.androidtv.production/eu.hbogo.androidtv.MainActivity

Starts Plex App

entity_id: media_player.shield
command: >-
  am start -a android.intent.action.VIEW -n
  com.plexapp.android/com.plexapp.plex.activities.SplashActivity

Starts Perfect Player App

entity_id: media_player.shield
command: >-
  am start -a android.intent.action.VIEW -n
  com.niklabs.pp/com.niklabs.perfectplayer.MainActivity

Starts S0undTV (twtich) App

entity_id: media_player.shield
command: >-
  am start -a android.intent.action.VIEW -n
  com.s0und.s0undtv/com.s0und.s0undtv.activities.MainActivity

Starts SmartYoutubeTV App

entity_id: media_player.shield
command: >-
  am start -a android.intent.action.VIEW -n
  com.liskovsoft.videomanager/com.liskovsoft.smartyoutubetv.bootstrap.BootstrapActivity

Starts Steam Link App

entity_id: media_player.shield
command: >-
  am start -a android.intent.action.VIEW -n
  com.valvesoftware.steamlink/com.valvesoftware.steamlink.SteamShellActivity

Starts Ziggo TV App

entity_id: media_player.shield
command: >-
  am start -a android.intent.action.VIEW -n
  com.ziggo.tv/com.lgi.horizongo.core.activity.splash.SplashActivity

Starts Tivimate/ImPlayer App

entity_id: media_player.shield
command: >-
  am start -a android.intent.action.VIEW -n
  ar.tvplayer.tv/.ui.MainActivity

Show local video with KODI

entity_id: media_player.shield
command: >-
  am start -a android.intent.action.VIEW -d
  file:///storage/emulated/0/Android/data/files/sunrise.mp4 -n
  org.xbmc.kodi/.Splash

RTSP stream with VLC

entity_id: media_player.shield
command: >-
  am start -a android.intent.action.VIEW -d
  rtsp://user:password@192.168.1.X:XXX/Streaming/Channels/301 -n
  org.videolan.vlc/.gui.video.VideoPlayerActivity

Intents to change the HDMI input on TVs with Android TV built in (@Thebuz)

HW1-9 Represent various inputs, 1-4 maybe for composite etc. depending on the model of TV

HDMI 1

adb shell am start -a android.intent.action.VIEW -d content://android.media.tv/passthrough/com.mediatek.tvinput%2F.hdmi.HDMIInputService%2FHW5 -n org.droidtv.playtv/.PlayTvActivity -f 0x10000000

HDMI 2

adb shell am start -a android.intent.action.VIEW -d content://android.media.tv/passthrough/com.mediatek.tvinput%2F.hdmi.HDMIInputService%2FHW6 -n org.droidtv.playtv/.PlayTvActivity -f 0x10000000

HDMI 3

adb shell am start -a android.intent.action.VIEW -d content://android.media.tv/passthrough/com.mediatek.tvinput%2F.hdmi.HDMIInputService%2FHW7 -n org.droidtv.playtv/.PlayTvActivity -f 0x10000000

HDMI 4

adb shell am start -a android.intent.action.VIEW -d content://android.media.tv/passthrough/com.mediatek.tvinput%2F.hdmi.HDMIInputService%2FHW8 -n org.droidtv.playtv/.PlayTvActivity -f 0x10000000

ADB commands to find out the intent from diffrent apps:

(what is the command to use to start the app?)

I got a lot of help from people in this thread: https://community.home-assistant.io/t/android-tv-hdmi/234411/28

Use SSH & Web Terminal add-on in Home Assistant with "protection mode" off

alt text

First access the adb container:

docker exec -it addon_a0d7b954_adb /bin/bash

And the run the command:

adb shell pm dump $package | grep -A 1 "MAIN" | grep $package | awk '{print $2}' | grep $package

(Replace $package with the app ID.)

Some pre filled commands for some popular 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

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

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


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

(command to list some of the intents thats running on your device)

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

Use SSH & Web Terminal add-on in Home Assistant with "protection mode" off

alt text

First access the adb container:

docker exec -it addon_a0d7b954_adb /bin/bash

And the run the command:

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


Credit to @clapbr

Sharing the method I've been using to use the search function on Shield directly from HA/Lovelace. Works well for a bunch of stuff, including Netflix (search example: "Vikings on Netflix")

configuration.yaml

input_text:
  androidtv_search_input:
    name: Android Search

scripts.yaml

'atvsearchscript':
  alias: Android TV Search
  sequence:
  - data_template:
      command: am start -a "android.search.action.GLOBAL_SEARCH" --es query "{{ states('input_text.androidtv_search_input')}}"
      entity_id: media_player.shield
    service: androidtv.adb_command

Lovelace raw

      - entities:
          - entity: input_text.androidtv_search_input
            type: 'custom:text-input-row'
          - action_name: Search Android TV
            icon: 'mdi:television-classic'
            name: ' '
            service: script.atvsearchscript
            type: call-service

Credit to @JeffLIrion

How to start a Wyze cam RTSP stream in VLC:

"dumpsys power | grep mWakefulness | grep -qv Awake && input keyevent 4; CURRENT_APP=$(dumpsys window windows | grep mCurrentFocus) && CURRENT_APP=${CURRENT_APP#*{* * } && CURRENT_APP=${CURRENT_APP%%/*} && if [ $CURRENT_APP != 'org.videolan.vlc' ]; then monkey -p org.videolan.vlc -c android.intent.category.LAUNCHER 1 && sleep 3; fi; am start -a android.intent.action.VIEW  -d  rtsp://USER:PASSWORD@192.168.0.42/live"

Change the user, password, and IP address in the last part of that command.


@simbesh

This comment has been minimized.

Copy link

@simbesh 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

@mcfrojd

This comment has been minimized.

Copy link
Owner Author

@mcfrojd mcfrojd commented Feb 26, 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

Thanks, i have updated my page now :-)

@AndersTao

This comment has been minimized.

Copy link

@AndersTao AndersTao commented Mar 7, 2019

Hi @mcfrojd, are you able to start plex with the intent ?
{ "entity_id": "media_player.shield", "intent": "-n com.plexapp.android/com.plexapp.plex.activities.SplashActivity" }

The only way I have found working with plex, is the monkey command
adb shell monkey -p com.plexapp.android -c android.intent.category.LAUNCHER 1
But I have not found a way to send this command from HA

@jokke72

This comment has been minimized.

Copy link

@jokke72 jokke72 commented Mar 14, 2019

I'm trying to connect from my mac to my nVidia Shield with adb but it says its offline.
I have the latest platform-tools installed. I issued the following commands:

$ adb kill-server
$ adb start-server
$ adb connect 192.168.1.129:5037
failed to connect to 192.168.1.129:5037
$ adb connect 192.168.1.129:5037
already connected to 192.168.1.129:5037
$ adb devices
List of devices attached
192.168.1.129:5037	offline

What should i do that i can get a list of intents on my nVidia Shield?

My Hassio is running on a Ubuntu 18.0.4 LTS server
I have installed ADB - Android Debug Bridge and that is working fine.
I even got the multiremote nVidia part working

@mcfrojd

This comment has been minimized.

Copy link
Owner Author

@mcfrojd mcfrojd commented Mar 21, 2019

Hi @mcfrojd, are you able to start plex with the intent ?
{ "entity_id": "media_player.shield", "intent": "-n com.plexapp.android/com.plexapp.plex.activities.SplashActivity" }

The only way I have found working with plex, is the monkey command
adb shell monkey -p com.plexapp.android -c android.intent.category.LAUNCHER 1
But I have not found a way to send this command from HA

I dont run plex, so i have not tested that command, maybe the new command
{"entity_id" :"media_player.shield", "command": "am start -a android.intent.action.VIEW -d -n com.plexapp.android/com.plexapp.plex.activities.SplashActivity" } works?

@mcfrojd

This comment has been minimized.

Copy link
Owner Author

@mcfrojd mcfrojd commented Mar 21, 2019

I'm trying to connect from my mac to my nVidia Shield with adb but it says its offline.
I have the latest platform-tools installed. I issued the following commands:

$ adb kill-server
$ adb start-server
$ adb connect 192.168.1.129:5037
failed to connect to 192.168.1.129:5037
$ adb connect 192.168.1.129:5037
already connected to 192.168.1.129:5037
$ adb devices
List of devices attached
192.168.1.129:5037	offline

What should i do that i can get a list of intents on my nVidia Shield?

My Hassio is running on a Ubuntu 18.0.4 LTS server
I have installed ADB - Android Debug Bridge and that is working fine.
I even got the multiremote nVidia part working

I think i saw that you have solved this issue in the community forum?

@mcfrojd

This comment has been minimized.

Copy link
Owner Author

@mcfrojd mcfrojd commented Mar 21, 2019

If you post a question here it might take a while to get an answer, i dont get any notification when someone comments here.
Please contact / include me (@mcfrojd) in a community forum thread instead, then i will get the notification.

@AndersTao

This comment has been minimized.

Copy link

@AndersTao AndersTao commented Mar 22, 2019

Hi @mcfrojd, are you able to start plex with the intent ?
{ "entity_id": "media_player.shield", "intent": "-n com.plexapp.android/com.plexapp.plex.activities.SplashActivity" }

The only way I have found working with plex, is the monkey command
adb shell monkey -p com.plexapp.android -c android.intent.category.LAUNCHER 1
But I have not found a way to send this command from HA

Update
To keep all information togethere, this is my working script, to launch plex on my shield
HA 0.91
ADB 0.3.0

script:
  adb_open_plex:
    sequence:
      - service: androidtv.adb_command
        data:
          entity_id: media_player.shield
          command: "monkey -p com.plexapp.android -c android.intent.category.LAUNCHER 1"
@qingdong830

This comment has been minimized.

Copy link

@qingdong830 qingdong830 commented Mar 27, 2019

you can also use Tasker to perform intent, use mqtt as tunnel instead of adb

@garywilson4

This comment has been minimized.

Copy link

@garywilson4 garywilson4 commented Apr 6, 2019

is there a problem with this now i used to have it working now it doesn't

- id: '1554543074146'
  alias: Frenck Streaming
  trigger:
  - entity_id: sensor.frenck
    from: offline
    platform: state
    to: streaming
  condition:
  - after: 07:00:00
    before: '23:00:00'
    condition: time
  action:
  - data:
      command: am start -a android.intent.action.VIEW -d twitch://stream/frenck
      entity_id: media_player.firetv_1
    service: androidtv.adb_command 

this is my automation. Like i say it worked when i first set it up now i get nothing
i've also tried just calling the service and nothing there either

@kaijk

This comment has been minimized.

Copy link

@kaijk kaijk commented Apr 16, 2019

Here's an entity-button card example I'm using to turn on Plex (or whatever) based on either of my two FireTV instances:

              - type: custom:card-modder
                style:
                  background-color: rgba(56,60,69,1)
                  border-radius: 20px
                  border: solid 3px rgba(118,185,0,1)
                  box-shadow: 3px 3px rgba(0,0,0,0.4)
                card:
                  type: custom:config-template-card
                  variables:
                    - states['input_select.firetv_choices'].state
                  entities:
                    - input_select.firetv_choices
                  card:
                    type: custom:hui-entity-button-card # add "custom:" "hui-" and "-card" fore and aft of standard card names for the config-template-card
                    entity: "${vars[0] === 'FireTV Living Room' ? 'media_player.firetv_living_room' : 'media_player.firetv_bedroom'}"
                    icon: mdi:plex
                    name: PLEX
                    hold_action: none
                    tap_action:
                      action: call-service
                      service: androidtv.adb_command
                      service_data:
                        command: "monkey -p com.plexapp.android -c android.intent.category.LAUNCHER 1"
@mcfrojd

This comment has been minimized.

Copy link
Owner Author

@mcfrojd mcfrojd commented Apr 18, 2019

@garywilson4 Im not sure, and have not tested my self, but maybe try to add "-n" after "-d"

@mcfrojd

This comment has been minimized.

Copy link
Owner Author

@mcfrojd mcfrojd commented Apr 18, 2019

Updated the Twitch intent since a upgrade of the twitch app made the old one stop working.

@mcfrojd

This comment has been minimized.

Copy link
Owner Author

@mcfrojd mcfrojd commented Apr 18, 2019

Regarding Plex, i dont run plex my self so i have not been testing those intents out.

@j1mmyjones

This comment has been minimized.

Copy link

@j1mmyjones j1mmyjones commented May 19, 2019

Hello Complete noob to android intent here. After playing with it for a few hours i finally got it to work and its awesome. Iwas wondering if there is an intent to start HD Homerun app on shield tv? Can someone please share with me?

GOT IT!!! I Run this as a script and it loads everytime

`shield_hdhr:
alias: "HD HomeRun"
sequence:

  • service: androidtv.adb_command
    data:
    entity_id: media_player.nvidia_shield
    command: 'am start --user 0 -n "com.silicondust.view/.App"'`
@mcfrojd

This comment has been minimized.

Copy link
Owner Author

@mcfrojd mcfrojd commented Jun 12, 2019

The command/intent you have for plex wasn't working for me. It kept showing the Plex splash screen and then crashing.
This is working for me:
{"entity_id": "media_player.nvidia_shield", "command": "am start -a android.intent.action.VIEW -d -n com.plexapp.android/com.plexapp.plex.activities.SplashActivity"}

That is the same that i have execpt for the entity_id

@onkytonk

This comment has been minimized.

Copy link

@onkytonk onkytonk commented Jun 12, 2019

The command/intent you have for plex wasn't working for me. It kept showing the Plex splash screen and then crashing.
This is working for me:
{"entity_id": "media_player.nvidia_shield", "command": "am start -a android.intent.action.VIEW -d -n com.plexapp.android/com.plexapp.plex.activities.SplashActivity"}

That is the same that i have execpt for the entity_id

Deleted my comment. I don't know why but when I first tried your intent, I changed the entity ID, and it still wasn't working. I copied something from the forums, and it worked. Thanks though!

@s3frank

This comment has been minimized.

Copy link

@s3frank s3frank commented Jun 15, 2019

How would you access settings for sound using ADB? I am trying to figure out how to change the Surround mode using a command as I sometimes need it to be on "Always" and sometimes on "Auto". I would love to know how to do this via an ADB command so I can fully automate this. Thanks for any and all hints in advance!

@fourtrax01

This comment has been minimized.

Copy link

@fourtrax01 fourtrax01 commented Nov 10, 2019

Anyone know the intent for launching pandora? Even better to launch it to a certain station?

@Mikii67

This comment has been minimized.

Copy link

@Mikii67 Mikii67 commented Nov 17, 2019

Hi there. Is there a way to change the Bravia's network settings over adb? Thank you.

@mcfrojd

This comment has been minimized.

Copy link
Owner Author

@mcfrojd mcfrojd commented Nov 18, 2019

How would you access settings for sound using ADB? I am trying to figure out how to change the Surround mode using a command as I sometimes need it to be on "Always" and sometimes on "Auto". I would love to know how to do this via an ADB command so I can fully automate this. Thanks for any and all hints in advance!

Im sorry but i am not a very good ADB user, all the info posted above is either my "trial & error" attempts or someone else's contribution.

@mcfrojd

This comment has been minimized.

Copy link
Owner Author

@mcfrojd mcfrojd commented Nov 18, 2019

Hi there. Is there a way to change the Bravia's network settings over adb? Thank you.

Im sorry but i am not a very good ADB user, all the info posted above is either my "trial & error" attempts or someone else's contribution.

@mcfrojd

This comment has been minimized.

Copy link
Owner Author

@mcfrojd mcfrojd commented Nov 18, 2019

Anyone know the intent for launching pandora? Even better to launch it to a certain station?

I dont have Pandora, but you might be able to use the command examples above to figure that out. (edit to match pandora app)
(https://gist.github.com/mcfrojd/9e6875e1db5c089b1e3ddeb7dba0f304#adb-command-to-find-out-the-intent-from-diffrent-apps)

@mcfrojd

This comment has been minimized.

Copy link
Owner Author

@mcfrojd mcfrojd commented Dec 28, 2019

Added info about the streaming channel C More

@empenoso

This comment has been minimized.

Copy link

@empenoso empenoso commented Dec 31, 2019

This is a lot of work! Thanks!

@lukaszradziak

This comment has been minimized.

Copy link

@lukaszradziak lukaszradziak commented Feb 4, 2020

Is it possible to control Shield TV via http without adb?

@rapedapeda

This comment has been minimized.

Copy link

@rapedapeda rapedapeda commented Feb 7, 2020

I have the same setup with the shield. So thanks for all the helpful intents! I am wondering if it would be possible to turn off the tv (screen) with a command from home-assistant. So, shield keeps playing (spotify, for instance) over my speakers (not tv speakers), but the tv turns off? The triggers etc are fine to put in an automation, but I cannot wrap my head around a function to disable/turn off the tv screen.

@mcfrojd

This comment has been minimized.

Copy link
Owner Author

@mcfrojd mcfrojd commented Feb 7, 2020

Is it possible to control Shield TV via http without adb?

Not that i know of.

@mcfrojd

This comment has been minimized.

Copy link
Owner Author

@mcfrojd mcfrojd commented Feb 7, 2020

I have the same setup with the shield. So thanks for all the helpful intents! I am wondering if it would be possible to turn off the tv (screen) with a command from home-assistant. So, shield keeps playing (spotify, for instance) over my speakers (not tv speakers), but the tv turns off? The triggers etc are fine to put in an automation, but I cannot wrap my head around a function to disable/turn off the tv screen.

Probably depends on your tv.
I run a Broadlink RM mini 3 to control my TV and cant control it via the ADB and android tv way.
And since i run my audio optically from my tv to my sonos bar i would loose sound if i turned of the tv.

@mcfrojd

This comment has been minimized.

Copy link
Owner Author

@mcfrojd mcfrojd commented Mar 22, 2020

Added some commands to kill your running app on the Shield.
Some apps (ex twitch) if you are running a stream, and then change to another app (ex youtube) with the ADB command, the twitch stream will continue to run in the twitch app, so next time you start twitch, that stream will still be on.

@JeffLIrion

This comment has been minimized.

Copy link

@JeffLIrion JeffLIrion commented Mar 22, 2020

Can you add this command to install an APK:

entity_id: media_player.fire_tv_living_room
command: "pm install -r /sdcard/Download/something.apk"

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

@jriker1

This comment has been minimized.

Copy link

@jriker1 jriker1 commented Apr 4, 2020

OK so I took the service image above under developer tools and tested it out with my NVidia Shield.

Put in androidtv.adb_command for the service

Put in media_player.family_room_nvidia_shield for the entity

For Service Data put in the whole block: {"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"}

Sure enough my NVidia changed to YouTutbe.

Trying to duplicate that in my Lovelace code.

So when I do:

                tap_action:
                  action: call-service
                  service: androidtv.adb_command
                  service_data:
                    command: 'am start -a android.intent.action.VIEW -d -n com.google.android.youtube.tv/com.google.android.apps.youtube.tv.activity.ShellActivity'

OR even the full intent with the entity_id and all if that's the right term it keeps telling me data missing. Thoughts?

JR

@mcfrojd

This comment has been minimized.

Copy link
Owner Author

@mcfrojd mcfrojd commented Apr 4, 2020

it keeps telling me data missing.

Heres what i used before:

tap_action:
  action: call-service
  service: androidtv.adb_command
  service_data:
    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"

@DoubleAmperSand

This comment has been minimized.

Copy link

@DoubleAmperSand DoubleAmperSand commented May 2, 2020

When using ADB commands to handle navigation is there anyway to eliminate the lag between button presses ?
for instance if you navigate through a Plex library pressing left and right multiple times results in delayed presses with a delay between the presses often I will have to stop and wait for it to catch up it make navigation painfully slow and unusable.

@mcfrojd

This comment has been minimized.

Copy link
Owner Author

@mcfrojd mcfrojd commented May 4, 2020

When using ADB commands to handle navigation is there anyway to eliminate the lag between button presses ?
for instance if you navigate through a Plex library pressing left and right multiple times results in delayed presses with a delay between the presses often I will have to stop and wait for it to catch up it make navigation painfully slow and unusable.

Not that i know of.

@pplucky

This comment has been minimized.

Copy link

@pplucky pplucky commented Jul 17, 2020

On both my Amazon FireStick 4K, Youtube intent seems to have changed from "com.google.android.youtube.tv/com.google.android.apps.youtube.tv.activity.ShellActivity" to "com.amazon.firetv.youtube/dev.cobalt.app.MainActivity". Can you please check?

@mcfrojd

This comment has been minimized.

Copy link
Owner Author

@mcfrojd mcfrojd commented Jul 20, 2020

On both my Amazon FireStick 4K, Youtube intent seems to have changed from "com.google.android.youtube.tv/com.google.android.apps.youtube.tv.activity.ShellActivity" to "com.amazon.firetv.youtube/dev.cobalt.app.MainActivity". Can you please check?

Im sorry but i dont own any amazon device.

@CaptainSweatpants

This comment has been minimized.

Copy link

@CaptainSweatpants CaptainSweatpants commented Jul 22, 2020

I hate to be the guy asking for intent answers as i like to figure things out myself; but I’m trying to get the launch intents for com.disney.disneyplus: "Disney +"
ca.bellmedia.cravetv: "Crave TV"
com.amazon.amazonvideo.livingroom: "Amazon Prime Video"

but I’m having trouble getting the intent with the command listed above under “ ADB command to find out the intent from diffrent apps: “

Is this run through HA’s Service tab in dev tools? Because its not returning any result no matter what i try.

Appreciate any assistance.

@pplucky

This comment has been minimized.

Copy link

@pplucky pplucky commented Jul 22, 2020

Is this run through HA’s Service tab in dev tools? Because its not returning any result no matter what i try.

Yes, it can be.

Run service androidtv.adb_command, provide entity corresponding to your device and then add:
command: "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"

This works perfectly on my FireStick 4K and I get a list of intents for the installed apps, in attribute adb_response for the entity corresponding to your device (same you used above in the service call).

@pplucky

This comment has been minimized.

Copy link

@pplucky pplucky commented Jul 22, 2020

On both my Amazon FireStick 4K, Youtube intent seems to have changed from "com.google.android.youtube.tv/com.google.android.apps.youtube.tv.activity.ShellActivity" to "com.amazon.firetv.youtube/dev.cobalt.app.MainActivity". Can you please check?

Can anyone please confirm?

@HappySl0th

This comment has been minimized.

Copy link

@HappySl0th HappySl0th commented Jul 23, 2020

Has anybody have the adb command to open Blue Iris?

@rebmemer

This comment has been minimized.

Copy link

@rebmemer rebmemer commented Sep 2, 2020

Should anyone want/need it, the intents to start/stop Steam Link;

Start;
"am start -a android.intent.action.VIEW -d -n com.valvesoftware.steamlink/com.valvesoftware.steamlink.SteamShellActivity"

Stop;
"am force-stop com.valvesoftware.steamlink"

@mcfrojd

This comment has been minimized.

Copy link
Owner Author

@mcfrojd mcfrojd commented Sep 3, 2020

Should anyone want/need it, the intents to start/stop Steam Link;

Start;
"am start -a android.intent.action.VIEW -d -n com.valvesoftware.steamlink/com.valvesoftware.steamlink.SteamShellActivity"

Stop;
"am force-stop com.valvesoftware.steamlink"

Added to the list :-)

@Jovink

This comment has been minimized.

Copy link

@Jovink Jovink commented Sep 6, 2020

Has anybody have the adb command to open Ziggo go (dutch televison)

@arifroni

This comment has been minimized.

Copy link

@arifroni arifroni commented Sep 8, 2020

does anybody know what is the command to 'locate remote' function for Nvidia shield pro 2019?

@JeffLIrion

This comment has been minimized.

Copy link

@JeffLIrion JeffLIrion commented Sep 8, 2020

does anybody know what is the command to 'locate remote' function for Nvidia shield pro 2019?

https://amp.reddit.com/r/homeassistant/comments/i50115/nvidia_shield_remote_locator/

@labaland

This comment has been minimized.

Copy link

@labaland labaland commented Sep 24, 2020

adb command for to open a channel on IPTV app would be AWESOME! ( Tivimate / ImPlayer) The best 2 apps for iptv!

@ChalidNL

This comment has been minimized.

Copy link

@ChalidNL ChalidNL commented Sep 24, 2020

Does anyone of you know if it is possible to get this working in Hassio:

If I press the power button on my Firestick Remote it should trigger an automation to turn on the TV.

I have my tv working with broadlink and its fine but I want make use of the remote and my tv is to old.
Could this work or not?

@arifroni

This comment has been minimized.

Copy link

@arifroni arifroni commented Sep 24, 2020

Does anyone of you know if it is possible to get this working in Hassio:

If I press the power button on my Firestick Remote it should trigger an automation to turn on the TV.

I have my tv working with broadlink and its fine but I want make use of the remote and my tv is to old.
Could this work or not?

your TV doesn't turn on by the fire stick?
if you can control your TV from home assistant, you can make an automation:
if fire stick is active>>turn on TV
but i fire stick turning on/off TV with HDMI CEC is a better option.

@ChalidNL

This comment has been minimized.

Copy link

@ChalidNL ChalidNL commented Sep 24, 2020

Does anyone of you know if it is possible to get this working in Hassio:
If I press the power button on my Firestick Remote it should trigger an automation to turn on the TV.
I have my tv working with broadlink and its fine but I want make use of the remote and my tv is to old.
Could this work or not?

your TV doesn't turn on by the fire stick?
if you can control your TV from home assistant, you can make an automation:
if fire stick is active>>turn on TV
but i fire stick turning on/off TV with HDMI CEC is a better option.

Thanks for the suggestion. I liked the idea but I need to investage a bit more. I have read that the remote of the Firestick is RF one. Now I have a sonoff rf bridge but he is not able to receive the signal I think it is not on the 433 freq. Anyways. More investigation is needed. Thanks

@Thebuz

This comment has been minimized.

Copy link

@Thebuz Thebuz commented Oct 18, 2020

Intents to change the HDMI input on TVs with Android TV built in

HW1-9 Represent various inputs, 1-4 maybe for composite etc. depending on the model of TV

HDMI 1
adb shell am start -a android.intent.action.VIEW -d content://android.media.tv/passthrough/com.mediatek.tvinput%2F.hdmi.HDMIInputService%2FHW5 -n org.droidtv.playtv/.PlayTvActivity -f 0x10000000

HDMI 2
adb shell am start -a android.intent.action.VIEW -d content://android.media.tv/passthrough/com.mediatek.tvinput%2F.hdmi.HDMIInputService%2FHW6 -n org.droidtv.playtv/.PlayTvActivity -f 0x10000000

HDMI 3
adb shell am start -a android.intent.action.VIEW -d content://android.media.tv/passthrough/com.mediatek.tvinput%2F.hdmi.HDMIInputService%2FHW7 -n org.droidtv.playtv/.PlayTvActivity -f 0x10000000

HDMI 4
adb shell am start -a android.intent.action.VIEW -d content://android.media.tv/passthrough/com.mediatek.tvinput%2F.hdmi.HDMIInputService%2FHW8 -n org.droidtv.playtv/.PlayTvActivity -f 0x10000000

I got a lot of help from people in this thread:
https://community.home-assistant.io/t/android-tv-hdmi/234411/28

@DiederikvandenB

This comment has been minimized.

Copy link

@DiederikvandenB DiederikvandenB commented Oct 20, 2020

@Jovink This works for me:

am start -a android.intent.action.VIEW -d -n com.ziggo.tv/com.lgi.horizongo.core.activity.splash.SplashActivity

As far as I can tell, there is no way to select a specific channel.

@Jovink

This comment has been minimized.

Copy link

@Jovink Jovink commented Oct 20, 2020

@Jovink This works for me:

am start -a android.intent.action.VIEW -d -n com.ziggo.tv/com.lgi.horizongo.core.activity.splash.SplashActivity

As far as I can tell, there is no way to select a specific channel.
Thank you! Indeed it is working but only if my Shield is on.

@siaox

This comment has been minimized.

Copy link

@siaox siaox commented Oct 22, 2020

Hi thanks for the write up - been using it everyday.

Thought id just add the adb shell command when you have more than one android tv on the network.

adb -s 192.168.x.xx shell

@siaox

This comment has been minimized.

Copy link

@siaox siaox commented Oct 22, 2020

adb command for to open a channel on IPTV app would be AWESOME! ( Tivimate / ImPlayer) The best 2 apps for iptv!

am start -a android.intent.action.VIEW -d -n ar.tvplayer.tv/.ui.MainActivity

I use the adb command to open the app but then use the Logitech Harmony to input the numbers - works pretty well so far.

But an intent would be super easy!!

@clapbr

This comment has been minimized.

Copy link

@clapbr clapbr commented Nov 4, 2020

Sharing the method I've been using to use the search function on Shield directly from HA/Lovelace. Works well for a bunch of stuff, including Netflix (search example: "Vikings on Netflix")

configuration.yaml

input_text:
  androidtv_search_input:
    name: Android Search

scripts.yaml

'atvsearchscript':
  alias: Android TV Search
  sequence:
  - data_template:
      command: am start -a "android.search.action.GLOBAL_SEARCH" --es query "{{ states('input_text.androidtv_search_input')}}"
      entity_id: media_player.shield
    service: androidtv.adb_command

Lovelace raw

      - entities:
          - entity: input_text.androidtv_search_input
            type: 'custom:text-input-row'
          - action_name: Search Android TV
            icon: 'mdi:television-classic'
            name: ' '
            service: script.atvsearchscript
            type: call-service
@Jens-Wymeersch

This comment has been minimized.

Copy link

@Jens-Wymeersch Jens-Wymeersch commented Jan 3, 2021

The command/intent you have for plex wasn't working for me. It kept showing the Plex splash screen and then crashing.
This is working for me:
{"entity_id": "media_player.nvidia_shield", "command": "am start -a android.intent.action.VIEW -d -n com.plexapp.android/com.plexapp.plex.activities.SplashActivity"}

That is the same that i have execpt for the entity_id

I've just tested both of them on an amazon Cube. None of these work.

@lemojack

This comment has been minimized.

Copy link

@lemojack lemojack commented Jan 22, 2021

Does anybody know if it's possible and if yes, what is the command to start the HDMI CEC on TV?

Also if someone interested the command to open TIDAL app is

am start -a android.intent.action.VIEW -d -n com.aspiro.tidal/com.aspiro.wamp.tv.TvLauncherActivity

@Sonomats

This comment has been minimized.

Copy link

@Sonomats Sonomats commented Feb 9, 2021

Hi! I start apps like Netflix on my Android set top box using Android Debug Bridge in Home Assistant. Opening Netflix and Disney+ works like a charm.

But I also have an app "Viaplay" (like a Scandinavian Netflix) and that one I can't start from Home Assistant. I can start that app only if I launch it with a physical remote.
However, I can stop it from Home Assistant using source "!com.viaplay.android". But not start it by using "com.viaplay.android"

How is this even possible? What am I missing? :-)

@mcfrojd

This comment has been minimized.

Copy link
Owner Author

@mcfrojd mcfrojd commented Feb 11, 2021

Hi! I start apps like Netflix on my Android set top box using Android Debug Bridge in Home Assistant. Opening Netflix and Disney+ works like a charm.

But I also have an app "Viaplay" (like a Scandinavian Netflix) and that one I can't start from Home Assistant. I can start that app only if I launch it with a physical remote.
However, I can stop it from Home Assistant using source "!com.viaplay.android". But not start it by using "com.viaplay.android"

How is this even possible? What am I missing? :-)

I have problems with viaplay to, i will make a new try with it when im back from work.
I tried to run the command:
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
remote from work but it will not produce any line with something that looks like viaplay.
But maybe if i run viaplay and the this command i will get a better result.
I will post result in the gist if i find a sollution.

@mcfrojd

This comment has been minimized.

Copy link
Owner Author

@mcfrojd mcfrojd commented Feb 11, 2021

@Sonomats

Starts ViaPlay (swedish streaming)

{"entity_id" :"media_player.shield", "command": "am start -a android.intent.action.VIEW -d -n com.viaplay.android/.features.home.HomeActivity"}

@Sonomats

This comment has been minimized.

Copy link

@Sonomats Sonomats commented Feb 11, 2021

@Sonomats

Starts ViaPlay (swedish streaming)

{"entity_id" :"media_player.shield", "command": "am start -a android.intent.action.VIEW -d -n com.viaplay.android/.features.home.HomeActivity"}

Thank you! It works. How did you find out this command?

@mcfrojd

This comment has been minimized.

Copy link
Owner Author

@mcfrojd mcfrojd commented Feb 11, 2021

Thank you! It works. How did you find out this command?

I used one of the examples above (ADB command to find out the intent from diffrent apps:)
and tried to modify it for viaplay like this:

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

And got this for output

com.viaplay.android/.features.home.HomeActivity

@JeffLIrion

This comment has been minimized.

Copy link

@JeffLIrion JeffLIrion commented Feb 14, 2021

How to start a Wyze cam RTSP stream in VLC:

"dumpsys power | grep mWakefulness | grep -qv Awake && input keyevent 4; CURRENT_APP=$(dumpsys window windows | grep mCurrentFocus) && CURRENT_APP=${CURRENT_APP#*{* * } && CURRENT_APP=${CURRENT_APP%%/*} && if [ $CURRENT_APP != 'org.videolan.vlc' ]; then monkey -p org.videolan.vlc -c android.intent.category.LAUNCHER 1 && sleep 3; fi; am start -a android.intent.action.VIEW  -d  rtsp://USER:PASSWORD@192.168.0.42/live"

Change the user, password, and IP address in the last part of that command.

@JeffLIrion

This comment has been minimized.

Copy link

@JeffLIrion JeffLIrion commented Feb 14, 2021

Find how to start an app (source):

pm dump $package | grep -A 1 "MAIN" | grep $package | awk '{print $2}' | grep $package

Replace $package with the app ID.

@hannemann

This comment has been minimized.

Copy link

@hannemann hannemann commented Mar 3, 2021

I wonder why the youtube intent stopped working on my Shield 2015.

The screen flashes grey for half a second but nothing else happens...

adb connect 192.168...
adb shell am start -a android.intent.action.VIEW -d -n com.google.android.youtube.tv/com.google.android.apps.youtube.tv.activity.ShellActivity

The same happens if i trigger my Automation...
Does anyone have the same Problem?

@Finsterclown

This comment has been minimized.

Copy link

@Finsterclown Finsterclown commented Mar 6, 2021

Hi!
This is quite helpful for me...
But I got in trouble after installing KODI 19 on a shield TV. When executing
{"entity_id" :"media_player.shield", "command": "am start -a android.intent.action.VIEW -d -n org.xbmc.kodi/.Splash"}
from Home Assistant Kodi is starting, but shows an error "Playback failed - check log". I've tried to reinstall Kodi, set up the shield tv completely new, but the error message pops up every time I execute this command.
When starting Kodi from shield UI everything works fine.
With a few tries I've found the "-d" argument is responsible for my issue - removed it and Kodi works as expected (at the moment). What is the "-d" argument used for? Documentation says specify data URI, but then it should be followed by something, or not?
Greetz

@mcfrojd

This comment has been minimized.

Copy link
Owner Author

@mcfrojd mcfrojd commented Mar 6, 2021

With a few tries I've found the "-d" argument is responsible for my issue - removed it and Kodi works as expected (at the moment). What is the "-d" argument used for? Documentation says specify data URI, but then it should be followed by something, or not?

It seems that the -d option is used when you pass a "url" instead of "path" to your android device.
And maybe earlier versions of android tv did not care if that flag was missing the "url" in the command.
I have updated the examples above.

@alvise

This comment has been minimized.

Copy link

@alvise alvise commented Mar 10, 2021

If it can be useful to somebody i found a lot of intents executing "dumpsys activity" in yaml without SSH and terminal.

service: androidtv.adb_command
data:
  entity_id: media_player.nvidia_shield
  command: dumpsys activity

then in developer options / states you can check the result and look for your intents

@jojeda654

This comment has been minimized.

Copy link

@jojeda654 jojeda654 commented Mar 17, 2021

Thanks for this list. Here's my script for launching the screensaver:

daydream:
  sequence:
  - service: androidtv.adb_command
    target:
      entity_id: media_player.living_room_tv
    data:
      command: >-
        am start -n
        com.android.systemui/.Somnambulator

And my script for waking up the device from the screensaver:

wakeup:
  sequence:
    - service: androidtv.adb_command
      target:
        entity_id: media_player.living_room_tv
      data:
        command: "input keyevent KEYCODE_WAKEUP"
@trynqz

This comment has been minimized.

Copy link

@trynqz trynqz commented May 2, 2021

Hi, I installed your mod https://github.com/mcfrojd/hassio_lovelace_multiremote via HACS. After HA restat I got this message, and HACS did not started at all...so do all other mods. Please advice

Logger: homeassistant.setup
Source: setup.py:164
First occurred: 18:45:19 (1 occurrences)
Last logged: 18:45:19

Setup failed for hacs: Unable to import component: cannot import name 'PACKAGE_NAME' from 'custom_components.hacs.const' (/config/custom_components/hacs/const.py)

@trynqz

This comment has been minimized.

Copy link

@trynqz trynqz commented May 2, 2021

reinstalation of HACS was the fix of above situation...

@trynqz

This comment has been minimized.

Copy link

@trynqz trynqz commented May 3, 2021

I do not need all the possibilities of multiremote, remote for SHIELD device from your Latest Update 2021-03-06 will do for me perfectly. Can you share instruction/code regarding it in "copy&paste" format? Thanks in advance

@calisro

This comment has been minimized.

Copy link

@calisro calisro commented May 18, 2021

Nvidia sheild find a remote. :)

am start -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -n com.nvidia.remotelocator/.RemoteLocatorActivity

@arifroni

@Aubron

This comment has been minimized.

Copy link

@Aubron Aubron commented Jun 16, 2021

LauncherX - Default launcher for a Google TV with chromecast, in case you need to script returning to the main menu:

am start -a android.intent.action.VIEW -n com.google.android.apps.tv.launcherx/com.google.android.apps.tv.launcherx.home.HomeActivity

@GingerHawk

This comment has been minimized.

Copy link

@GingerHawk GingerHawk commented Aug 29, 2021

Is there still a way to find out the intents of a device if you are not using the ADB Debug Addon. It isnt avaible anymore and I am using the builtin python integration

@GingerHawk

This comment has been minimized.

Copy link

@GingerHawk GingerHawk commented Aug 29, 2021

I hate to be the guy asking for intent answers as i like to figure things out myself; but I’m trying to get the launch intents for com.disney.disneyplus: "Disney +"
ca.bellmedia.cravetv: "Crave TV"
com.amazon.amazonvideo.livingroom: "Amazon Prime Video"

but I’m having trouble getting the intent with the command listed above under “ ADB command to find out the intent from diffrent apps: “

Is this run through HA’s Service tab in dev tools? Because its not returning any result no matter what i try.

Appreciate any assistance.

I got the amazon one working, did you get the Crave one working at all

@siaox

This comment has been minimized.

Copy link

@siaox siaox commented Aug 30, 2021

I hate to be the guy asking for intent answers as i like to figure things out myself; but I’m trying to get the launch intents for com.disney.disneyplus: "Disney +"
ca.bellmedia.cravetv: "Crave TV"
com.amazon.amazonvideo.livingroom: "Amazon Prime Video"

but I’m having trouble getting the intent with the command listed above under “ ADB command to find out the intent from diffrent apps: “

Is this run through HA’s Service tab in dev tools? Because its not returning any result no matter what i try.

Appreciate any assistance.

My HA service command is :

    service: media_player.select_source
    target:
      entity_id: media_player.android_tv
    data:
      source: com.disney.disneyplus

hope that helps

@Bruhildo

This comment has been minimized.

Copy link

@Bruhildo Bruhildo commented Sep 3, 2021

For those looking for Crave TV ADB command:

am start -a android.intent.action.VIEW -n ca.bellmedia.cravetv/axis.androidtv.sdk.app.MainActivity

Just tested and working ok.

@cranxi

This comment has been minimized.

Copy link

@cranxi cranxi commented Sep 4, 2021

Somebody know how to figure out the starting commands these days? The ADB add-on doesn't exist anymore.

Looking for the start command of Protect App (Unifi).

@GingerHawk

This comment has been minimized.

Copy link

@GingerHawk GingerHawk commented Sep 5, 2021

Thank you so much for this!

How did you figure it out ?

For those looking for Crave TV ADB command:

am start -a android.intent.action.VIEW -n ca.bellmedia.cravetv/axis.androidtv.sdk.app.MainActivity

Just tested and working ok.

@Bruhildo

This comment has been minimized.

Copy link

@Bruhildo Bruhildo commented Sep 6, 2021

Thank you so much for this!

How did you figure it out ?

For those looking for Crave TV ADB command:
am start -a android.intent.action.VIEW -n ca.bellmedia.cravetv/axis.androidtv.sdk.app.MainActivity
Just tested and working ok.

You most welcome. I hope it worked for you. I tried and worked on CCWGTV.

I used @mcfrojd suggestion above from Feb 11 to figure out viaplay. I did the same for Crave TV.

  1. Go to Developer Tool / State on Home Assistant to find the app name. The easier way is to have your Android Tv device turned on and the app open (in this case Crave TV). You should see something like this: app_name: ca.bellmedia.cravetv under Attributes.

  2. Go to Developer Tool / Services on Home Assistant. Type:
    adb shell pm dump ca.bellmedia.cravetv | grep -A 1 "MAIN" | grep ca.bellmedia.cravetv | awk '{print $2}' | grep ca.bellmedia.cravetv.

    You wont see anything happening directly. Neither on TV nor on home assistant.

  3. Go back to Developer Tool / State on Home Assistant and look for the Attribute adb_response. In this case, it should read: adb_response: ca.bellmedia.cravetv/axis.androidtv.sdk.app.MainActivity

  4. Now just piece together the beginning of the code:

am start -a android.intent.action.VIEW -n

and add the direction that you just found out on adb_response to have your final command:

am start -a android.intent.action.VIEW -n ca.bellmedia.cravetv/axis.androidtv.sdk.app.MainActivity

Now I wonder if there is a way to bypass the splash screen for CraveTV, Netflix, Disney+, etc... to select the user. That one I have not figured out how to do.

@slodziak

This comment has been minimized.

Copy link

@slodziak slodziak commented Sep 6, 2021

I couldn't find it anywhere, here's the intent for the Apple TV+ app on Android TV

am start -a android.intent.action.VIEW -n com.apple.atve.androidtv.appletv/.MainActivity

@cranxi

This comment has been minimized.

Copy link

@cranxi cranxi commented Sep 6, 2021

Thank you so much for this!
How did you figure it out ?

For those looking for Crave TV ADB command:
am start -a android.intent.action.VIEW -n ca.bellmedia.cravetv/axis.androidtv.sdk.app.MainActivity
Just tested and working ok.

You most welcome. I hope it worked for you. I tried and worked on CCWGTV.

I used @mcfrojd suggestion above from Feb 11 to figure out viaplay. I did the same for Crave TV.

  1. Go to Developer Tool / State on Home Assistant to find the app name. The easier way is to have your Android Tv device turned on and the app open (in this case Crave TV). You should see something like this: app_name: ca.bellmedia.cravetv under Attributes.
  2. Go to Developer Tool / Services on Home Assistant. Type:
    adb shell pm dump ca.bellmedia.cravetv | grep -A 1 "MAIN" | grep ca.bellmedia.cravetv | awk '{print $2}' | grep ca.bellmedia.cravetv.
    You wont see anything happening directly. Neither on TV nor on home assistant.
  3. Go back to Developer Tool / State on Home Assistant and look for the Attribute adb_response. In this case, it should read: adb_response: ca.bellmedia.cravetv/axis.androidtv.sdk.app.MainActivity
  4. Now just piece together the beginning of the code:

am start -a android.intent.action.VIEW -n

and add the direction that you just found out on adb_response to have your final command:

am start -a android.intent.action.VIEW -n ca.bellmedia.cravetv/axis.androidtv.sdk.app.MainActivity

Now I wonder if there is a way to bypass the splash screen for CraveTV, Netflix, Disney+, etc... to select the user. That one I have not figured out how to do.

Thanks!

Finally found how to startup Unifi Protect app on Android TV:

am start -a android.intent.action.VIEW -n com.ubnt.unifi.protect/com.ubnt.sections.splash.AuthenticationActivity

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