Recent Squeezebox binding changes

I wanted to mention some recent changes to the squeezebox binding. Hopefully you’ll see this before you stumble upon the differences. :wink: These changes should show up in builds starting with build 1247. If you run into any issues, please post here.

The major change, and the one that may cause you an issue if you use notifications, is the removal of the notificationSoundVolume channel. This channel has been replaced by a config parameter on the Player thing. In addition to maintaining consistency with other bindings (e.g. Sonos), the change also affords more flexibility in setting the notification volume.

Here’s the priority scheme that controls the volume of notifications.

  • The playSound and say audio action APIs have been extended to include a volume parameter. A volume level provided in the API will take precedence over any other volume setting. See examples here. This makes it possible for a rule to play the notification at a specific volume level using just one API call.

  • If the volume is not specified in the playSound/say API, the volume setting specified in the Player thing configuration will be used.

  • If there is no volume specified in the Player thing configuration, the player’s current volume will be used to play the notification.

Also, there is now a notificationTimeout config parameter on the Player thing to provide greater user control over notification duration, as well as to maintain consistency with Sonos notification functionality. The default duration is 20 seconds; if you need a longer timeout, simply increase the notification timeout parameter in the Player thing.

Finally, there is a fix for the play/pause channel not updating when the mode is changed from outside openHAB. For example, if you change the play/pause mode from the LMS web UI, the playPause channel in openHAB will update.

3 Likes

Nice work Mark! Any luck with the resuming the correct track when the playlist is on random?

Also, do we know if the artwork works now?

It’s on my list, but I haven’t gotten to it yet.

The artwork should work fine. Let me know if you run into any problems with it.

1 Like

Artwork is working fine on my build taken from Github a few months back. Only issues are that it doesn’t update in HabPanel when the next track starts and there’s no album art when streaming from Spotify. I doubt either of these issues are down to the binding but haven’t explored the problem.

Hmm, that’s interesting. It updates in my HABpanel when the artwork changes. I wonder what’s different. I made some fixes to the artwork processing on Jan 26. When did you pull your version?

What do you see when you stream Spotify (I just use Pandora and Slacker these days)? Do you get the default artwork image from the LMS? What artwork do you see in the LMS when you stream Spotify?

The file’s dated from the 22nd of Jan. I’ve got another binding to update so will pull the latest version at the same time. I’m running HABPanel inside HABPanelViewer but it does the same in Chrome too.

It’s like an image not found icon when I stream from Spotify. I’m using the Spotty plugin, but the album art appears as expected in the LMS web client.
image

Ok. My changes were merged on the 26th. There definitely were issues with the artwork updating prior to the changes that went in on the 26th. Would be interested to get your experience after you update.

Hmm, I’ll take a look at this. Let me know if you see any difference after you update to the latest version.

Been awhile since I did anything with lms. Is it still the standard or has something taken the place of the old squeezebox server?

My Eclipse install is acting up. Can you point me towards a recent jar file? I couldn’t spot it on Github

This should be the latest.
https://openhab.ci.cloudbees.com/job/openHAB2-Bundles/lastSuccessfulBuild/artifact/openhab2-addons/addons/binding/org.openhab.binding.squeezebox/target/org.openhab.binding.squeezebox-2.3.0-SNAPSHOT.jar

1 Like

Still alive.

I loaded the latest jar on this morning but having trouble. I use the things file to define the bridge as so:

Bridge  squeezebox:squeezeboxserver:jukebox        [ ipAddress="192.168.3.11", webport=9000, cliport=9090 ]
{
        Thing   squeezeboxplayer        KitchenSqueezebox       [ mac="b8:27:eb:b1:54:f6" ]
        Thing   squeezeboxplayer        LivingRoomSqueezebox    [ mac="aa:aa:b2:b1:b7:c5" ]
        Thing   squeezeboxplayer        SpareRoomSqueezebox     [ mac="aa:aa:d7:a2:2b:90" ]
}

In Karaf bundle:list shows the SqueezeBox list there once, however if I query the things it states that it is not initialized.

