

Working INTENTS to use with Community Hass.io Add-ons: Android Debug Bridge for...
source link: https://gist.github.com/mcfrojd/9e6875e1db5c089b1e3ddeb7dba0f304
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

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
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:[email protected]: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
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
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
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:[email protected]/live"
Change the user, password, and IP address in the last part of that command.
Recommend
-
51
Android Debug Bridge (adb) Android Debug Bridge (adb) is a versatile command-line tool that lets you communicate with a device. The adb command facilitates a variety of device actions, such as installing and debug...
-
14
Giving a user the ability to download files in your app can be difficult to figure out. In iOS, you can use AlamoFire to download the file locally and then present it with a UIDocumentInteractionController. (The code woul...
-
5
Android Web Intents with Cordova Published 02 September 2014 in London, UK Important: I’m doing this using Cordova 3.5.0. It’ll probably work for 3.x.x in general but I can’t guarantee it!
-
12
Break out from the sea of Android App icons — What are Custom Intents for App Actions?I counted and I have 129 apps installed on my phone, not including my work profile! I doubt that I’m an outlier....
-
6
ADB的全称为Android Debug Bridge,就是调试桥的作用,存放在sdk安装目录下的platform-tools文件夹中,借助这个工具,我们可以管理设备或手机模拟器的状态,可以让你与仿真实例或连接的安卓系统的设备进...
-
12
Debug Microservices running inside a Kubernetes Cluster with Bridge to Kubernetes 1 day ago2021-07-12T00:00:00+02:00 by Wolfgang Ofner 11 minKubernetes and new tools and technologies, in gene...
-
8
Device Basics adb devices Lists connected devices adb devices -l Lists connected devices and kind adb root Restarts adbd with root permissions adb start-server Starts the adb server
-
19
Your Deep Links Might Be Broken: Web Intents and Android 12 January 25, 2022 10 Minute Read Mobile
-
5
We’ve already seen what are Activities, the most basic pieces of every Android app and today’s topic is associated with it. We’re going to see how to communicate be...
-
2
We’ve already seen what are Activities, the most basic pieces of every Android app and today’s topic is associated with it. We’re going to see how to com...
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK