I typically use iHeart Radio, XM Radio and Spotify for my music and have a dashboard with presets. However, whenever I play anything other than Spotify, the album art tile just displays text only. Is this something that can be fixed?
@Gary_Tomkinson, the album art image would depend on what
audioTrackData attribute the Sonos device reports for the specific media (radio) is being played. See below for the examples of the
audioTrackData returned by different stations, and first one simply doesn’t have much media information though.
To add to what James said above, things are slightly different between SmartThings and Hubitat.
The SmartThings Sonos integration reports the data on the
audioTrackDataattribute and usually includes direct album art URLs for sources like Spotify. Otherwise if artwork is unavailable, the tile searches for artwork based on the reported album and artist name.
The Hubitat Sonos integration reports the data on the
trackDataattribute and does not include a direct URL to the album art URLs, so the tile does a search for matching album art based on the reported album and artist name.
For sources like Spotify, the reported album and artist are usually pretty good and results in matching artwork for common songs. Unfortunately radio providers are a mixed-bag oftentimes not reporting the album or artist at all or sometimes reporting quirky information (like reporting the radio DJ as the artist).
At the moment, I’m torn between using the native Hubitat Dashboards or SharpTools. I have a wall tablet in my office that looks as follows with both dashboards:
To be fair, I can achieve everything I need to in Hubitat but I much prefer the interface of SharpTools and in particular, how HSM interfaces with the user. I just need the album art issue resolved! LOL
I have a couple of ways of skinning this cat. A guy - way smarter than I wrote a driver to pull track image data from my jishi/node-sonos-http-api server for displaying in dashboards. I figured if there are these limitations from SharpTools that you mentioned previously, I could leverage this method of displaying album art in my SharpTools dashboard using a 3x3 media tile.
Here’s the virtual device that pulls the album art from my jishi/node-sonos-http-api server. Notice the albumArtUri field under the image and the URL…
So in SharpTools, I created a variable called albumArtUri that populates the URL with the image representing the current track…
This variable changes almost instantly when the virtual device driver updates the album art.
My million dollar question is this: How can I display the albumArtUri variable as a media tile in SharpTools?
Can you share a link to the driver? If it implements the core Music Player capabilities and could be tweaked to report the album art URL as part of the
trackData, then you could use it as a replacement for the native Hubitat Sonos Integration.
This relies heavily on the user having a jishi/node-sonos-http-api server running for Sonos control.
Did you see my question about publishing a URL as a media tile - populated from a variable?
@Gary_Tomkinson, I might have missed something, but I didn’t see the specific device driver to pull the album art from the node-sonos-http-api bridge in the link you posed.
Using variable in the media URL sounds like a very cool idea, but is not currently supported. Can you please create a Feature Request with the detailed use case described here? So others who are interested can cast their votes as well.
@James, so the link I provided to tomw’s code… You would create a custom driver in Hubitat using his code. My driver is called “Sonos Buttons”. Then you would create a virtual device and assign his driver to that device. I called my virtual device “Office Sonos Buttons”. This new virtual device will need two IP’s; one for the Sonos speaker, the other for the node-sonos-http-api server.
Once this is done, opening this virtual device will show the album art for that speaker. But this is a seperate device to the Sonos speaker, you’re not changing the driver on the actual Sonos speaker.
@James I had to click through a few links (and scroll down through the threads), but I think this is the set of drivers being referenced:
From a brief review, it looks like the device is exposed more like a Pushable Button with N number of buttons that you can choose what commands they map to. The device also exposes a custom attribute for the album art.
Looking through the thread history, it looks like Tom was looking for a way to expose Sonos grouping / ungrouping and custom commands that weren’t available in the stock Sonos integration… so it seems to be exposed as more of an ‘add on’ than a replacement for the stock integration. Unfortunately, that means it’s not just a simple tweak to remap the attribute as the device is fundamentally missing a number of basic Music Player features. It seems like the basic hooks are there to read data from the Sonos device and send commands, so it certainly could be done but it’s not just a tiny tweak like I originally hoped it might be.
It sounds like creating a SharpTools Feature Request to support variables in Media Tiles would certainly be helpful here.
I think there are other approaches that could be used to expose the custom album art URI, but I would want to take some time to mock up the idea. For example, a simple ‘App’ in Hubitat could be used to expose the image URL directly to SharpTools… I still think that stubbing some basic Music Player capability into Tom’s integration would be cleanest though as it would also provide you basic control on the standard Album Art tile (eg. tap to toggle play/pause, double tap to skip tracks).
You’ve summed this up accurately. It lends itself to control of Sonos devices via the native Hubitat dashboards via button controllers.
Don’t sink any more time into this as I think there are too many uncontrollable parts to it!
Please link to the Feature Request topic if/when it gets created
Here you go! Support for Variables in Media Tiles