Skip to content

Instantly share code, notes, and snippets.

@daviddykeuk
Created December 17, 2020 14:47
Show Gist options
  • Save daviddykeuk/db7d4204c223699e3c3e19afb2b8abe2 to your computer and use it in GitHub Desktop.
Save daviddykeuk/db7d4204c223699e3c3e19afb2b8abe2 to your computer and use it in GitHub Desktop.
blueprint:
name: Start music on Sonos when tag is scanned
description: When a tag is scanned, start the associated music on the selected media player
domain: automation
input:
tag_id:
name: Tag ID
description: The tag ID
song_url:
name: Song url
description: The spotify open url of the song to play
sonos_entity_id:
name: Sonos speaker
description: The entity ID of the sonos speaker to use
selector:
entity:
domain: media_player
trigger:
- platform: tag
tag_id: !input tag_id
action:
- service: media_player.play_media
data_template:
entity_id: !input sonos_entity_id
media_content_id: !input song_url
media_content_type: music
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment