Squeezebox

From MiOS
(Difference between revisions)
Jump to: navigation, search
(Sending IR codes (SB2/3 and Transporter))
(Sending IR codes (SB2/3 and Transporter))
Line 129: Line 129:
  
 
Successfully tested with: SBS 7.3.2, IRBlaster/IR-Learning wizard 5.4, Skymaster DVR 7400.
 
Successfully tested with: SBS 7.3.2, IRBlaster/IR-Learning wizard 5.4, Skymaster DVR 7400.
 +
 +
== Squeezebox Control beta plugin ==
 +
 +
http://forum.micasaverde.com/index.php?topic=5097.msg28878#msg28878

Revision as of 23:09, 28 December 2010

Contents

Displaying cover art for the current song

1. Create new camera device(s) for the room(s) equipped with Squeezebox(es)

2. Configure the new camera device(s):

  • IP address: IP address and port of your Squeezebox Server (<ip address>:<port number>)
  • Path: music/current/cover.jpg?player=<MAC address> (replace <MAC address> with the MAC address of the player; IP address should work too)

Example

Using the SBS CLI

Luup/Lua skeleton

socket=require('socket')
local client = socket.connect('<IP address of SBS>', 9090)
client:send("<CLI command>\n")
local result=client:receive()
...

For a list of valid <CLI command> navigate to: SBS's Home / Technical Information / Help / Command Line Interface

Some examples for <CLI command>

<duration> does not work for Squeezebox Radio due to Slimdevices bug #15749.

Displaying text

Syntax:

<MAC address of player> display <line1> <line2> <duration>

Example:

client:send("00:04:20:XX:XX:XX display Hello%20World%201 Hello%20World%202 10\n")

'Pressing' a button on the Squeezebox remote

Syntax:

<MAC address of player> button <buttoncode>

Example:

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")

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

Skipping to the previous/next track

Syntax:

<MAC address of player> playlist index <index|+index|-index|?> <fadeInSecs>

Example:

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

Syntax:

<MAC address of player> pause <0|1|>  <fadeInSecs>  <suppressShowBriefly>  

Example:

client:send("00:04:20:XX:XX:XX pause\n")

Changing the volume level

Syntax:

<MAC address of player> mixer volume <0 .. 100|-100 .. +100|?>

Example:

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)

Syntax:

switchplayer from:<MAC address of player1> to:<MAC address of player2>

Example:

client:send("switchplayer from:00:00:00:00:00:01 to:00:00:00:00:00:02\n")

[Reference: http://www.mail-archive.com/plugins@lists.slimdevices.com/msg46077.html]

Sending IR codes (SB2/3 and Transporter)

Theory of operation

1. Plug an IR emitter into the phones jack of your Squeezebox/Transporter.

2. Install IRBlaster.

3. Restart your SBS.

4. Install the IR remote files for the IR devices you are going to control or use the IR-Learning Wizard (part of IRBlaster) to record the codes of your remote(s).

Now you are ready to send IR codes via Lua (adjust SBS_IP_address, SBS_CLI_port, playerid, remote_name, and command_name accordingly):

socket=require('socket')
 
local SBS_IP_address = '192.168.178.22'
local SBS_CLI_port   = 9090
local playerid 	     = '00:04:20:XX:XX:XX'
local remote_name    = 'Onkyo_RC-738M' -- as defined in the LIRC configuration file for this remote
local command_name   = 'PWR'           -- as defined in the LIRC configuration file for this remote
 
local client = socket.connect( SBS_IP_address, SBS_CLI_port ) 
 
function sendIR( device_MAC, remote, command )
 
 client:send( device_MAC .. ' irblaster send ' .. remote .. ' ' .. command .. '\n' )
 client:receive()
 
end
 
sendIR( playerid, remote_name, command_name )

Successfully tested with: SBS 7.3.2, IRBlaster/IR-Learning wizard 5.4, Skymaster DVR 7400.

Squeezebox Control beta plugin

http://forum.micasaverde.com/index.php?topic=5097.msg28878#msg28878

Personal tools