Squeezebox configuration

Tags: #<Tag:0x00007efec4af60d0>

I’ve spent many hours researching the forums but can’t play an mp3 file using the squeezebox binding in OpenHAB2.
I have a working squeeze server and multiple players. The configuration iterations have me royally confused, so I’m trying to stick with the newest documentation as much as possible.

Primary Reference:
http://docs.openhab.org/addons/bindings/squeezebox/readme.html

Thing Configuration makes sense and all players are recognized. I configured multiple players with correct mac address. My webport is 9002. My server is not a client (as I understand?), but I left the 9090 in place.

Bridge squeezebox:squeezeboxserver:myServer [ ipAddress=“192.168.1.10”, webport=9000, cliport=9090 ]
{
Thing squeezeboxplayer myplayer[ mac=“00:f1:bb:00:00:f1” ]
}

In paper UI, the various channels show up for the players, however my server does not report any channels. All players and server are reported to be “online”. I’m not sure what notificationSoundVolume is supposed to be a channel for, but it does not show up as a channel for the players.

I couldn’t find any documentation of the syntax for playing a local file other than here:
https://groups.google.com/forum/#!topic/openhab/keYmpMhGtGc

squeezeboxPlayUrl(“kitchen”, “file://localhost/usr/local/share/openhab/doorbell-2.mp3”, 50)

I spent a lot of time trying to adapt this to my players, but kept getting errors. I’m not clear on the proper syntax at this point. The example rule uses the following syntax:

say(“The garage door is open!”, “voicerss:enUS”, “squeezebox:squeezeboxplayer:5919BEA2-764B-4590-BC70-D74DCC15491B:20cfbf221510”)

My squeeze player Things are defined consistent with squeezebox:squeezeboxserver:myServer:myplayer, so where does 5919BEA2-764B-4590-BC70-D74DCC15491B:20cfbf221510 come from?

I tried replacing “kitchen” with every combination of I could think of using the full Thing name and my player’s mac address. In all cases I seem to be getting syntax errors.

As I came to a dead end here, I moved on to trying to make a squeeze player a default audio sink. The option does not show up in the Paper UI configuration. I then edited conf/services/runtime.cfg to define the default audio sink as squeezebox:squeezeboxserver:myServer:myplayer as well as several other attempted combinations such as squeezebox:squeezeboxserver:myServer:<mac> or squeezebox:<mac> In all attempts, I receive a player not found error.

Normally I would post my actual configurations, but I don’t have access to my server at the moment.

I added the squeeze server via paperui and had to define some string items foreach player like this :

String mySqueezePlayer "Stream" { channel="squeezebox:squeezeboxplayer:Mediasrv:885e6db26de0:stream" }

And then update that string item with what i wanted to play like:

mySqueezePlayer.sendCommand("my.mp3")

At least, that’s how I understand the works of it in OH2

Thanks, will try that.
885e6db26de0 is player mac address, correct?
Is Mediasrv the name of the server or the player?

Yes the mac address of the player but you should also see this channel line on the “thing” that’s discovered when you add the server.
And yes, “mediasrv” is the name of the server

1 Like

I ended up removing all of my ‘thing’ configurations and let the server and players be discovered. I seem to be getting somewhere as there are no errors in the runtime using the string item and rule command combination provided by @lfs_alp5. However, I don’t get playback on the players. They are on with volume at max, so I’m not sure how to troubleshoot as there are no error messages.

Do I need to update or somehow initialize any of the other channels?

Can’t remember I did anything more than add the server, discover/add the player (things) and add the items…everything worked fine after that.if all else fails, restart OH2? :wink:

Did you try anything without rules. Just define items and try to control them over the sitemap

here a snippet of my .item file:

Player Bedroom (Players) {channel="squeezebox:squeezeboxplayer:95633E72-625A-4058-A64E-0229E156D001:801f02f8f9d4:control" }
Player Office (Players) {channel="squeezebox:squeezeboxplayer:95633E72-625A-4058-A64E-0229E156D001:b827eb2527f0:control" }
Player Studio (Players) { channel="squeezebox:squeezeboxplayer:95633E72-625A-4058-A64E-0229E156D001:74da386b16ea:control" }
Player Guestroom (Players) {channel="squeezebox:squeezeboxplayer:95633E72-625A-4058-A64E-0229E156D001:74da386b16ea:control" }


Switch squeezeBedroomPower           "Bedroom"  (SqueezePlayerPower) {channel="squeezebox:squeezeboxplayer:95633E72-625A-4058-A64E-0229E156D001:801f02f8f9d4:power" }
Switch squeezeBedroomPlay            "Bedroom" (SqueezePlay) {channel="squeezebox:squeezeboxplayer:95633E72-625A-4058-A64E-0229E156D001:801f02f8f9d4:playPause" }
Dimmer squeezeBedroomVolume          "Bedroom [%.1f %%]" <soundvolume> (SqueezePlayerVolume) {channel="squeezebox:squeezeboxplayer:95633E72-625A-4058-A64E-0229E156D001:801f02f8f9d4:volume" }

and here the sitemap configuration:

Frame label="Audio" {
		Group item=Players label="SqueezePlug Controls" icon="player"
		Group item=SqueezePlayerVolume label="SqueezePlug Volume" icon="soundvolume"
		Group item=SqueezePlayerPower label="On/Off SqueezePlugs" 
        }

Maybe that will help narrowing down where your problem is.

Thanks @lipp_markus, the control channels are working fine, so that helps narrow it down. I’m running everything off a Synology NAS, so maybe the Synology LMS app is not accepting the audio files. Do the MP3’s need to be in the openhab sounds folder (my setup) or do they need to be in the media server library?

Glad to hear that you could make progress. Not sure I can help much further, as I have never used that function.
I would think that you may need to add the full path, probably starting with file:// judging by the documentation.

Two other remarks, in the event that your use case is voice notifications: if your mp3 is very short Squeezelite will not play it, this is a known bug of squeezelight; and in this use case you will likely need to use a different approach anyway, search the forum for ‘squeezebox mp3’ for pointers (I am not using this function, yet, either). This search string will give you also additional examples and threads that may apply to your situation
Good luck.

Ok, I finally figured out how to play MP3 files on my Synology NAS. The file path is relative to the LMS library folder. I was not able to play files by full file path.

In my case, the library is /Volume1/music/. I placed the MP3s in /Volume1/music/openhab and play them with MySqueezePlayer.sendCommand("openhab/file.mp3")

I am playing short MP3 notifications. I haven’t seen any issues yet, but still testing.

Dustin,

Are you using a full version of Squeezebox, or Squeezelite? I don’t have a SB parameter where I can set the Library. In Squeezelite there is just the ability to set the LMS Data and Cache folders. I’m thinking that Squeezelite doesn’t support a Library.

Thanks

After re-reading this thread, it appears that you’re using a server instance so my Library question is probably irrelevant.

I too am trying to play a file from the OH2 Sounds directory without success. I have to believe that this is due to some missing functionality because I can play a local OH file from the console. When playing the local file, OH serves a local URL reference to SB.

What rule commands are used to serve up a local sound file as a URL like it does via VoiceRSS or the Console Play?

openhab> smarthome:audio play squeezebox:squeezeboxplayer:28C97261-5842-48AE-85C7-DE2E25AFC5D7:d8eb972a4379 10minschool.mp3

This command results in a URL and all works well with SBLite, and a playlist add URL is sent.

2017-02-27 13:59:11.816 [DEBUG] [ebox.handler.SqueezeBoxPlayerHandler] - Play notification sound on player d8:eb:97:2a:43:79 at URI http://192.168.10.55:8080/audio/81040a48-f55f-4038-9643-e45a87a2222f.mp3
2017-02-27 13:59:11.818 [DEBUG] [ebox.handler.SqueezeBoxPlayerHandler] - Cur State: vol=50, mut=NOT MUTED, pwr=ON, stp=STOPPED, ctl=PAUSED, shf=OFF, rpt=OFF, tix=0, tnm=0, tim=3
2017-02-27 13:59:11.819 [DEBUG] [ebox.handler.SqueezeBoxPlayerHandler] - Setting up player for notification
2017-02-27 13:59:11.820 [DEBUG] [ebox.handler.SqueezeBoxServerHandler] - Sending command: d8:eb:97:2a:43:79 mixer volume 80
2017-02-27 13:59:11.921 [DEBUG] [ebox.handler.SqueezeBoxPlayerHandler] - Done waiting 100 ms for volume to update
2017-02-27 13:59:11.923 [DEBUG] [ebox.handler.SqueezeBoxPlayerHandler] - Playing notification
2017-02-27 13:59:11.924 [DEBUG] [ebox.handler.SqueezeBoxServerHandler] - Sending command: d8:eb:97:2a:43:79 playlist add http://192.168.10.55:8080/audio/81040a48-f55f-4038-9643-e45a87a2222f.mp3

But when using the sendCommand in a rule I get a playlist play command and not a playlist add.
mySqueezePlayer.sendCommand( “file://doorbell.mp3” )

2017-02-27 14:01:32.832 [DEBUG] [ebox.handler.SqueezeBoxServerHandler] - Sending command: d8:eb:97:2a:43:79 playlist play doorbell.mp3

In summary, I can play a local file from the console, but I cannot use a Rule command to play a local file. I can also us VoiceRSS to request a audio file which also plays correctly via an playlist add and stream.

var string sinkKitchen = "squeezebox:squeezeboxplayer:28C97261-5842-48AE-85C7-DE2E25AFC5D7:d8eb972a4379"

logInfo("logInfoSpeak","RSS Voice Speaking Test")
say("This is a test of Voice RSS", "voicerss:enUS", sinkKitchen)

2017-02-27 14:07:43.710 [INFO ] [.smarthome.model.script.logInfoSpeak] - RSS Voice Speaking Test
2017-02-27 14:07:43.716 [WARN ] [g.eclipse.smarthome.core.net.NetUtil] - Found multiple local interfaces - ignoring 192.168.10.26
2017-02-27 14:07:43.719 [DEBUG] [eezebox.internal.SqueezeBoxAudioSink] - Processing audioStream http://192.168.10.55:8080/audio/4b1d31a3-cf44-41f4-aec9-9abe708f6f7d.mp3 of format AudioFormat [codec=MP3, container=NONE, ]
2017-02-27 14:07:43.721 [DEBUG] [ebox.handler.SqueezeBoxPlayerHandler] - Play notification sound on player d8:eb:97:2a:43:79 at URI http://192.168.10.55:8080/audio/4b1d31a3-cf44-41f4-aec9-9abe708f6f7d.mp3
2017-02-27 14:07:43.723 [DEBUG] [ebox.handler.SqueezeBoxPlayerHandler] - Cur State: vol=50, mut=NOT MUTED, pwr=ON, stp=STOPPED, ctl=PAUSED, shf=OFF, rpt=OFF, tix=0, tnm=1, tim=0
2017-02-27 14:07:43.726 [DEBUG] [ebox.handler.SqueezeBoxPlayerHandler] - Setting up player for notification
2017-02-27 14:07:43.728 [DEBUG] [ebox.handler.SqueezeBoxServerHandler] - Sending command: d8:eb:97:2a:43:79 mixer volume 80
2017-02-27 14:07:44.131 [DEBUG] [ebox.handler.SqueezeBoxPlayerHandler] - Done waiting 400 ms for volume to update
2017-02-27 14:07:44.134 [DEBUG] [ebox.handler.SqueezeBoxPlayerHandler] - Playing notification
2017-02-27 14:07:44.136 [DEBUG] [ebox.handler.SqueezeBoxServerHandler] - Sending command: d8:eb:97:2a:43:79 playlist add http://192.168.10.55:8080/audio/4b1d31a3-cf44-41f4-aec9-9abe708f6f7d.mp3
2017-02-27 14:07:44.739 [DEBUG] [ebox.handler.SqueezeBoxPlayerHandler] - Done waiting 600 ms for playlist to update

I’d like to second that; I see exactly the same behaviour:

  • Playing a local file via console: Works great
  • Trying the same from a rule: no Joy. Looking at the LMS server log, triggered from the rule LMS “thinks” it shall search the mp3 locally

I’m not sure the above is implemented. Can you try this instead? Let me know what happens.

var string sinkKitchen = "squeezebox:squeezeboxplayer:28C97261-5842-48AE-85C7-DE2E25AFC5D7:d8eb972a4379"
playSound(sinkKitchen, "doorbell.mp3")
1 Like

Mark,

Thank you for putting eyes on this!

Yes, that appears to have worked!

My Test Rule

rule "Squeeze Test"

when
   Item DingDong changed
then
   logInfo("logSBTest","Rule playSound Test")

   var string sinkKitchen = "squeezebox:squeezeboxplayer:28C97261-5842-48AE-85C7-DE2E25AFC5D7:d8eb972a4379"
   logInfo("logSBTest","sinkKitchen string set to:" + sinkKitchen)

   playSound(sinkKitchen, "doorbell.mp3")

end

Resulting Log

2017-02-28 10:09:09.736 [INFO ] [pse.smarthome.model.script.logSBTest] - Rule playSound Test
2017-02-28 10:09:09.742 [INFO ] [pse.smarthome.model.script.logSBTest] - sinkKitchen string set to:squeezebox:squeezeboxplayer:28C97261-5842-48AE-85C7-DE2E25AFC5D7:d8eb972a4379
2017-02-28 10:09:09.748 [WARN ] [g.eclipse.smarthome.core.net.NetUtil] - Found multiple local interfaces - ignoring 192.168.10.26
2017-02-28 10:09:09.751 [DEBUG] [eezebox.internal.SqueezeBoxAudioSink] - Processing audioStream http://192.168.10.55:8080/audio/67302b8f-d4e3-4d0c-842a-2c7c7fa71bd8.mp3 of format AudioFormat [codec=MP3, container=NONE, ]
2017-02-28 10:09:09.754 [DEBUG] [ebox.handler.SqueezeBoxPlayerHandler] - Play notification sound on player d8:eb:97:2a:43:79 at URI http://192.168.10.55:8080/audio/67302b8f-d4e3-4d0c-842a-2c7c7fa71bd8.mp3
2017-02-28 10:09:09.757 [DEBUG] [ebox.handler.SqueezeBoxPlayerHandler] - Cur State: vol=50, mut=NOT MUTED, pwr=ON, stp=STOPPED, ctl=PAUSED, shf=OFF, rpt=OFF, tix=0, tnm=0, tim=0
2017-02-28 10:09:09.758 [DEBUG] [ebox.handler.SqueezeBoxPlayerHandler] - Setting up player for notification
2017-02-28 10:09:09.760 [DEBUG] [ebox.handler.SqueezeBoxServerHandler] - Sending command: d8:eb:97:2a:43:79 mixer volume 50
2017-02-28 10:09:11.964 [DEBUG] [ebox.handler.SqueezeBoxPlayerHandler] - Done waiting 2200 ms for volume to update
2017-02-28 10:09:11.966 [DEBUG] [ebox.handler.SqueezeBoxPlayerHandler] - Playing notification
2017-02-28 10:09:11.968 [DEBUG] [ebox.handler.SqueezeBoxServerHandler] - Sending command: d8:eb:97:2a:43:79 playlist add http://192.168.10.55:8080/audio/67302b8f-d4e3-4d0c-842a-2c7c7fa71bd8.mp3
2017-02-28 10:09:12.671 [DEBUG] [ebox.handler.SqueezeBoxPlayerHandler] - Done waiting 700 ms for playlist to update
2017-02-28 10:09:12.673 [DEBUG] [ebox.handler.SqueezeBoxServerHandler] - Sending command: d8:eb:97:2a:43:79 playlist index 0
2017-02-28 10:09:25.588 [DEBUG] [ebox.handler.SqueezeBoxPlayerHandler] - Done waiting 12900 ms for stop
2017-02-28 10:09:25.590 [DEBUG] [ebox.handler.SqueezeBoxPlayerHandler] - Restoring player state
2017-02-28 10:09:25.591 [DEBUG] [ebox.handler.SqueezeBoxServerHandler] - Sending command: d8:eb:97:2a:43:79 mixer volume 0
2017-02-28 10:09:25.694 [DEBUG] [ebox.handler.SqueezeBoxPlayerHandler] - Done waiting 100 ms for volume to update
2017-02-28 10:09:25.695 [DEBUG] [ebox.handler.SqueezeBoxServerHandler] - Sending command: d8:eb:97:2a:43:79 playlist delete 0
2017-02-28 10:09:26.102 [DEBUG] [ebox.handler.SqueezeBoxPlayerHandler] - Done waiting 400 ms for playlist to update
2017-02-28 10:09:26.103 [DEBUG] [ebox.handler.SqueezeBoxPlayerHandler] - Stopping the player
2017-02-28 10:09:26.105 [DEBUG] [ebox.handler.SqueezeBoxServerHandler] - Sending command: d8:eb:97:2a:43:79 stop
2017-02-28 10:09:26.107 [DEBUG] [ebox.handler.SqueezeBoxServerHandler] - Sending command: d8:eb:97:2a:43:79 mixer volume 50
2017-02-28 10:09:26.209 [DEBUG] [ebox.handler.SqueezeBoxPlayerHandler] - Done waiting 100 ms for volume to update

Thanks indeed! “playsound” did the trick :slight_smile:

Hai @lipp_markus,

Would it be possible to mail/post your complete squeezebox cfg,item,sitemap files.

I can’t get it to work, in paperui i have my players/server in my things but somehow it does not work.

thks

I can do that, but I am traveling the next 10 days and have no access
remotely to these files. In case I forget to do it by then :-), fee free to
ping me again if you still need it.

No problem, safe travels!

@Peter_van_hanegem here you go:

watch out: the paper UI is not a user interface, it is only designed to help in configuration; I have everything configured through text files

things file (the bridge identifier is available in the PaperUI)

Bridge squeezebox:squeezeboxserver:3D34F084-8A16-4E61-B593-B5D5B673E4BF [ ipAddress="IP address", webport=9000, cliport=9090 ]
{
    Thing squeezeboxplayer mac_address [ mac="XX:XX:XX:XX:XX:XX" ] //Livingroom
    Thing squeezeboxplayer mac_address [ mac="XX:XX:XX:XX:XX:XX" ] //Guestroom
    Thing squeezeboxplayer mac_address [ mac="XX:XX:XX:XX:XX:XX" ] //Studio 
    Thing squeezeboxplayer mac_address [ mac="XX:XX:XX:XX:XX:XX" ] //Bedroom
    Thing squeezeboxplayer mac_address [ mac="XX:XX:XX:XX:XX:XX" ] //Livingroom2
    Thing squeezeboxplayer mac_address [ mac="XX:XX:XX:XX:XX:XX" ] //Office
}

Items file

Player Livingroom (Players) {channel="squeezebox:squeezeboxplayer:3D34F084-8A16-4E61-B593-B5D5B673E4BF:mac_address:control" }
Player Livingroom2 (Players) {channel="squeezebox:squeezeboxplayer:3D34F084-8A16-4E61-B593-B5D5B673E4BF:mac_address:control" }
Player Bedroom (Players) {channel="squeezebox:squeezeboxplayer:3D34F084-8A16-4E61-B593-B5D5B673E4BF:mac_address:control" }
Player Office (Players) {channel="squeezebox:squeezeeezeboxplayer:3D34F084-8A16-4E61-B593-B5D5B673E4BF:mac_address:control" }
Player Studio (Players) { channel="squeezebox:squeezeboxplayer:3D34F084-8A16-4E61-B593-B5D5B673E4BF:mac_address:control" }
Player Guestroom (Players) {channel="squeezebox:squeezeboxplayer:3D34F084-8A16-4E61-B593-B5D5B673E4BF:mac_address:control" }

and here an example for more items

Switch squeezeBedroomPower           "Bedroom"  (SqueezePlayerPower) {channel="squeezebox:squeezeboxplayer:3D34F084-8A16-4E61-B593-B5D5B673E4BF:mac_address:power" }
Switch squeezeBedroomPlay            "Bedroom" (SqueezePlay) {channel="squeezebox:squeezeboxplayer:791E1DEA-BBC3-4A9F-80D1-F5CE550F9B:mac_address:playPause" }
Dimmer squeezeBedroomVolume          "Bedroom [%.1f %%]" <soundvolume> (SqueezePlayerVolume) {channel="squeezebox:squeezeboxplayer:3D34F084-8A16-4E61-B593-B5D5B673E4BF:mac_address:volume" }
String squeezeBedroomTitle		 {channel="squeezebox:squeezeboxplayer:3D34F084-8A16-4E61-B593-B5D5B673E4BF:mac_address:title" }
String squeezeBedroomRemoteTitle	  {channel="squeezebox:squeezeboxplayer:3D34F084-8A16-4E61-B593-B5D5B673E4BF:mac_address:remotetitle" , expire="10m, state=unavailable"}
String squeezeBedroomArtist			  {channel="squeezebox:squeezeboxplayer:3D34F084-8A16-4E61-B593-B5D5B673E4BF:mac_address:artist", expire="10m, state=unavailable" }
String squeezeBedroomCoverArt  {channel="squeezebox:squeezeboxplayer:3D34F084-8A16-4E61-B593-B5D5B673E4BF:mac_address:coverartdata" }	
String squeezeBedroomYear  {channel="squeezebox:squeezeboxplayer:3D34F084-8A16-4E61-B593-B5D5B673E4BF:mac_address:year", expire="10m, state=unavilable" }
String squeezeBedroomAlbum  {channel="squeezebox:squeezeboxplayer:3D34F084-8A16-4E61-B593-B5D5B673E4BF:mac_address:album", expire="10m, state=unavailable" }
Dimmer NotificationVolumeBedroom "Notification Volume Living room [%d %%]" {channel="squeezebox:squeezeboxplayer:3D34F084-8A16-4E61-B593-B5D5B673E4BF:mac_address:notificationSoundVolume"}

sitemap is fairly rudimentary as I it is mostly for testing purposes

Frame label="Audio" {
	Group item=Players label="SqueezePlug Controls" icon="player"
	Group item=SqueezePlayerVolume label="SqueezePlug Volume" icon="soundvolume"
	Group item=SqueezePlayerPower //label="On/Off SqueezePlugs" 
    Slider item=NotificationVolume label="Notification Volume"
    Slider item=NotificationVolumeBedroom label="Notification Volume"
	}
1 Like