Play YouTube videos on Samsung TV without extra devices (No Chromecast, no nothing)

I haven’t tested this yet, but did anyone figure out how to loop video or play a playlist on YouTube?

I want to automate checkin of AirBNB guests and have a video playing when they arrive of the property and where everything is etc and what’s in the area and for it to loop until guest changes channel or turns off tv.

For some reason now i cant get past the whos watching? on the TV… it seem the enter key command isnt working?

1 Like

I have the same issue that nothing happens after login to the account. Was just working fine before, can not say what has caused that. But I have just noticed that the video appears just like a millisecond before the account dialog appears. After hitting enter nothing happens.
I am sure that something must have been changed since it was working before.

I don’t know why, but I tested it again on my Samsung the Frame and it working as expected.
I am using it to share YouTube videos from my phone to TV. Reason: the cast functionality in the YouTube app was not reliable enough. In addition it can be very useful to share from other devices.

configuration.yaml :

video_youtube_rest_id:
    url: 'http://192.168.2.133:8080/ws/apps/YouTube'
    method: POST
    content_type: 'text/plain'
    payload: 'v={{ video_id }}'

script:

alias: youtubeTheFrameld
sequence:
  - service: rest_command.video_youtube_rest_id
    data:
      video_id: '{{message}}'
  - delay:
      hours: 0
      minutes: 0
      seconds: 1
      milliseconds: 0
  - service: media_player.play_media
    data:
      media_content_type: send_key
      media_content_id: KEY_ENTER
    target:
      entity_id: media_player.theframeold
mode: single

automation:

alias: Youtube Bedroom
description: ''
trigger:
  - platform: event
    context:
      user_id:
        - ce90a216bdf2436182ec7467xxxxxxxx
        - dd0e73390e1c4316b916a8bxxxxxxxx
    event_type: 'mobile_app.share '
condition: []
action:
  - service: script.youtubeTheFrameld
    data:
      message: >-
        {{ (trigger.event.data.url |
        regex_findall_index("v=(.*)|be/(.*)"))[0]}}{{ (trigger.event.data.url |
        regex_findall_index("v=(.*)|be/(.*)"))[1]}}
mode: single

The regex can be improved, but it works fine for me.
So I just go to the YouTube video, click on the share button and select HomeAssitant.

It’s working fine for me as of today. I’m sending the keys with ollo69’s custom component instead of jaruba’s