I was able to send youtube links to the youtube app on my tv
now that there is an official android component, i’m now unable to get it to work, I’ve tried the below using the androidtv.adb_command, yet nothing happens.
You can just use adb shell commands. Try the following :
youtube_video:
alias: Play youtube video on AndroidTV
sequence:
- service: androidtv.adb_command
data:
entity_id: media_player.sony_bravia
command: 'am start -a android.intent.action.VIEW "https://www.youtube.com/watch?v=TTXFKD7fMlE"'
when adding {{ states(‘sensor.yt_puzzle’) }} i get the following error
Error loading /config/configuration.yaml: while parsing a block mapping in "/config/./scripts/YouTube.yaml", line 40, column 7 expected <block end>, but found '<scalar>' in "/config/./scripts/YouTube.yaml", line 41, column 100
I managed to get rid of the error you receive by removing some quotes but then no video is played. I think that is because the service can’t use sensor template data. I think you can get it working with NodeRED but i don’t know if you have that installed.
Good news ! Forget my last post… I found the correct way to get it working. Please try the following and let me know if it works :
youtube_video:
alias: Play youtube video on AndroidTV
sequence:
- service: androidtv.adb_command
data_template:
entity_id: media_player.sony_bravia
command: am start -a android.intent.action.VIEW https://www.youtube.com/watch?v={{states('sensor.yt_puzzle')}}