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.
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
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.
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.
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
}
}