New Squeezebox plugin - Request For Comments

Hi Garrett,

I have been working on passing data from your plug-in to OpenRemote. It turns out that OpenRemote reads in the ‘shortcode’ or ‘sdata’ file. When I take a look at the ‘status’ file I can see all the Squeezebox data (CurrentTitle, CurrentArtist, etc.), but when one requests the sdata, it only returns a few variables the most useful being the ‘status’ (on or off). :cry:

Is there any way to include more of the variables in the ‘shortcode’ so that it will show up in a sdata request?

For instance here is what I use to see the ‘status’

http://:3480/data_request?id=status&output_format=xml

and here is what is used to see the ‘sdata’

http://:3480/data_request?id=sdata&output_format=xml

Or if you can direct me where to look, I can have a go at including the variables I care most about (CurrentTitle, CurrentArtist).

Thanks for your reply. ;D

This would require modifying the correct S_XXX.xml files that correspond to the values you want. This may be S_RenderingControl1.xml, S_MediaNavigation1.xml, or S_AVTransport1.xml respectively. These files are to be kept in line with UPnP standards and the shortcode values are not part of that standard. Also several members on this forum are in the process of trying to standardize these files to be used across the different plugins that may require them. You are more than welcome to modify them to your liking, but I do not plan on adding those values to the files.

  • Garrett

[quote=“martynwendon, post:120, topic:170505”]Hey Garrett,

Is there a way the plugin could keep the name of the squeezebox player if the name has been previously found?

Since I power of my players when they’re not in use (physically at the socket) the players revert back to a ? for their names (presumably following a LUA restart).

So in my case, I frequently get a whole bunch of my 20 odd players reverting to ? in the UI. This makes it tough to see which one is which ;D

The other problem is that I use the room/device name in notifications and a few other plugins, so with the name keep changing to ? it has some weird effects!

Hopefully that’s an easy fix?[/quote]

I’ll look at what I can do to prevent this. The naming is based off code from earlier days of the plugin which was written by another user.

  • Garrett

[quote=“garrettwp, post:122, topic:170505”]This would require modifying the correct S_XXX.xml files that correspond to the values you want. This may be S_RenderingControl1.xml, S_MediaNavigation1.xml, or S_AVTransport1.xml respectively. These files are to be kept in line with UPnP standards and the shortcode values are not part of that standard. Also several members on this forum are in the process of trying to standardize these files to be used across the different plugins that may require them. You are more than welcome to modify them to your liking, but I do not plan on adding those values to the files.

  • Garrett[/quote]

@skogen75, @Garrettwp: if it makes sense to add fes shortcodes in the common files (rather than standard files), I think we can discuss about it, I think it is not too late but I would like a stable version soon so that I can publish the Sonos and the DLNA plugins. We can continue this discussion on the other topic, as @jullio is involved.
http://forum.micasaverde.com/index.php/topic,17991.0.html

PS: Few months ago, I defined 1 or 2 shortcodes after a request of MyVera’s request.

Hi Garrett,

I understand the need to standardize. I have looked at the S_AVTRANSPORT.xml and modified it to include the title, artist in the shortcode…thanks for pointing me in the right direction.

