Author Topic: [_CODE_] Plugin for Squeezebox CLI  (Read 10334 times)

Offline radarengineer

  • Moderator
  • Sr. Member
  • *****
  • Posts: 402
  • Karma: +4/-0
[_CODE_] Plugin for Squeezebox CLI
« on: March 30, 2012, 08:36:15 pm »
So I decided after all that I need to continue (at least for the immediate future) releasing updates for the existing Squeezebox CLI plugin. This plug was originally written by javier and I have since taken it over. There are several other options for controlling your squeezebox. Fortunately, you can use more than one at the same time.

@Ap15e has written a ton of code to do various cool things with the Squeezebox and is currently implementing a new "Unified" Squeezebox plugin that seems like it will incorporate all of his great ideas. I am very excited about his work on this new plugin. However, right now as it is still on the level of a technology demo I will continue to update this plugin. Please use this thread to report bugs with the existing CLI plugin.

The current Squeezebox Files can be found here:

SVN Repository
Current release (zip file)

Once I (and hopefully other people) can verify that these work well for them I will update the plugin. Otherwise, I am happy to patch bugs! It is not necessary to upload the test.lua file to your Vera. That is just a file I use to run the code through its paces on my desktop.

Known bugs:

The volume control is not working. It will correctly update to show the right volume from the squeezebox, but if you change it via Vera it doesn't work. The callback I get from the JSON is supposed to have a variable "DesiredVolume" with the new volume settings but it is undefined. I'll fix this as soon as I get a bit better at this JSON, and welcome any help.

Other useful SqueezeBox Threads:

Unified SqueezeBox Plugin
Release Thread: [_CODE_] Unified Squeezebox Plugin - USP 0.1a ALPHA - Technology demo only
Request for Comments:  New Squeezebox plugin - Request For Comments

Squeezebox via UPnP
Morphing the Sonos plugin into a Squeezebox plugin

SqueezedVera/SqueezedVeraScenes
This allows you to control Vera from the Squeezebox
squeezedVera and squeezedVeraScenes

Squeezebox Preset Button
maps preset buttons 1-6 of your Squeezebox Boom/Radio to Luup events.
[_CODE_] Squeezebox Preset Button device - SPB V0.3


« Last Edit: March 30, 2012, 10:37:10 pm by radarengineer »

Offline Ap15e

  • Beta Testers
  • Hero Member
  • *****
  • Posts: 1998
  • Karma: +12/-0
Re: [_CODE_] Plugin for Squeezebox CLI
« Reply #1 on: March 31, 2012, 06:17:24 am »
For a complete(?) list of works related to LMS visit http://wiki.micasaverde.com/index.php/Squeezebox.

Some documentation for MCV's/radarengineer's (beta) plugin is available at:
http://forum.micasaverde.com/index.php?topic=5097.msg28878#msg28878

Offline radarengineer

  • Moderator
  • Sr. Member
  • *****
  • Posts: 402
  • Karma: +4/-0
Re: [_CODE_] Plugin for Squeezebox CLI
« Reply #2 on: March 31, 2012, 10:54:30 am »
@Ap15e, I didn't know that wiki page existed, or that you had a nice set of directions for this plugin. Thank you very much!

Offline Ap15e

  • Beta Testers
  • Hero Member
  • *****
  • Posts: 1998
  • Karma: +12/-0
Re: [_CODE_] Plugin for Squeezebox CLI
« Reply #3 on: March 31, 2012, 04:15:44 pm »
I've just added a screenshot to http://forum.micasaverde.com/index.php/topic,5097.msg28878.html#msg28878 to show how to use Vera's scenes for controlling the Squeezebox players.

Offline Ap15e

  • Beta Testers
  • Hero Member
  • *****
  • Posts: 1998
  • Karma: +12/-0
Re: [_CODE_] Plugin for Squeezebox CLI
« Reply #4 on: April 02, 2012, 05:57:01 pm »
Just for reference:
LMS discovery code (Java, UDP broadcast): http://forums.slimdevices.com/showthread.php?t=93903

Offline pderby

  • Newbie
  • *
  • Posts: 15
  • Karma: +0/-0
Re: [_CODE_] Plugin for Squeezebox CLI
« Reply #5 on: August 29, 2012, 06:11:37 pm »
OK, radarengineer, I'm over in this thread now.  I don't know squat about "lua" or the developer environment on the VERA3 so I'm having to learn as I go.

I downloaded the 7 files from the "trunk" directory of SVN to my machine, then navigated in the Vera3 UI5 web page to APPS/Develop APPS LUUP files and uploaded all 7 files.

The players seem to work except for volume.

Was the "L_SqueezeboxControl1.lua" file supposed to get uploaded along with the other 6 files?

If I click on the "view" button I get an error message:  "This page contains the following errors:
Error on line 1 at column 1:  Document is empty

Is there an easy way to view a log on the Vera 3 to maybe get some insight into what is going on?


Offline radarengineer

  • Moderator
  • Sr. Member
  • *****
  • Posts: 402
  • Karma: +4/-0
Re: [_CODE_] Plugin for Squeezebox CLI
« Reply #6 on: August 31, 2012, 12:10:23 am »
You can view logs on line by going to the following address (obviously with the correct IP for your Vera):

