Squeezebox favorites

Hi all,

I seem to have a similar problem, but i can’t figure it out.
Running OH 2.5.4-1 freshly installed 2 days ago after a corrupted SD card…

installed bindings
-Astro
-Hue
-MQTT
-MTP
-Samsung TV
-Sonos
-Squeezebox (the fixed version mentioned above)
-Z-wave

The restart of the binding gives the following messages:

2020-05-13 16:49:21.254 [DEBUG] [SqueezeBoxPlayerDiscoveryParticipant] - Request player job scheduled to run every 60 seconds
2020-05-13 16:49:21.321 [DEBUG] [rnal.handler.SqueezeBoxServerHandler] - initializing server handler for thing squeezebox:squeezeboxserver:squeezeserver
2020-05-13 16:49:21.338 [DEBUG] [rnal.handler.SqueezeBoxServerHandler] - listener connection started to server 192.168.0.146:9090
2020-05-13 16:49:21.371 [DEBUG] [rnal.handler.SqueezeBoxServerHandler] - Sending command: players 0
2020-05-13 16:49:21.376 [DEBUG] [rnal.handler.SqueezeBoxServerHandler] - Sending command: listen 1
2020-05-13 16:49:21.413 [DEBUG] [rnal.handler.SqueezeBoxServerHandler] - Sending command: b8:27:eb:42:2c:f4 status - 1 subscribe:10 tags:yagJlNKjc
2020-05-13 16:49:21.501 [DEBUG] [rnal.handler.SqueezeBoxPlayerHandler] - player thing squeezebox:squeezeboxplayer:squeezeserver:b827eb422cf4 initialized with mac b8:27:eb:42:2c:f4
2020-05-13 16:49:24.375 [DEBUG] [rnal.handler.SqueezeBoxServerHandler] - Sending command: favorites items 0 100
2020-05-13 16:49:31.260 [DEBUG] [rnal.handler.SqueezeBoxServerHandler] - Sending command: players 0
2020-05-13 16:50:31.262 [DEBUG] [rnal.handler.SqueezeBoxServerHandler] - Sending command: players 0
2020-05-13 16:55:36.106 [TRACE] [rnal.handler.SqueezeBoxPlayerHandler] - Player b8:27:eb:42:2c:f4 updating favorites list with 4 favorites

Item is set and linked to channel but is not populated and empty in my sitemap.

Does anyone have a clue?

Kind regards,
Tedje

Please run this on the console and report back the output.

services | grep StateDescriptionProvider

Hi Mark,

Thanks for helping me!

This is the output:

[org.eclipse.smarthome.core.thing.type.DynamicStateDescriptionProvider, org.openhab.binding.mqtt.generic.MqttChannelStateDescriptionProvider]
[org.eclipse.smarthome.core.thing.type.DynamicStateDescriptionProvider, org.openhab.binding.sonos.internal.SonosStateDescriptionOptionProvider]
[org.eclipse.smarthome.core.thing.type.DynamicStateDescriptionProvider, org.openhab.binding.squeezebox.internal.SqueezeBoxStateDescriptionOptionsProvider]

Those bindings all have well-behaved StateDescriptionProviders, so that doesn’t appear to be an issue.

And from the log you posted, the SqueezeBoxServerHandler clearly is sending the favorites to the Player Handler.

Can you share your item and sitemap definitions for the Player Handler’s playFavorite channel?

Also, if you have an item linked to the SqueezeBox Server’s favoritesList channel, can you share the state of that item?

From the console, run this and post the result.

smarthome:items list | grep NameOfTheItem

The output from the console:

wkradio_fav (Type=StringItem, State=NULL, Label=Play Favorite, Category=null)

Item:

String wkradio_fav    "Play Favorite [%s]"  { channel="squeezebox:squeezeboxplayer:squeezeserver:b827eb422cf4:playFavorite" }

Sitemap:

Selection item=wkradio_fav label="Favorites" icon="office"

Item and sitemap look OK.

But I actually was looking for the state of the server’s favoritesList channel.

Also, can you try doing a restart of the binding.

bundle:restart org.openhab.binding.squeezebox

The output for the server:

serverfav (Type=StringItem, State=NULL, Label=null, Category=null)

And if i change the checkbox in PaperUI:

serverfav (Type=StringItem, State=0="NPO Radio 2",1="Omroep Venlo",2="Radio 10 103.8 (Classic Hits)",3="Arrow Classic Rock (Classic Rock)", Label=null, Category=null)

The favorites do show up and are working in my player in the PaperUI btw.

Restart does not change anything, tried it several times.

I’m running out of ideas…

Can you try removing the label tag on the sitemap Selection widget?

Tried removing label, icon and restart the binding, but nothing happens…
And i ran out of ideas a few hours ago :wink:

I’m now officially out of ideas. If I can think of anything else to try I’ll post back here.

Thanks for your help, i’ll try installing a second raspberry pi and try some more.

Hi! Some update from myself after upgrading Openhab to latest version. So, after I did it OH restarted and the favorites don’t show under their assigned item. However they are going back when I add or remove one of the favorites on LMS. I didn’t try restarting LMS so I can’t tell now if this would be enough. Restart of OH doesn’t fix it. I don’t know how it works, but does the binding request for favorities update when starting?

The binding requests the favorites when the binding starts, and when the favorites are changed on the LMS.

In the released version of the binding, there’s a race condition at startup where sometimes the player handler is not fully initialized when the server handler tries to send it the favorites. This is fixed in a PR that hasn’t been merged yet.

1 Like

Found your question looking for the same answer. As I did not liked the answer, and I dont know if you are still looking for it, but I found a workaround, all you have do do is copy the URI from the playlist, as a share, in the spotify app, and create a favorite with a name you can give and URI you just got on the LMS interface. Worked for me

2 Likes

Thanks for sharing.
Will try it out next time OH gets some TLC :slight_smile:

Hi there

I’m using this functionality booth in rules and sitemaps superb jobb. Maybe I’m missing something in my rule functionality, but I woluld like to find a way to send Favorites Name and not only ID wich I can now. I have a special button triggering my morning routine starting radio and send a messeage containing temperature and stuff.


squeezekokfavorite.sendCommand(“1”)
sendBroadcastNotification(“Lugna favoriter” + squeezekokfavorite.state.toString)

You should be able to pull the favorites list from the favoritesList channel of the squeezebox server thing, then use the ID to lookup the favorite name. You would need to first split the list on "," to create an array of favorites, then iterate through the favorites splitting each favorite on "=" to separate the id from the name. I can post a code snippet if you’re not sure how to do this.

Something like this:

    val String theOne = "1"

    for(String favorite : FavoritesListItem.state.toString.split(",")) {
        val String[] fav = favorite.split("=")
        val String id = fav.get(0)
        val String name = fav.get(1)
        //logInfo("test", "(id,name) = ({},{})", id, name)
        if (theOne.equals(id)) {
            // Do something with name
        }
    }