Squeezbox OpenHab Binding issue

Hi:

I just setup a new home audio platform running max2play with a Squeezbox server. It works great, but for some reason I can’t seem to integrate it into OH, and from the debug it looks as if it is inserting characters into the MAC Address field upon replies? Please see the MAC Addr below as defined by ( squeeze:homeaudio.id=B8:27:EB:A9:28:5A ). I’m running v 1.81 of OH, and below are by items / cfg / sitemap:

squeeze:server.host=192.168.0.x
squeeze:server.cliport=9090
squeeze:server.webport=9000
squeeze:homeaudio.id=B8:27:EB:A9:28:5A

 Items:
Dimmer home_aud_volume      "Volume [%.1f %%]"	{ squeeze="homeaudio:volume" }
String home_aud_title       "Title [%s]"    	{ squeeze="homeaudio:title" }
Switch home_aud_play        "Play"      		{ squeeze="homeaudio:play" }
Switch home_aud_power 		"Home Audio" 		{ squeeze="homeaudio:power" }

Sitemap:
Frame label="Squeeze Box" {
Switch item=home_aud_power label="Power" 
Switch item=home_aud_play label="Play" 
Text item=home_aud_title
Slider item=home_aud_volume label="Volume" 
}

Here’s the Debug, and where it looks interesting:


2016-03-25 13:16:06.566 [DEBUG] [io.squeezeserver.SqueezeServer] - Sending command: B8:27:EB:A9:28:5A power 1
2016-03-25 13:16:06.575 [DEBUG] [io.squeezeserver.SqueezeServer] - **Message received: B8%3A27%3AEB%3AA9%3A28%3A5A power 1**

2016-03-25 13:16:15.206 [DEBUG] [io.squeezeserver.SqueezeServer] - Sending command: B8:27:EB:A9:28:5A play
2016-03-25 13:16:15.215 [DEBUG] [io.squeezeserver.SqueezeServer] - Message received: **B8%3A27%3AEB%3AA9%3A28%3A5A** play

2016-03-25 13:16:23.259 [DEBUG] [io.squeezeserver.SqueezeServer] - Sending command: B8:27:EB:A9:28:5A mixer volume 40
2016-03-25 13:16:23.269 [DEBUG] [io.squeezeserver.SqueezeServer] - Message received: **B8%3A27%3AEB%3AA9%3A28%3A5A** mixer volume 40
2016-03-25 13:16:23.343 [DEBUG] [io.squeezeserver.SqueezeServer] - Sending command: B8:27:EB:A9:28:5A mixer volume 40
2016-03-25 13:16:23.353 [DEBUG] [io.squeezeserver.SqueezeServer] - Message received: **B8%3A27%3AEB%3AA9%3A28%3A5A** mixer volume 40

It seems as if 3A get’s inserted into the message received field? Is this normal behavior? @ben_jones12 I think you wrote the binding for Squeezbox and wondering if you might know?

Thanks

3A is the ASCII code for : so is perfectly normal. Not sure about those ** around the message received log messages - is that something you have added?

Thanks @ben_jones12 appreciated, didn’t realize that was the ascii code. In regards to the **'s, I added those in the post to call it out, those where not in the debug. So based on the items / cfg and sitemap I think it looks ok, and based on the deug, it looks like a command and response is sent, but nothing ever seems to happen when I try and control it from the sitemap? I am using max2play and it runs the Logitech Media Server, ( Squeezserver ) as well as squeezlite, would that be a possible problem at all?

The binding only talks to the Squeezeserver, so not directly to any clients. So I don’t think it should matter what type of clients you have. I have a combination of Booms, Touch and RPis running Squeezelite and they are all working just fine.

Perhaps try a different control app - i.e. something like http://code.google.com/p/squeezy. If that has the same problems at least we can rule out the binding!

Hey @ben_jones12 Thanks for the suggestion on Squeezy. I gave it a try and no issues commanding the Squeezelite Server:

openhab@openhab:/tmp/squeezy-master/squeezy-master$ sudo ./squeezy -homeaudio -next
HomeAudio selected
HomeAudio genre No Genre
HomeAudio artist Florida Georgia Line
HomeAudio album Anything Goes
HomeAudio title Confession
HomeAudio duration 191.573
HomeAudio time 0
HomeAudio remote 0
HomeAudio current_title Confession
HomeAudio path file:///music/Florida_Georgia_Line-Anything_Goes-Deluxe_Edition-CD-FLAC-2014-PERFECT/10%20Confession.flac
openhab@openhab:/tmp/squeezy-master/squeezy-master$

Anything else I could possibly try that you might know of? Thanks again very much for the help

Not sure what it could be then sorry. It is definitely working just fine for me (and quite a few others). The only thing I can think of is to check for any strange/extra whitespace characters in your config files. openHAB can be a bit sensitive to these, but based on your log messages everything looks like it is configured and working fine.

Sorry I can’t be of any more assistance.

