Page 1 of 2

Indigo and Slimserver

PostPosted: Fri Aug 27, 2010 6:26 am
by rszmetro
I am trying to control Slimserver from Indigo and cannot get the scripts that are available to work.

Sean, can you help? I'm trying to use a keypadlinc button to turn on the player, select a playlist, song and start playing. Then, stop it and turn it off when the keypadlinc button is turned off.

Any thoughts?

Re: Indigo and Slimserver

PostPosted: Fri Aug 27, 2010 10:33 am
by chrisla23
In the attachment script, you'll need to change the on/off send statement to something like this:

Code: Select all

SendToSlimServer("button", onOff, 0, 0,squeezeNick)



It used to use status.txt (as in your variable question) but at some point that became a toggle instead of an on/off on the squeezecenter side. No matter if you send an on/off using the old method it just toggles the state.

Past that, I assume you've already edited/reloaded the attachment to hardcode the IP or Macs of your squeezeboxes.

Once that is all in place here are some examples of using the attachment from Indigo:

Code: Select all
SlimServerPower("power_on", "LivingroomSqueezebox")
-- Note this is power_on / power_off instead of 0 / 1 as you are sending a button name instead of the old
-- status.txt method.
-- SendToSlimServer("playlist", "save", "temp", 0, "LivingroomSqueezebox")
--SlimServerVolume(20, "LivingroomSqueezebox")
SlimServerPlaySong("keepitdown", "LivingroomSqueezebox")
--delay 7
--SlimServerPlaySong("bogus", "LivingroomSqueezebox")
SlimServerCommand("stop", "LivingroomSqueezebox")
-- SendToSlimServer("playlist", "resume", "temp", 0, "LivingroomSqueezebox")



To tie it to the button you would use a trigger that tracks the on/off state of the button.

-Chris

Re: Indigo and Slimserver

PostPosted: Fri Aug 27, 2010 3:29 pm
by rszmetro
Thanks so much. I'll give it a try this weekend.

Rob

Re: Indigo and Slimserver

PostPosted: Wed Sep 01, 2010 10:06 pm
by rszmetro
I finally figured out how to change the slimserver preference to let Indigo communicate. I have been able to turn a player on and off. And I can tell it to play and stop.

What I can't get is how to tell it to use a specific playlist, or to change to another specific playlist. Not sure of the code.

Any help???

Re: Indigo and Slimserver

PostPosted: Sat Sep 04, 2010 4:02 pm
by chrisla23
Code: Select all

SlimServerPlaySong("keepitdown", "LivingroomSqueezebox")



Is to play a playlist, "keepitdown" is one of my playlists.


-Chris

Re: Indigo and Slimserver

PostPosted: Sat Sep 04, 2010 4:34 pm
by rszmetro
Thanks, Chris.

Still no luck. I have an Action Group with three actions to turn on the player, clear the current playlist, select the new one and start playing.

-- Turn Power On
SlimServerPower("power_on", "Theater")

-- Clear Playlist
SendToSlimServer("playlist", "clear", "temp", 0, "Theater")

-- Play Relaxing at the Pool Playlist
SlimServerPlaySong("Relaxing at the Pool", "Theater")
SlimServerCommand("play", "Theater")

The commands work to turn on the Theater player, and to clear the list. The Play command works on it's own to play the current playlist

Do you see something wrong in what I'm doing?

Thanks again.
Rob

Re: Indigo and Slimserver

PostPosted: Sat Sep 04, 2010 7:10 pm
by chrisla23
Is it selecting the playlist correctly?

I don't think this part is needed:

Code: Select all
SlimServerCommand("play", "Theater")


The PlaySong should be starting it playing on its own.

I wonder maybe if the second play maybe causing it to pause and it is happening so fast it appears to do nothing.

-Chris

Re: Indigo and Slimserver

PostPosted: Sat Sep 04, 2010 7:25 pm
by rszmetro
Thanks again for the help. I removed the "play" line leaving only the playlist command, yet nothing happens. The player turns on. Even eliminating the clear line, if there is a playlist in the player, it will clear, but not start the playlist. Could it be the spaces in the playlist name?

Re: Indigo and Slimserver

