Ultimate guitar tabs now playing Spotify link

I try to play along on the guitar with songs playing on Spotify. Usually I need to look up the tabs/chords and it means typing etc so the song is half done by the time I bring it up. I made this simple dashboard card that links to ultimate guitar tabs search including the song now playing on Spotify.

type: markdown
text_only: true
content: >-
  https://www.ultimate-guitar.com/search.php?search_type=title&value={{
  state_attr('media_player.speakername','media_title').replace(' ', '+') }},{{
  state_attr('media_player.speakername','media_artist').replace(' ', '+') }}
4 Likes

Sounds good! I just tried to add it to my dash and got an error. Granted, I’m not good in coding - very novice! :slight_smile:

Change the media_player.speakername references in the script to your media player entity name. You also need to make sure something is playing on the specified media player, otherwise you will get the UndefinedError: 'None' has no attribute to 'replace' error.

It works with almost any HA media player.

Spotify media player

type: markdown
text_only: true
content: >-
  https://www.ultimate-guitar.com/search.php?search_type=title&value={{
  state_attr('media_player.spotify_todd_l','media_title').replace(' ', '+') }},{{
  state_attr('media_player.spotify_todd_l','media_artist').replace(' ', '+') }}

SpotifyPlus media player

type: markdown
text_only: true
content: >-
  https://www.ultimate-guitar.com/search.php?search_type=title&value={{
  state_attr('media_player.spotifyplus_todd_l','media_title').replace(' ', '+') }},{{
  state_attr('media_player.spotifyplus_todd_l','media_artist').replace(' ', '+') }}

Bose SoundTouch media player

type: markdown
text_only: true
content: >-
  https://www.ultimate-guitar.com/search.php?search_type=title&value={{
  state_attr('media_player.bose_st10_1','media_title').replace(' ', '+') }},{{
  state_attr('media_player.bose_st10_1','media_artist').replace(' ', '+') }}
2 Likes

I used to get frustrated pausing mid-song to search for chords too, and it killed the vibe. I started learning to play by ear a bit using short lessons from https://www.artmaster.com, and it made jamming along way smoother because I didn’t need to grab tabs every time.