Thanks @ben_jones12 It’s so odd, It almost looks like it is dropping a connection ( ie: The following messages are from me trying from the SqueezeServer itself ( play / pause ) and then also from the OH Sitemap:

2016-03-25 21:06:24.610 [DEBUG] [io.squeezeserver.SqueezeServer] - No connection to SqueezeServer, will attempt to reconnect now...
2016-03-25 21:06:24.611 [INFO ] [io.squeezeserver.SqueezeServer] - Squeeze Server connection started.
2016-03-25 21:06:24.611 [DEBUG] [io.squeezeserver.SqueezeServer] - Sending command: B8:27:EB:A9:28:5A stop
2016-03-25 21:06:24.618 [DEBUG] [io.squeezeserver.SqueezeServer] - Squeeze Server listener started.
2016-03-25 21:06:24.618 [DEBUG] [io.squeezeserver.SqueezeServer] - Sending command: players 0
2016-03-25 21:06:24.618 [DEBUG] [io.squeezeserver.SqueezeServer] - Sending command: listen 1
2016-03-25 21:06:24.663 [DEBUG] [io.squeezeserver.SqueezeServer] - Message received: B8%3A27%3AEB%3AA9%3A28%3A5A stop
2016-03-25 21:06:24.665 [DEBUG] [io.squeezeserver.SqueezeServer] - Message received: players 0  count%3A1 playerindex%3A0 playerid%3Ab8%3A27%3Aeb%3Aa9%3A28%3A5a uuid%3A ip%3A192.168.0.160%3A35714 name%3AHomeAudio model%3Asqueezelite isplayer%3A1 displaytype%3Anone canpoweroff%3A1 connected%3A1
2016-03-25 21:06:24.665 [DEBUG] [io.squeezeserver.SqueezeServer] - Sending command: B8:27:EB:A9:28:5A status - 1 subscribe:10 tags:yagJlN
2016-03-25 21:06:24.677 [DEBUG] [io.squeezeserver.SqueezeServer] - Message received: listen 1
2016-03-25 21:06:24.715 [DEBUG] [io.squeezeserver.SqueezeServer] - Message received: B8%3A27%3AEB%3AA9%3A28%3A5A status - 1 subscribe%3A10 tags%3AyagJlN

The wiki says (and said before I edited it the other day) that the MAC address must be specified with lower-case letters:

MAC addresses of players are case-sensitive. Use small letters (a-f) if the address contains them.

I haven’t checked the source to confirm this is true.

1 Like

Hello @watou Thank you kindly for your suggestion! It worked like a charm as soon as I changed from upper to lower case! I’m on 1.81 of OH, and I went through the wiki, and must have missed that, my oh.cfg didn’t mention the case sensitivity:

# Id (MAC address) of your first Squeezebox
squeeze:HomeAudio.id=b8:27:eb:a9:28:5a
# Id (MAC address) of your nth Squeezebox
#squeeze:<boxIdN>.id=

But I clearly see it on the wiki, and as soon as I made that change, everything works perfectly! Thank you all very much for your suggestions and help! I was just about to rebuild a SqueezServer to try again.

Thanks!

1 Like

I think (from memory) the binding does a direct string compare when looking up the player id (i.e. MAC address). This should really be changed to be case insensitive and would likely be a very simple fix. Maybe add an issue to Github for this and someone (possibly me if I find time) can fix it.

Thanks @ben_jones12 appreciated! While on topic, From the wiki I don’t see an item that maps to skip next / previous track. I believe it is possible with an HTTP Get request, but I’m a bit confused about how to implement? I’ve created the items as follows:

Number home_aud_next		"Next Track"		(gSqueeze)
Number home_aud_prev		"Prev Track"		(gSqueeze)

Rule:

//SqueezBox Next / Prev Track Rule Start*/

rule "Squeezebox Next Track"
when
    Item home_aud_next received command
then
	sendHttpGetRequest("http://192.168.0.1:9000/status.html?p0=playlist&p1=jump&p2=%2b1&player=b8%3A27%3Aeb%3Aa9%3A28%3A5a")

 end

rule "Squeezebox Prev Track"
when
    Item home_aud_prev received command
then
	sendHttpGetRequest("http://192.168.0.1:9000/status.html?p0=playlist&p1=jump&p2=-1&player=b8%3A27%3Aeb%3Aa9%3A28%3A5a")
    
 end

//SqueezBox Next / Prev Track Rule End*/

But when I try it, I get the following in the Log, with no track changes:

2016-03-27 15:11:16.801 [WARN ] [o.i.r.i.resources.ItemResource] - Received HTTP POST request at 'items/home_aud_next' with an invalid status value 'ON'.

Would anyone have any thoughts were I’m going wrong?

Pretty sure this is supported, just not documented…

Switch      GF_Living_Music_Next      "Next"         { squeeze="living:next" }
Switch      GF_Living_Music_Prev      "Prev"         { squeeze="living:prev" }

Worked perfectly thanks!

Added to wiki.

1 Like

I was going to mention that we should add :wink: Thanks greatly again guys! Appreciated.

1 Like