Creating a blueprint for music with NFC Tags

Hello there,
i successfully created a NFC Jukebox with the tutorials available. But now I would like to improve on adding new music cards. Up to now got to the NFC-Tag page in HA, scanned a new Tag and typed what music I would like to hear on one media player.
Now I would like to improve the automation by creating a blueprint. The automation looks like this:

trigger:
- platform: tag
  tag_id: 93-8F-8C-08
condition: []
action:
- service: notify.alexa_media_echo_kinderzimmer
  data:
    data:
      type: tts
    message: 'Ich spiele: Folge 2: Lieselotte feiert Geburtstag'
- service: media_player.play_media
  target:
    entity_id: media_player.echo_kinderzimmer
  data:
    media_content_id: 'album Folge 2: Lieselotte feiert Geburtstag (Vier Hörspiele)'
    media_content_type: AMAZON_MUSIC
mode: single

So when scanning a new tag, I would like to enter just the content ID. And perhaps the message, but that was just for testing. Another thing I would like to change is the static mediaplayer, in this case “echo_kinderzimmer” for example if the Tag is scanned with the Tag reader in the living room the music should play on “echo_wohnzimmer”. But up to now I couldn’t find an easy way to get reader and player combined. At the Moment there are four readers and eight players available.

Best regards
Mirko

2 Likes

For your second part - i created a roundabout way of doing this by having a “switch” tag - scanning the tag switched the media player it sends cards to.

I created an input select called “music_player” with the values being my 3 media players (echo_office, echo_lounge, echo_kitchen)

Then i added an automation that is triggered by the card, which switches to the next value in the input_select - in addition it then tells that device to announce “Jukebox activated” via text to speech on the selected device

then in my music playing automation i se the device to play from to be
{{ states(‘input_select.music_player’) }} this makes it play music to the selected value from the input select

Instead of having a single switcher tag, you could potentially have one tag per room, that sets it just to that value in the input_select, meaning you just scan the “Activate” card once before you start scanning music tags