Now I have another problem. I would like to return the value of a playlist index query ( playlist index?) so that I can do various other functions, like zap the song (using… playlist zap or remove it from the playlist ( playlist delete ).

I see that the I_SqueezeboxControl1.xml is where the queries to the squeezebox are performed and I see that songinfo is used to get the information on the currently playing song; which returns tracknum, but as you know this is the tracknum of the song as it is in relation to the album, not the playlist.

I also see that playlist index +1,-1 are used to advance to the next song or go to the previous song in the playlist.

I wonder if you could help me get started to modify the files to include a query of the playlist index to return the index of the currently playing song? I might be able to figure out how to change one file, but I would really get stuck in how the various xml files relate to one another.

Thanks for your consideration. BTW the app is otherwise working great and is very useful in my configuration, thank you for your efforts.

Hi guys, just installed this plugin (latest version from December 2013) and wondering why it’s not working for me in a scene.

OK here’s the thing. My bedroom squeezebox is set with an alarm at 7am to play a local radio station’s stream. Due to the maximum timeout setting of 90 minutes the alarm goes off at 8:30am. I wish for it to continue until 10am (I futz around in the mornings). Now, I know I can manually edit the squeezebox server.prefs file to change the timeout to 180 minutes… but the downsides of that are it affects all alarms on that device and the file has to be re-edited anytime you change anything else via the GUI. I tried setting a second alarm to start at 8:30am but I guess LMS doesn’t like starting alarm at the same time one is ending because the second alarm never starts. If I set it for 8:31am it works but having that minute of silence in between sucks. There must be a better way.

So since I have vera I found the squeezebox plugin, got it installed and all my squeezeboxen showed up as devices. Great! When I click the play button on a squeezebox in the vera GUI it powers up and immediately begins playing what it was last playing… perfect!

So I set up a scene triggering at 8:30am to issue the Play command on my squeezebox. Only problem is it doesn’t work. Literally nothing appears to happen. All my other scene stuff works fine (it’s all z-wave commands though) so I know my scenes trigger properly.

Is there some reason manually hitting Play from the Vera GUI works while hitting Play in a scene doesn’t? Is there a “proper” way I should be doing this?

To be clear, I still want to utilize the built-in Squeezebox alarm at 7am–mainly because it programs the alarm into the squeezebox itself… so if the internet goes down (or even the LMS) the Squeezebox will still make noise to wake me up. So my goal is that the alarm will go off as usual at 8:30am and pretty much right after that Vera will tell it to turn on and play whatever it was last playing.

Any tips for troubleshooting this would be much appreciated!

Edit: To clarify, this isn’t working no matter what time I set the scene to trigger. I tried just now–set a scene to trigger at 22:29:00 to power on my family room squeezebox and just watched as the time came and went… the squeezebox never turned on.

How are you creating the scene to issue the play command for the squeezebox player?

  • Garrett

(This is a Vera3 running the latest UI5 firmware by the way)

Automation tab->Scenes tab->New Scene. Then I scroll down to the room with my bedroom squeezebox and click the Play button. In the UI the squeezebox rectangle turns white and the Play button turns blue. Then I go to the Schedules tab and set it to occur at whatever time. Then I click confirm changes and finally click the Save button up top.

I have several other scenes (involving only Z-wave devices though) and they all work fine. I can also just go to the Devices tab, go to the Squeezebox I want and hit play and it works just fine. I just don’t understand why it’s not working as a scene. Has anyone else tried this?

Thanks for your help garrettwp.

Bumping this (gently). Has anyone else been able to set up a scene with this kind of action in it? Seems simple enough but at the same time it is not working for me. Is there some logging that can be done to see if Vera is the culprit or LMS? Many thanks.

When I get time I’ll look into this. In the meantime, can you test to see if this works by creating the action in the advanced tab of the scene editor?

  • Garrett

[quote=“mthomas, post:107, topic:170505”]I can create the controller, but no players are found.
Maybe my problem is that my LMS has a username and password. How can I add username and pass to the controller?[/quote]

Those of you still looking to connect to a secured server can replace the following function in the latest (per time of this post) “I_SqueezeboxControl1.xml” file and re-upload it:

[sup]
function sqz_startup(device)
log (‘starting Sqeezebox Control’)
g_server_device = device

		check_var (SQZ_SID, 'serverIP', device)
		check_var (SQZ_SID, 'serverPort', device, '9090')
		check_var (SQZ_SID, 'serverUser', device)
		check_var (SQZ_SID, 'serverPass', device)
		check_var (SQZ_SID, 'Debug', device, 'false')

		DEBUG = luup.variable_get(SQZ_SID, 'Debug', device)

		local ip = luup.variable_get(SQZ_SID, 'serverIP', device)
		if (ip == nil or ip == "") then
			log("#" .. device .. " Startup failed. Squeezebox server ip not set.")
			luup.set_failure(true, device)
			return false
	        
	 	else
			open_server_port (device)

			luup.call_delay ('scan_devices', 2, tostring(device))
			
			local user = luup.variable_get(SQZ_SID, 'serverUser', device)
			local pass = luup.variable_get(SQZ_SID, 'serverPass', device)
			if (user ~= nil and user ~= "" and pass ~= nil and pass ~= "") then
				send_command('login ' .. user .. ' ' .. pass)
			end
			
			return true, 'Ok', 'SqueezeBox Control'
		end
	end

[/sup]

You can then enter the serverUser and serverPass under the “advanced” tab in device settings and it should work. Works fine for me now running against my secured server anyhow.

Perhaps this could be rolled into the master (once it’s seen more regression/hardening than I’ve given it, of course) :slight_smile:

same issue here.
I can add one command (e.g. Squeezebox touch on) to the scene but a 2nd one (e.g. play) at the same or different time point (e.g. delay 20 sec) does not work - it simply does not save it. It only works if I go to advanced and set it there instead.

[quote=“Peter, post:104, topic:170505”]@mthomas Yes you have to create the device thirst. Read this thread.

I have created the device. But I get “Device is not ready” on the squeeze player device if I click on any button.
What I 'am doing wrong?
There is a connection a you can see in the screenshot.
Do I have to change something on de squeezebox server of install a plugin on the squeezebox server?[/quote]

Anyone experiencing this problem as well - I’ve uploaded the latest full plugin (December), from : [url=http://forum.micasaverde.com/index.php/topic,9451.msg132625.html#msg132625]http://forum.micasaverde.com/index.php/topic,9451.msg132625.html#msg132625[/url]

  • Installed the plugin
  • Go to: Apps → Develop Apps → Create Device
    – Device Type: Media Server
    – Description: LMS
    – Upnp Device Filename: D_SqueezeboxControl1.xml
    – Upnp Implementation Filename: I_SqueezeboxControl1.xml
  • Press “Create”
  • goto: Devices, find LMS, setup-> Advanced and set the ip address, port automatically set to 9090.

It then goes and finds all the squeezebox devices, picking out the name etc. When I click any of the buttons, I get “Device not Ready”

Have I missed a step, or mis-configured?

Update:

I’ve tried re-loading everything with the same results, having checked the log files I’m seeing the following:

02 08/12/14 19:49:13.734 e[33;1mDevice_Service::MatchupUpnpServices no upnp service for urn:micasaverde-com:serviceId:SqueezeBox1e[0m <0x2b62e000> 02 08/12/14 19:49:13.870 e[33;1mJobHandler_LuaUPnP::m_sMissingFile_set /etc/cmh-lu// I_SqueezeboxControl1.xmle[0m <0x2b62e000> 01 08/12/14 19:49:13.870 e[31;1mLuImplementation::Parse can't load /etc/cmh-lu// I_SqueezeboxControl1.xmle[0m <0x2b62e000> 01 08/12/14 19:49:13.871 e[31;1mJobHandler_LuaUPnP::ParseAllImplementations failed to parse I_SqueezeboxControl1.xmle[0m <0x2b62e000> 09 08/12/14 19:49:20.168 JobHandler_LuaUPnP::Run device 29 ? room 7 type urn:schemas-micasaverde-com:device:SqueezeBoxPlayer:1 id 80:1f:02:f1:e6:7c parent 28/0x8b18c0 upnp: 0 <0x2b62e000> 09 08/12/14 19:49:20.169 JobHandler_LuaUPnP::Run device 30 Bedroom room 6 type urn:schemas-micasaverde-com:device:SqueezeBoxPlayer:1 id 00:04:20:06:8c:55 parent 28/0x8b1a18 upnp: 0 <0x2b62e000> 09 08/12/14 19:49:20.169 JobHandler_LuaUPnP::Run device 32 Hifi room 2 type urn:schemas-micasaverde-com:device:SqueezeBoxPlayer:1 id 00:04:20:05:b4:31 parent 28/0x8b3518 upnp: 0 <0x2b62e000> 09 08/12/14 19:49:20.169 JobHandler_LuaUPnP::Run device 31 Kitchen room 4 type urn:schemas-micasaverde-com:device:SqueezeBoxPlayer:1 id 00:04:20:05:c5:c2 parent 28/0x8b4508 upnp: 0 <0x2b62e000> 09 08/12/14 19:49:20.171 JobHandler_LuaUPnP::Run device 28 LMS room 3 type urn:schemas-micasaverde-com:device:SqueezeBox:1 id parent 0/0x8af268 upnp: 0 <0x2b62e000> 03 08/12/14 19:49:20.186 JobHandler_LuaUPnP::Run ready 18 devices installation 35109401 missing /etc/cmh-lu// I_SqueezeboxControl1.xml version *1.5.622* allow_evt: 1 allow_ud: 1 upnp 0 netpnp: 1 reprovision: 0 tz:0 tnow:1407869360 dst: 1 gmt:3600 tz:GMT / BST changed: 0 pMem 0xb3d000 start 8527872 diff: 3256320 <0x2b62e000> 50 08/12/14 19:49:25.855 luup_log:28: Squeezebox: starting Sqeezebox Control <0x2bf61680>

Which suggests something is missing - anyone any ideas?

Thanks
James

Garrett…was wondering if you are planning to keep working on the Squeezebox plugin (and hoping you say yes). I’m somewhat jealous of the TTS capability integrated into the Sonos plugin, so if you were looking for an idea of how you could spend your free time, I’d gladly propose that feature!

Oy! I vote in favor of that free time be spent on AuthomationHD instead. ;D Still hoping for the ‘prevent screen going to sleep’ option in that one…

Has anyone tried the plugin with UI7? I’m using it happily on UI5, and at some point would like to upgrade to UI7 once I know it’s all stable, and everything I use is supported. I don’t see the Squeezebox plugin on the tested list - has anyone tried it?

Cheers,
Geoff

Hi

I also have this problem, where the name of the Squeezebox device in Vera reverts back to ? After the Squeezeboxes are powered off.

Also in Vera I assigned the Squeezebox devices to the various rooms they are located in. And very often the room is lost and the Squeezebox device in Vera ends back up in the No Rooms section (UI5).

Also has the Squeezebox plugin been updated in the MiOS marketplace yet?
Looking in the Apps tab in Vera, the Squeezebox Control plug-in is shown as version 2.0
Is this still the latest version?

I previously updated the plug-in via a download link on the forum somewhere.

Many thanks

[quote=“garrettwp, post:123, topic:170505”][quote=“martynwendon, post:120, topic:170505”]Hey Garrett,

Is there a way the plugin could keep the name of the squeezebox player if the name has been previously found?

Since I power of my players when they’re not in use (physically at the socket) the players revert back to a ? for their names (presumably following a LUA restart).

So in my case, I frequently get a whole bunch of my 20 odd players reverting to ? in the UI. This makes it tough to see which one is which ;D

The other problem is that I use the room/device name in notifications and a few other plugins, so with the name keep changing to ? it has some weird effects!

Hopefully that’s an easy fix?[/quote]

I’ll look at what I can do to prevent this. The naming is based off code from earlier days of the plugin which was written by another user.

  • Garrett[/quote]

Regarding the ? name of the Squeezebox devices in Vera and them also losing their room locations, this is very annoying. :-[ If there are any plans to updated the plug-in at any time, I would love for this to be fixed if possible.

I am actually using software Squeezeboxes, I don’t own any real hardware ones!

I am using SqueezeLite on my OpenElec Kodi home theatre PCs. Here is how I installed it.

So when my HTPCs go to S3 Sleep mode or S5 Shutdown after a period of time in Vera the various Squeezebox device instances change to ? and lose the room they were in.

Many thanks