squeezebox:squeezeboxserver:jukebox (Type=Bridge, Status=UNINITIALIZED, Label=SqueezeBox Server, Bridge=null)
squeezebox:squeezeboxplayer:jukebox:KitchenSqueezebox (Type=Thing, Status=UNINITIALIZED, Label=SqueezeBox Player, Bridge=squeezebox:squeezeboxserver:jukebox)
squeezebox:squeezeboxplayer:jukebox:LivingRoomSqueezebox (Type=Thing, Status=UNINITIALIZED, Label=SqueezeBox Player, Bridge=squeezebox:squeezeboxserver:jukebox)
squeezebox:squeezeboxplayer:jukebox:SpareRoomSqueezebox (Type=Thing, Status=UNINITIALIZED, Label=SqueezeBox Player, Bridge=squeezebox:squeezeboxserver:jukebox)

Strangely, I can see the server in the PaperUI Inbox. Do you have any ideas what I should try? OH has been restarted already.

Let me see if I can recreate this.

This would be expected. The upnp discovery service is finding the LMS server and adding a server thing it to the inbox.

I took your things file above, and changed the IP and MAC addresses to my devices. The Server and Player things all showed up in Paper UI and are ONLINE.

In the console I see:

squeezebox:squeezeboxserver:jukebox (Type=Bridge, Status=ONLINE, Label=SqueezeBox Server, Bridge=null)
squeezebox:squeezeboxplayer:jukebox:KitchenSqueezebox (Type=Thing, Status=ONLINE, Label=SqueezeBox Player, Bridge=squeezebox:squeezeboxserver:jukebox)
squeezebox:squeezeboxplayer:jukebox:LivingRoomSqueezebox (Type=Thing, Status=ONLINE, Label=SqueezeBox Player, Bridge=squeezebox:squeezeboxserver:jukebox)
squeezebox:squeezeboxplayer:jukebox:SpareRoomSqueezebox (Type=Thing, Status=ONLINE, Label=SqueezeBox Player, Bridge=squeezebox:squeezeboxserver:jukebox)

What version of OH are you on? I’m wondering if there might be an incompatibility between the binding and older framework versions. There have been quite a few changes to the framework in the last few months, some of which caused some issues. In particular, the change of scheduler from static to non-static might impact the ability of the binding to connect to the LMS.

This was discussing compatibility of old bindings with the new ESH build, but there may be a similar problem in the reverse scenario.

Edit: Do you see any unusual ERROR or WARN messages in the log file?

I’m on OH 2.2.0. I didn’t see any strange errors in the log after a restart. I’ll remove all things and items from Karaf and try again.

The binding uses scheduler to make the connection to the LMS. The difference (static vs non-static) between scheduler the ESH in 2.2 and the ESH in recent snapshots may be the cause. It may be failing silently, as well.

If you put the binding in DEBUG or TRACE mode, you may see signs of it trying to connect to the LMS (or maybe not). If it can’t get a connection to the LMS, I think the things will be stuck in UNINITIALIZED.

I’ll qualify all the above with the fact that this is still a guess on my part. There may be some other cause that I don’t yet understand.

1 Like

I tried adding it via PaperUI and the new thing also says uninitialized. I’m going to wait for 2.3.0 and will try again, then feedback my findings.

EDIT: Rather than wait for 2.3.0 I upgraded to the snapshot. Pleased to report that the album art now changes when I skip track and is also scrapped when using Spotify. Great work @mhilbush :slight_smile:

1 Like

Just upgraded to latest snapshot #1265
Channel definition of notificationVolume works well
but trying to set the notification volume in the say command:

say(msg,"voicerss:enUS", "squeezebox:squeezeboxplayer:3D34F084-8A16-4E61-B593-B5D5B673E4BF:801f02f8f9d4", 60)

(with msg being a string), results in error message:

2018-05-01 09:20:23.320 [ERROR] [ntime.internal.engine.RuleEngineImpl] - Rule 'VoiceCMD': An error occurred during the script execution: Cannot convert number literal to typeorg.eclipse.smarthome.core.library.types.PercentType

Also VScode gives the same error for the say command above;
No big deal as the system responds to channel settings but thought you wanted to know; as always, thanks much @mhilbush

Try this

say(msg,"voicerss:enUS", "squeezebox:squeezeboxplayer:3D34F084-8A16-4E61-B593-B5D5B673E4BF:801f02f8f9d4", new PercentType(60))

If that works, I’ll need to fix the documentation…

2 Likes

Works like a charm, thanks so very much!!!

1 Like