Squeezebox

From MiOS
(Difference between revisions)
Jump to: navigation, search
m (Using Google's TTS engine for announcements)
Line 217: Line 217:
 
   
 
   
 
  <MAC address> playlist play http://translate.google.com/translate_tts?tl=en&q=Just+a+test
 
  <MAC address> playlist play http://translate.google.com/translate_tts?tl=en&q=Just+a+test
 +
 +
==Controlling the BASETech RGB LED light bulb==
 +
 +
http://wiki.micasaverde.com/index.php/BASETech_RGB_LED

Revision as of 10:43, 21 November 2012


Using the SqueezeBox Plugin

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]

Playing a file

Syntax:

<MAC address of player> playlist play file:///<filename>

Example:

Windows:
77:d3:XX:XX:XX:XX playlist play file:///I:/NewMusic/Schwanensee%20(aus%20Kinderbuch)/Content/01%20-%20Track%201.flac
Synology NAS:
77:d3:XX:XX:XX:XX playlist play file:///disk1/music/file.mp3

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 (by MCV/radarengineer)

http://forum.micasaverde.com/index.php/topic,10108.0.html

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

LOUIS4Vera

http://forum.micasaverde.com/index.php?topic=5232.0

LIRC2LuupDevice4SBS

http://forum.micasaverde.com/index.php?topic=5709.0

SAD - Squeezebox Server Announcement Device

http://forum.micasaverde.com/index.php?topic=6952.0

SPB - Squeezebox Preset Button device

SPB maps preset buttons to Luup events.

http://forum.micasaverde.com/index.php/topic,9059.0.html

USP - Unified Squeezebox Plugin (Technology demo only)

http://forum.micasaverde.com/index.php/topic,10020.0.html

squeezedVera and squeezedVeraScenes

squeezedVera is a plugin for the Logitech Squeezebox, and it gives you the possibility to run scripts in different ways that can control your z-wave devices through Vera.

squeezedVeraScenes will run the same scripts as squeezedVera but here you define conditions for when they shall run in a configuration file, e.g at sunset on Mondays and Tuesdays. You can also define different scenes with different behaviour.

http://forum.micasaverde.com/index.php/topic,1047.0.html

Morphing the Sonos plugin into a Squeezebox plugin

http://forum.micasaverde.com/index.php/topic,9532.0.html

Importing LMS devices into MiOS

Use Whitebear Media Server or the native UPnP support in LMS 7.7.2+ to import your LMS devices into MiOS:

http://forum.micasaverde.com/index.php/topic,10220.0.html

Using Google's TTS engine for announcements

Requirement: http://wiki.micasaverde.com/index.php/Squeezebox#SAD_-_Squeezebox_Server_Announcement_Device

local lul_temp = luup.variable_get("urn:upnp-org:serviceId:TemperatureSensor1","CurrentTemperature", 111)
if ( tonumber( lul_temp ) > 25 ) or ( luup.sunrise() - os.time() > 86400 - 300 ) 
 then 
  os.execute( 'cd /tmp; wget -U Mozilla -O GHBewAnn.mp3 "http://translate.google.com/translate_tts?tl=de&q=Gewaechshaus+wird+bewaessert.+Innentemperatur:+'..tostring( lul_temp )..'+Grad+Celsius."; ftpput -u **** -p **** 192.168.x.y public/HA_Announcements/GHBewAnn.mp3 GHBewAnn.mp3' )
  SBS_announcement( '192.168.a.b'                                  , 
                    9090                                           , 
                    '00:04:20:xx:xx:xx'                            , 
                    'Gewaechshaus%20wird%20bewaessert'             , 
                    tostring(lul_temp)..'%20Grad%20Celsius'        , 
                    5                                              , 
                    '/volume1/public/HA_Announcements/GHBewAnn.mp3',
                    10                                               )
 luup.call_action( "urn:upnp-ap15e-com:serviceId:SND1", "SendMail", { subject = 'Gewaechshaus wird bewaessert ('..tostring(lul_temp)..')', body = os.date('%Y-%m-%d %H:%M:%S '..os.time()) }, 25 )
end

or even simpler:

<MAC address> playlist play http://translate.google.com/translate_tts?tl=en&q=Just+a+test

Controlling the BASETech RGB LED light bulb

http://wiki.micasaverde.com/index.php/BASETech_RGB_LED

Personal tools