PostPosted: Sat Sep 04, 2010 8:23 pm
by rszmetro
Chris, while you're at it, the Slimserver Attachment created two variables - SlimStatuTheater1 and 2.

Do you know how to display the power status (on, off) and the now playing song in those variables, or to create others?

Thanks again,
Rob

Re: Indigo and Slimserver

PostPosted: Sun Sep 05, 2010 5:03 pm
by chrisla23
If it is the spaces in the playlist name that is the problem, try replacing each space with: %20

I'm using a playlist with a space like that, not sure I ever tried it with spaces instead of %20's.

As to the "now playing" variable status. I don't believe it is going to work without a major re-write of the Slimserver indigo attachment. It was relying on a slimserver CGI script called status.txt that dates back to the earliest slimserver versions before the telnet CLI. I think it has been sort of left there as a convenience, but as parts of it break they are just removing them rather than fixing them. The "proper" way to do this sort of thing these days is with the squeezebox telnet CLI interface. I don't suspect you'll see this re-write take place until the major functionality of the slimserver attachment breaks. I could be missing something, but it used to work for me and stopped upon a squeezecenter upgrade, and some forum posts on their side seem to suggest the same.

An utterly quick and dirty way to get the status out of the CLI would be:

do shell script "echo '00:04:20:06:0b:5a playlist name ?' | nc -i 2 10.0.0.61 9090 | awk {'print $4}' | sed s/%20/' '/g"

-chris

Re: Indigo and Slimserver

PostPosted: Mon Sep 06, 2010 9:59 am
by rszmetro
I am just not having any luck selecting or loading a playlist. I created a new playlist in iTunes with no spaces - named Jazz.

No variation has worked.

SlimServerPlaySong("Jazz", "Theater")
SlimServerPlaySong(iTunes: Jazz", "Theater")
SlimServerPlaySong(iTunes:Jazz", "Theater")
SlimServerPlaySong(iTunes:%20Jazz", "Theater")

I also tried
SendToSlimServer("Jazz", "play", "Theater") with no luck, as well as a couple of other variations.

Yet,
SlimServerCommand("power_on", "Theater") turns on the player, off works as well, and
SendToSlimServer("playlist", "clear", "temp", 0, "Theater") does clear the current playlist.

I realize the attachment is out of date, and give up on the status stuff, but it would be great to get the playlist selection working.

Thanks again for all your help, Chris.

Rob

Re: Indigo and Slimserver

PostPosted: Mon Sep 06, 2010 12:17 pm
by chrisla23
Huh, it must be something stupid.

Just to sanity check that the problem is not on the squeezecenter side, from a browser can you do something like this:

Code: Select all
http://YOURSERVER:9000/status.txt?p0=playlist&p1=play&p2=YOUR%20PLAYLIST&player=YO:UR:PL:AY:ER:SM:AC&


Eg:

Code: Select all
http://10.0.0.61:9000/status.txt?p0=playlist&p1=play&p2=romance%20mix&player=00:04:20:06:0b:5a&

-Chris

Re: Indigo and Slimserver

PostPosted: Mon Sep 06, 2010 12:47 pm
by rszmetro
Hi Chris,

Again, I really appreciate all the help. I ran the address -- http://192.168.1.5:9000/status.txt?p0=p ... :05:a0:87& -- I did it with a different playlist in the Squeezecenter window. When I loaded the preceding address, it changed the playlist to empty. But didn't load the Jazz. The window with the address displays:
Squeezebox Home
Now Playing

Question - does this work with and iTunes playlist? Or, does it have to be a Squeezecenter playlist?

Rob

Re: Indigo and Slimserver

PostPosted: Mon Sep 06, 2010 12:51 pm
by chrisla23
Hah, I think we have gotten to the bottom.

I believe it most certainly has to be a squeezecenter playlist. I've never used the iTunes ones, if it somehow becomes a "real" playlist (shows up in the list of playlists) it could work, if it happens thru the plugin somehow probably not.

Whatever you try, it has to work thru a browser like that before Indigo is really involved at all.

-Chris

Re: Indigo and Slimserver

PostPosted: Mon Sep 06, 2010 12:53 pm
by rszmetro
Thanks, I'll try it as a Squeezecenter playlist.

Again, much appreciated!

Rob