http://192.168.x.x/cgi-bin/cmh/log.sh?Device=LuaUPnP

I think the issue with viewing the lua file is that some files get compressed automatically when they are uploaded, and may the lua isn't getting compressed but Vera thinks it should be when you click view (and looks for a file with an appended .lzo?)

That is just a guess, I'd have to look into it a bit more.

Offline radarengineer

  • Moderator
  • Sr. Member
  • *****
  • Posts: 402
  • Karma: +4/-0
Re: [_CODE_] Plugin for Squeezebox CLI
« Reply #7 on: March 30, 2013, 11:56:48 am »
After a bit of a hiatus I'm going to be working on this plugin in earnest again.

Please post any bug or feature requests here on this thread.

Offline ChrisAZ

  • Full Member
  • ***
  • Posts: 104
  • Karma: +1/-0
Re: [_CODE_] Plugin for Squeezebox CLI
« Reply #8 on: March 30, 2013, 09:32:10 pm »
Oh, bless you! I was beginning to lose hope that anyone would ever update the Squeezebox plug-in.

Here's my list of suggestions:
Power On: also need some way to add a delay after this command to wait for amp to power up (triggered by IR Blaster plugin on LMS).

Power Off

TTS - A variable that holds a string (that you don't have to use %20 instead of spaces) that is sent to Google TTS and played: playlist play http://translate.google.com/translate_tts?tl=en&q=" .. msg .. "\n")
Playlist/audio file support - a variable that holds the name of a playlist/audio file on LMS. " playlist play PlaylistName\n" or "playlist play /music/Song.mp3\n"

For the playlists, I have a different playlist queued up for whomever enters the house. For the audio files, I would like to have customer messages recorded and have that message played either on a schedule or when someone enters the house. Same concept at TTS, but with my voice.

Doing most of this with LUA in Scenes today. I'm sure I'll come up with some more as I think about the possibilities.


Offline garrettwp

  • Master Member
  • *******
  • Posts: 6371
  • Karma: +227/-128
  • Vera 3, Lite, ISY994
Re: [_CODE_] Plugin for Squeezebox CLI
« Reply #9 on: April 02, 2013, 11:54:05 am »
After a bit of a hiatus I'm going to be working on this plugin in earnest again.

Please post any bug or feature requests here on this thread.

Radarengineer,

I started to work on adding more features to the squeezebox plugin some time ago. It has since been put on the back burner and I have not had time to continue development. I would be willing to provide the files to the plugin if you are interested in continuing development of the plugin. I have two version of the plugin. The one version uses the telnet command api which has a good amount of controls. The second version is using the json api type commands, but not as feature packed as the first version.

- Garrett

Offline radarengineer

  • Moderator
  • Sr. Member
  • *****
  • Posts: 402
  • Karma: +4/-0
Re: [_CODE_] Plugin for Squeezebox CLI
« Reply #10 on: April 02, 2013, 10:46:41 pm »
I am obviously very interested in any help I can get. I really want to get the squeezebox plugin caught up with the sonos one. I am very happy to provide support and add features to code, I would very much appreciate any code you have that is an improvement over the current code base on the svn server.

In particular, I think TTS and managing groups of squeezeboxes (syncing and unsyncing groups of players) would be really useful features.

The next week or two is really crazy for me, but I have been building a small army (only a slight exaggeration) of pogoplug players so I can really run this code through its paces.
« Last Edit: April 02, 2013, 10:51:49 pm by radarengineer »

Offline garrettwp

  • Master Member
  • *******
  • Posts: 6371
  • Karma: +227/-128
  • Vera 3, Lite, ISY994
Re: [_CODE_] Plugin for Squeezebox CLI
« Reply #11 on: April 04, 2013, 06:14:27 am »
I am obviously very interested in any help I can get. I really want to get the squeezebox plugin caught up with the sonos one. I am very happy to provide support and add features to code, I would very much appreciate any code you have that is an improvement over the current code base on the svn server.

In particular, I think TTS and managing groups of squeezeboxes (syncing and unsyncing groups of players) would be really useful features.

The next week or two is really crazy for me, but I have been building a small army (only a slight exaggeration) of pogoplug players so I can really run this code through its paces.

I have attached a zip file of both versions of the plugins that I was working on.

- The sqeeuzebox folder contains the version that interfaces with the telnet api. This plugin has more functionality and in the end decided to work on this version since it reports more status updates e.g. the alarm function. This can be used as a trigger for scenes in Vera. I also have some code in there to set the players to sync via the advanced section of a scene. Example: when creating a scene, in the advanced section of the scene you select one of the players. For that player action you select "sync" and in the text box you enter the device id of the other players you want to sync with this player. I believe it is space separated. I do not have code to un-sync them and it was just to test to see if they would sync. But should get you started. This version is pretty much functional and can be used as is.

- The squeezebox2 folder contains the json api version of the plugin. This does not have all of the functions as the first one and does not return all of the status info that the telnet api version does e.g. the alarm status (not possible from what I researched). This is more of a proof of concept to get it to work on the json api.

Take your pick on which one you want to use. In the end I decided to stick with the telnet api version because it returned more status info in real time than the json api version.

- Garrett