Updated simpler version of this tutorial is available here
YT Music Player Integration#
First, install it from HACS
You can use this button to be redirected to the download page. It will open the repository's page in HACS.
then you can use this button to start the setup process:
You can use this button to start the setup process. It will open the integration page in Home Assistant.
Automation Example#
config/automations.yaml
alias: yt music automation
description: ""
trigger:
- platform: calendar
event: end
offset: "0:5:0"
entity_id: calendar.fixt
action:
- service: media_player.select_source
data:
source: kitchen
target:
entity_id: media_player.ytube_music_player
- service: media_player.play_media
data:
media_content_id: RDCLAK5uy_mplKe9BIYCO3ZuNWSHZr48bm9DUDzbWnE
media_content_type: playlist
target:
entity_id: media_player.ytube_music_player
mode: single
Get List of Media Players#
Jinja2 Template
{{ expand(states.media_player)
| rejectattr('state', 'eq', 'unavailable')
| rejectattr('entity_id', 'eq', 'media_player.ytube_music_player')
| map(attribute='entity_id')
| list
| replace('media_player.', '')
}}
Mini media player card#
Custom Card
type: custom:mini-media-player
entity: media_player.ytube_music_player
artwork: cover
hide:
shuffle: false
icon_state: false
shortcuts:
columns: 3
buttons:
- name: Living Room
type: source
id: living_room
- name: Kitchen
type: source
id: kitchen
- name: Bedroom
type: source
id: bedroom
- name: My Likes
type: playlist
id: RDCLAK5uy_mplKe9BIYCO3ZuNWSHZr48bm9DUDzbWnE
- name: Playlist 2
type: playlist
id: RDCLAK5uy_n0_d5SZbBxft3QDuk3gjp2BO1Q4H6tclU
I would love to hear your comments, or suggestions on this post.
Fixt is a Software Engineer passionate about making the world a better place through technology and automation.