[custom-component] Fetch song lyrics from Genius.com

Hi there! I’ve found it interesting to want to fetch lyrics and display them on the lovelace frontend, therefore I created a genius.com lyrics component. Simply create a genius.com access token, add the custom component (HACS compatible) and add a markdown lovelace card (example provided). The component auto tracks media_player entities to display lyrics when playing music.

Check out the custom component if you’re interested: genius-lyrics on GitHub

Screenshot of card:

10 Likes

Just installed this tonight - Simple installation, and absolutely what I have been looking for. Thanks so much. Great looking, and get most of the lyrics I have tried so far. Brilliant work!!

Im not a coder, but will try to get my head around this later, but I was wondering if it would be possible to add a loop, so that if no lyrics were found, and there was something in parenthesis in the Song Title - eg. Blowing in the wind (1965 Blues Remix), - and they sometimes come with square brackets [1965 Blues remix], then the parenthesis and content could be stripped out, and then retry calling the API?

Brilliant work !

1 Like

Thank you!

IIRC I think I already strip the naming. That process isn’t perfect because yea… sometimes it’s square brackets or parentheses, etc.

In the [hopefully near] future when I get some free time from work, I’d like to update the dependency python lib and some other cleanup. There are fixes to have waaayy more success finding songs. (You will find sometimes the lyrics are BS and actually a poem or something.)

Well, Im in a band (Bass) and my partner the vocalist, so we are often searching for lyrics, and I have found your implementation MUCH better and more accurate than any other service I have tried in the past, its literally only a couple of tracks that I have tried have failed - unlike may other services. So its great work all around.

Slightly off topic, earlier this week, I put together a Matrix LED display - which shows Song playing and artist, for the media playing on Sonos - which looks great (and you get to see all of the parenthesis added at the end of so many songs titles).

Thanks once again for your great work!

2 Likes

Thanks and enjoy!

Rad project :metal:

1 Like

can I put the info on my esphome lcd 16x02? how?? do u have the codes?? I dont know what to do more. :face_with_thermometer:
this code down isn’t working. whats wrong?

image

Hi,
I’m trying to set this up.
“Open the New API Client page and fill in App Name, App Website URL”
What is the App Name and App website URL?
Is it my Home Assistant external access URL?
Thx!

App name is whatever you want it to be… I used homeassistant

App Website URL, correct, it should be your HA external access URL

very cool ! could you explain how to achieve this result ?

I got it working but now I never get the lyrics and the sensor it’s not updating.
For sure, it’s a problem in my side, but I can’t figure it out.
I explained the problem here Still working? · Issue #25 · robert-alfaro/genius-lyrics · GitHub

Hope someone could tell me where I’m wrong…

Thanks

got this working :slight_smile:

please need help can I put the lyrics on my mqtt

does anyone know how to add value template for
content: “{{ states.sensor.everywhere_player.attributes.media_lyrics }}”

What are you trying to do?

hi im trying to show the lyrics on my awtrix mqtt clock if possible thanks if you can help
I can show the entity on clock just a matter of the template I think

The media lyrics attribute is none when no lyrics, otherwise has lyrics text.

That value template looks correct, I mean, it matches the template used in markdown card. Perhaps you can share more of the yaml to see more complete syntax?

Do you mean you want to make a template sensor that is the media lyrics attribute? You can use the helper menu to make that entity.

alias: AWTRIX show Lyrics
description: “”
use_blueprint:
path: Andy/awtrix_show_entity.yaml
input:
app_name: lyrics
entity: media_player.everywhere
value_template:
icon: “{{app_icon}}”
text: “{{ states.attributes.media_lyrics }}”
awtrix_device:
- aeeefe29c80c3cd3c2fb13d409c7f9a7
additional_options: {}
pre_actions:
- service: genius_lyrics.search_lyrics
metadata: {}
data:
entity_id: media_player.everywhere
enabled: false
app_icon: speaker

says none on my screen any help would be good thanks