Im trying to get the now playing artwork from my sonos to add to my dashboards. Under the attributes of the media_player I get:
entity_picture: /api/media_player_proxy/media_player.bedroom?token=averylongstringthatchanges
Ive created a sensor that grabs that attribute, is there a way to create a script or template that will create a good url for me? So somehow say add that attribute or sensor to https://nobody.duckdns.org ?
Well now it seems even using the token it is downloading the image. Anyone know how to save that image somewhere and use it? It would need to overwrite the file and keep the same name…
I got it working, but I am running into that caching issue. Only on the dashboard though, if I force a reload on my browser it updates the pic every track.
Have you ever figured this part out @Rene ? I know you guys were messin with it few months back in that thread.
I tried the refresh option in the widget and without it. I also have that force_compile in:
i only helped others with it, because i never used anything like that.
i know someone had a working situation, but dont know who anymore.
but i also think i remember i saw something about it being broken again.
the cashing is about the same url.
wasnt it that a counting nr at the end of the url did help there?
maybe create the same url twice for the pic, and let AD change between the 2?
Hey Rene. That’s an interesting idea. I’m guessing the iframe does a sort of round robin then with the urls and refresh set to 10 would switch urls every ten sec?
I found something that half works. I’m using the iPad kiosk pro app that aimc turned me on too when I was first getting my feet wet.
In the app settings there’s an option to clear all cache when returned to the homepage(first tab on my dashboard). Once I go back to that page and return the sonos page it’s refreshed. But I don’t like that. I have a lot of people over to play pool and I want to leave the sonos page open by the pool table to be able to look quickly and change quickly. With that solution I have to set a timeout value in the app that takes it back to the homepage. Setting the homepage as the sonos page is not a way I’d like to go. I’ll try out your suggestions and report back. Thanks again!
Then take that url you get from that camera entity in HA and add &api_password=yourhapassword to the end of the url, then add it to your dash file:
bedroom_media_art:
widget_type: camera
entity_picture: https://_xxx_.duckdns.org/api/camera_proxy/camera.generic_camera?token=_reallylongstringofcharectors_&api_password=_yourhapassword_
refresh: 10
Now without changing dashboards or any interaction at all with the dashboard when the song changes, the dashboard changes to the new artwork in a few seconds.
Perfect!!! Thanks for all the help @rene ! You left enough bread crumbs around this forum to piece it together
very nice solution!!
the first step, gettin back to the source, and take it from there, was the smart move.
thx for sharing, it will help me help others
OK, lets keep going
When im watching TV and the sonos are not playing music, the image is just absent. Thats fine its transparant doesnt look like theres an error or anything like that. BUT…Id like to use an image for when nothing is playing, maybe a picture of me lol or a picture of my tv…something. Using widget style I see you have the option for some css stuff… widget_style: "background: white;"
but could you set the background to an image? So if no artwork is available it would just display what is “behind” the artwork?
One thing about sonos is the control is sometimes a pain…but now this solves that, im loving it.
if it still shows the “no picture” you probably need conditional css.
so something in the css that says “if pic is empty then hide”
unfortunatly i dont know if and how that is possible without changing the javascript from the widgets.
i think you should look in your home assistant logfiles why it isnt working.
and if there is nothing you should use debugging for home assistant. (setting loglevels different for cams.)
or search for spotify on the forum.