@JeffLIrion
Looking at the documentation for the FireTV component after your updates, it doesn’t look like adb_server_ip is listed as a configurable option.
Is it or is it planned to be in a future update?
EDIT: apologies, looks like I didn’t properly read your reply doh
For others that are trying to figure this out, I followed the code a bit for the custom component and realized you can add arguments in the “intent” data that get passed to am start. With that, I was finally able to start Hulu with the following:
For reference, the ADB command that gets sent by the service call is
"am start -a android.intent.action.VIEW -d {}".format(uri)
where “{}” gets replaced by whatever is in the “intent” field. That means, without specifying any flags, the input is treated as a “data_uri”. By putting “-n” first, it changes whatever follows to be treated as the “component”.
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?