Squeezebox Server and Vera - Part II: Using the SBS CLI

Luup/Lua skeleton

socket=require(‘socket’)
local client = socket.connect(‘’, 9090)
client:send(“\n”)
local result=client:receive()

For a list of valid navigate to SBS’s Home / Technical Information / Help / Command Line Interface

Some examples for

Displaying text
display
client:send(“00:04:20:XX:XX:XX display Hello%20World%201 Hello%20World%202 10\n”)

Note: IIRC, does not work for Squeezebox Radio

‘Pressing’ a button on the Suqeezebox remote
button
client:send(“00:04:20:XX:XX:XX button brightness_toggle\n”)
client:send(“00:04:20:XX:XX:XX button volume_up\n”)
client:send(“00:04:20:XX:XX:XX button volume_down\n”)

as defined in Default.map;
telnet to your SBS port 9090, type ‘subscribe button’ (without quotes),
press , press the buttons of the remote to get the buttoncodes

Skipping to the previous/next track
playlist index <index|+index|-index|?>
client:send(“00:04:20:XX:XX:XX playlist index -1\n”)
client:send(“00:04:20:XX:XX:XX playlist index +1\n”)

Pause/Unpause playing
pause <0|1|>
client:send(“00:04:20:XX:XX:XX pause\n”)

Changing the volume level
mixer volume <0 … 100|-100 … +100|?>
client:send(“00:04:20:XX:XX:XX mixer volume +10\n”)
client:send(“00:04:20:XX:XX:XX mixer volume -10\n”)

Switching players (undocumented and untested)
switchplayer from: to:
client:send(“switchplayer from:00:00:00:00:00:01 to:00:00:00:00:00:02\n”)
[Reference: Re: [SlimDevices: Plugins] Switch Player Proximity Detection]

To be continued.

Does it have to be MAC, not IP?

The SBS documentation is a bit vague on this point:

is the unique identifier for the player, usually (but not guaranteed to be) the MAC address of the player. Some commands are global to the Squeezebox Server and do not require a . For commands requiring it, a random player will be selected by the Squeezebox Server if the is omitted, and returned in the server reply. may be obtained by using the "player id" or "players" queries.

Software players for SBS (e.g. SqueezePlay) obviously do not have a MAC address, so the IP address must be used. So I think the IP address should work for hardware players, too.

Do you see any drawbacks (besides privacy issues) to using the MAC address?