Hi guyās,
with this add-on would it be possible to when I launch an activity called youtube or Netflix on my harmony remote. HA could then send a command launch said app on my shield.
if so, could someone please show me how the action would look in a yaml file?
You need to run the command on the device itself. I did it on my Shield TV. If youāre in the ADB addon container and itās already connected to the device, just run adb shell first. If youāre on a Windows PC or something, assuming you have ADB installed:
adb tcpip 5555
adb connect <device_ip_address>
# accept the connection on the device
adb shell
Use it in an automation as a trigger and the Android TV intent service as the action.
Then create an activity for the app on your Harmony and add the corresponding Roku button press to the activity (youāll probably have to do this in the MyHarmony program)
I am working on making this (though just as onscreen buttons for apps in my Shield TV activity) so Iāll share the code later when itās finished.
I managed to make 1 automation that can handle multiple apps instead of making an automation for each app. Less lines of code .
Just add more else ifs (elif) if you need more than 2 apps and then change the key.
I used āSelectā and āInstantReplayā because they donāt have icons next to them on the Harmony elite touchscreen, but you can use any command that isnāt named after an app name. (Here is a list of the exact names to use for each key)
Donāt forget to change the enitiy_id to the entity_id of your android tv.
EDIT: Looks like Rokuās docs say the wrong key value for the command āBack Spaceā.
āBackspaceā doesnāt work but āBackSpaceā does.
Hi, Iām trying to understand how to implement this add-on in hassio. Iāve managed to get the add-on working, Iāve got a media_player entity that can turn off my android tv box but thatās all it can do at the moment. This adb business is well above my current level of understanding, so Iām starting with a basic switch to trigger an automation/intent. However, nothing happens. Hereās my automation
- alias: Android TV Auto
trigger:
- platform: state
entity_id: input_boolean.androidtv
from: 'off'
to: 'on'
action:
- service: media_player.androidtv_intent
data:
entity_id: media_player.androidtv
intent: "-n com.google.android.youtube.tv/com.google.android.apps.youtube.tv.activity.ShellActivity"
Am I heading in the right direction? Sometimes itās worth posting because the more eagle-eyed of you can spot an obvious mistake. Otherwise, is there something else I need to do to be able to use these āintentā services?
My biggest problem is I can see the format of the intents but I just donāt understand where that code goes. Is that Shield_Intents.MD file something that is being referenced, or is that just the format of the service call you are using in automations?
Would you mind posting some of the code that relates to the action from your input_boolean triggers please?
ā edit ā
Updated the gist with better lovelace code for some buttons, i had some buttons that activated some node-red flows, the new code should work for anyone without my custom node-red flows.
ā edit ā
The input_booleans trigger a node-red flow, (they are a advanced combination of looking if tv is on, set correct input via IR, set soundlevel depending on time and if wife is home, and then starting the right application on the shield) so they are not a good example, but if you look further down you see a typical example.
(the input_boolean.shield_dummy is only there because you have to have a entity for the button card to work.)
Not an issue of the add-on, but my nVidia Shield TV doesnāt turn off when pressing the power button the media card. Turning it on with the power button works and also the state gets correctly updated when I turn off the Shield TV with the remote control.