[SQUEEZEBOX] Favorities

just for information:
i also updated to 2.5.3-1 (openhabian) but favorites still work quite normal here

good to know, thanks!

@zacofunny I actually saw this issue on my system yesterday.

I had installed a new version of the binding in my addons directory (I’m looking into how to support like/unlike on Pandora and Slacker). Somehow, the favorites were set properly on the server handler’s favorites channel, but the players had no favorites. I looked at the code again, but I really don’t see what could be causing the issue. Once the player handler gets the list of favorites (which I know it does based on the debug logging), what it does with the favorites list really is quite simple.

I added some additional debug logging, which may help identify where things are going wrong. Let me know if you would like to try the version with additional debug logging. As an added bonus, you can test out the like/unlike functionality if/when I get it working.

Ok, this is officially strange.

I can see everything working all the way up to the call to stateDescriptionProvider.setStateOptions in the SqueezeBoxPlayerHandler. setStateOptions is being called with a valid channel and a list of state options for the playFavorite channel.

But, when you try to access the state options using an item linked to the playFavorite channel, either in a UI using a Selection object, or in a rule using PlayFavoriteItem.getStateDescription.getOptions, there are no state options.

I really don’t know what to make of this. Restarting the squeezebox bundle doesn’t clear the issue.

@cweitkamp I seem to recall you are pretty familiar with state options. Do you have any insight what might be going on here?

hi mark,

as additional info: perhaps you remember my post last year where i had the same issue:

i tried quite a lot but i couldn´t get it work then so i gave up and left this feature.

meanwhile i installed openhabian completely from scratch, not quite sure if it is the same hardware, actually i use a raspberry 4b (4 gb) maybe then i still had a raspberry 2b working.

but now i tried again and find the playfavorite is working. i did not try it for a long time and now i am happy to see everything is fine.

best, stefan

FYI, I opened a separate thread on this.

See Dynamic state options not showing up.

@zacofunny or @bastler By any chance were you using the sony binding when you were experiencing the problem?

If not, can you run this command in the console to see which of your installed bindings are using a dynamic state description provider?

bundle:services | grep DynamicStateDescriptionProvider

no, i never used it. this is the result of you command:

openhab> bundle:services | grep DynamicStateDescriptionProvider
[org.eclipse.smarthome.core.thing.type.DynamicStateDescriptionProvider, org.openhab.binding.mqtt.generic.MqttChannelStateDescriptionProvider]
[org.eclipse.smarthome.core.thing.type.DynamicStateDescriptionProvider, org.openhab.binding.onewire.internal.OwDynamicStateDescriptionProvider]
[org.eclipse.smarthome.core.thing.type.DynamicStateDescriptionProvider, org.openhab.binding.squeezebox.internal.SqueezeBoxStateDescriptionOptionsProvid                                             er]
openhab>

as i said, now for me the playfavorite works, i will be glad if i can help or try out something but maybe difficult if no problem here.
i checked meanwhile that the hardware is the same since then, the only thing i changed was a new sd-card when installed from scratch. even the installed bindings were the same - of course in older versions

Ok, no worries. If it’s working for you, there’s probably nothing for you to do.

I’m pretty sure @zacofunny uses the sony binding. That being the case, it’s highly likely that’s what’s causing the issue he’s having. There will be a change to the sony binding soon, which should resolve it for him.

There also will be a change to the OH3 core to avoid the issue altogether.

Hi Mark, I’m sorry but I’m now very busy at work, and will get back to this topic ASAP. Yes I use Sony Binding!

When you get a chance, read this thread. I’m very confident that the issue will go away when you install a new version of the sony binding. I built a version of the sony binding with the fix, and my favorites now are working again. I’m happy to have gotten this sorted out. It was a tough one to track down.

1 Like

Hi Mark, I’m very happy that fortunately you were able to diagnose this issue!
Right now I have had reinstalled OpenHAB due to this issue to make it work again. So I’m not sure right now how to force this issue to occur in order to test your fix. BTW when can I find your Sony binding build?

Me either. I think it depends on the order in which the dynamic state description providers are loaded. From what I can guess, if the description provider for the sony binding is loaded before the others, then you would experience the issue; otherwise not. Unfortunately, I don’t know of a way to control the order of loading.

I’d prefer not to proliferate rogue bindings, and would rather you wait until Tim builds a new version of the sony binding with the fix (I asked him this morning if he would do this). In the meantime, if you start experiencing the problem again, just ping me.

1 Like

Will do, thanks very much!

@zacofunny New build of sony binding with fix. Sony Devices Binding

Hi! Thanks very much @mhilbush & @tmrobert8. I’ve just updated to the newest revision. Now I guess we need to wait for the next OH milestone update to verify if it works, unless you know some quicker way to do that.

I don’t know how to force the problem to occur, because it depends on the order in which bindings are started (which can be non-deterministic). However, I’m VERY confident issue won’t reoccur.

Hi I’m robbing this thread a little bit.
I have a setup taht worked nice in OH 2 but in OH 3.01 i get som strange error regarding favorite

This rule gets

// Triggers:
// - When squeezeKokPlay changed from OFF to ON

// context: squeeze-8
if(squeezeKokPlay.state==ON){

val String theOne = squeezekokfavorite.state.toString

for(String favorite : squeezefavorite.state.toString.split(",")) { //LMS server favoriteslits channel
    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)) {
       sendBroadcastNotification("Du lyssnar på " + name +" i köket " + "Utomhustemperaturen just nu " + gT_Utetemp.state + "°C") // Do something with name
    }
}
}

This Error in openhab log
Script execution of rule with UID ‘squeeze-8’ failed: Index 1 out of bounds for length 1 in squeeze

Idon’t know where t start looking for troubles.

Try logging the state of your squeezefavorite item. If it’s not formatted correctly, or NULL, it could generate that error.