Version: 0.7.11
Custom Home Assistant integration for browsing YouTube Music, playing results on compatible media players, and controlling playback from a sidebar app and Lovelace widget.
- Browser-auth based YouTube Music access via
browser.json - Search across songs, artists, and playlists
- Direct playback on compatible
media_playerentities - Autoplay, shuffle, and repeat controls
- Sidebar app for browsing and playback
- Lovelace widget for searching and playing from dashboards
- Script / automation friendly service interface via
youtube_music_connector.execute
This repository contains two Home Assistant artifacts:
- Integration:
custom_components/youtube_music_connector - Lovelace widget:
www/community/youtube-music-connector/youtube-music-connector.js
Add this GitHub repository to the Home Assistant app/add-on store as a repository, install YouTube Music Connector, then start it once. The app copies the integration files into your Home Assistant /config directory so you can add the integration normally afterward.
Add this repository to HACS as an Integration, then install YouTube Music Connector.
Copy custom_components/youtube_music_connector into your Home Assistant custom_components folder.
If you install manually or through HACS, copy www/community/youtube-music-connector/youtube-music-connector.js into your Home Assistant www/community/youtube-music-connector/ folder and add this resource:
url: /local/community/youtube-music-connector/youtube-music-connector.js
type: moduleThe integration uses browser authentication via a browser.json file. The expected format follows the official browser-auth approach documented by ytmusicapi:
The config flow now supports two setup paths:
- Paste
Copy as fetch, raw request headers, or compatible JSON directly into the dialog. The integration stores the browser auth automatically in/config/.storage/. - Or keep using an existing
browser.jsonpath if you already have one.
Required keys:
authorizationcookiecontent-typex-goog-authuserx-origin
The integration config flow validates the file immediately with a real song search.
Main service for automations and scripts:
action: youtube_music_connector.execute
data:
entity_id: media_player.youtube_music_connector
target_entity_id: media_player.living_room_speaker
query: "nature sounds birds"
search_type: all
limit: 5
play: true
autoplay_enabled: true
shuffle_enabled: false
repeat_mode: foreverSupported repeat modes:
offonceforever
This repository now supports both Home Assistant installation paths:
- HACS custom integration repository
- Home Assistant app / add-on repository via
repository.yaml
The integration ships two Lovelace cards that are automatically registered — no manual resource setup needed.
Now-playing card with album art, transport controls, volume, progress/seek, and multi-device selection.
type: custom:ytmc-player
entity: media_player.youtube_music_connector
exclude_devices:
- media_player.kitchen_displaySearch YouTube Music and play results on selected devices.
type: custom:ytmc-search-play
entity: media_player.youtube_music_connector
exclude_devices:
- media_player.office_tv| Parameter | Type | Default | Description |
|---|---|---|---|
entity |
string | (required) | Entity ID of the YouTube Music Connector |
exclude_devices |
string[] | [] |
Media player entity IDs to hide from device selector |
Click multiple device chips to play on all of them simultaneously. Volume, play/pause/stop, and track changes are mirrored to all group members. Deselect to return to single-device mode.
Both cards support CSS custom properties: --ytmc-bg, --ytmc-surface, --ytmc-text, --ytmc-text-secondary, --ytmc-accent, --ytmc-accent-active, --ytmc-radius, --ytmc-font-family. See docs/components.md for details.
- HACS: update through HACS and restart Home Assistant.
- Manual or add-on installed files: re-run the companion add-on or recopy the files, then restart Home Assistant.
- Home Assistant detects new companion add-on releases from the add-on version in
youtube_music_connector_companion/config.yaml. - This repository keeps the integration version and add-on version aligned so Home Assistant and HACS can detect package revisions consistently.
Detailed integration documentation is available here: