Media player play_media SmartTubeNext

Hello!
Is it possible to play videos to Smart Tube Next using play_media service on a Android TV?
I amb able to do it with the official youtube app with the following script:

alias: YouTube living room enqueue
sequence:
  - service: media_player.play_media
    target:
      entity_id: media_player.mi_box
    data:
      media_content_id: >-
        {% set msg
        ={'app_name':'smarttubenext','enqueue':'true','media_id':states('input_text.youtube')}%}{{
        msg|to_json }}
      media_content_type: cast
mode: single
icon: mdi:youtube-tv

I have tried replacing the app_name to smarttubenext but it doesn’t work.

2 Likes

Hi, did you get it to work? Thank you

For anyone interested, I managed to do it through the Android Debug Bridge integration. First setup your device by enabling developer options and usb debugging, then setup your device in HA through the Android Debug Bridge.

Once the device is connected you send ADB shell commands through HA to your device. The command to cast a youtube video to Smarttube Beta would be:

adb shell am start -a android.intent.action.VIEW -d “https://www.youtube.com/watch?v=AcIaNiiVVhk” com.liskovsoft.smarttubetv.beta

More info on the shell command here: [Feature Request] The ability to send YouTube urls from computer via command line. · Issue #1999 · yuliskov/SmartTube · GitHub

it was working fine till my phillips update, for any1 wondering how to do it i will put the code below

action: media_player.play_media
metadata: {}
data:
media_content_id: vnd.youtube.launch://www.youtube.com/watch?v=Xz9nNN86trE&ab_channel=LubenTV
media_content_type: app
target:
entity_id: media_player.55pus7304_12_2

my first post :smiley: