Youtube sensor showing the latest videos - and if clicked, launches youtube

I know this isn’t much, but it was really bothering me that the default setting, just showed a non-clickable more-info.
I had some problems in getting this to work in the regular frame, but it all solved itself using the custom:button-card.

This is the result:
youtube-sensor-clickable

One minor detail I’m contemplating at the moment, is how to eliminate the spaces between the cards, that would be the final touch.
The config looks like this:

type: vertical-stack
cards:
  - type: 'custom:button-card'
    color_type: icon
    show_name: true
    show_entity_picture: true
    show_label: true
    name: |
      [[[ return states['sensor.repairguydk'].attributes.friendly_name ]]]
    label: |
      [[[ return states['sensor.repairguydk'].state ]]]
    entity_picture: |
      [[[ return states['sensor.repairguydk'].attributes.entity_picture ]]]
    tap_action:
      action: url
      url: |
        [[[ return states['sensor.repairguydk'].attributes.url ]]]
    layout: icon_name_state2nd
  - type: 'custom:button-card'
    color_type: icon
    show_name: true
    show_entity_picture: true
    show_label: true
    name: |
      [[[ return states['sensor.drzzs'].attributes.friendly_name ]]]
    label: |
      [[[ return states['sensor.drzzs'].state ]]]
    entity_picture: |
      [[[ return states['sensor.drzzs'].attributes.entity_picture ]]]
    tap_action:
      action: url
      url: |
        [[[ return states['sensor.drzzs'].attributes.url ]]]
    layout: icon_name_state2nd
  - type: 'custom:button-card'
    color_type: icon
    show_name: true
    show_entity_picture: true
    show_label: true
    name: |
      [[[ return states['sensor.paul_hibbert'].attributes.friendly_name ]]]
    label: |
      [[[ return states['sensor.paul_hibbert'].state ]]]
    entity_picture: |
      [[[ return states['sensor.paul_hibbert'].attributes.entity_picture ]]]
    tap_action:
      action: url
      url: |
        [[[ return states['sensor.paul_hibbert'].attributes.url ]]]
    layout: icon_name_state2nd

2 Likes

Thats thinking outside the box

for the user who dont know how
goto youtube and click on your youtuber

copy the text after the channel/COPYTHISTEXT

in the Sensor file or sensor section on the confg file

  - platform: youtube
    channel_id: UC7G4tLa4Kt6A9e3hJ-HO8ng

do a restart

goto the states page

search for there name

done

2 Likes

Wait… There’s a youtube sensor? I can’t find it on the components page:


:frowning:
2 Likes

Hi @HypnoToad It’s a custom module, you can find it in HACS.

1 Like

Ah ok thanks, I’ll check it out :slight_smile:

1 Like

Did a small modification to play videos selected directly on chromecast
to do: add select which chromecast to use (I got two of them)

script

  dw_news:
    alias: dw_news
    sequence:
    - data_template:
        entity_id: media_player.master_bedroom_tv
        media_content_id: '{{states.sensor.dw_news.attributes.url}}'
        media_content_type: video/youtube
      service: media_extractor.play_media

lovelace

cards:
  - color_type: icon
    entity_picture: |
      [[[ return states['sensor.dw_news'].attributes.entity_picture ]]]
    label: |
      [[[ return states['sensor.dw_news'].state ]]]
    layout: icon_name_state2nd
    name: |
      [[[ return states['sensor.dw_news'].attributes.friendly_name ]]]
    show_entity_picture: true
    show_label: true
    show_name: true
    tap_action:
      action: call-service
      service: script.dw_news
    type: 'custom:button-card'
type: vertical-stack
3 Likes