The Bose Soundtouch wireless speaker product line runs a web server on the speaker to accept queries and control commands. It responds to html requests even when in Standby mode, to allow remote power-up.
[FrBa] TCL can send commands to the Bose Soundtouch wireless network speaker. The Bose API uses HTTP GET and POST messages with XML data. You can control the speaker's volume and switch to a preset from within TCL. Uses the Http package. Simple examples:
======tcl
package require http
set url "http://soundtouch:8090"
# power on with key press and release
::http::geturl $url/key -query "POWER"
::http::geturl $url/key -query "POWER"
# request device name/identifier, returns xml
set [::http::geturl $url/name](body)
# request current volume, returns xml
set [::http::geturl $url/volume](body)
# request list of presets, returns xml
set [::http::geturl $url/presets](body)
# request list of input sources, returns xml, common sources: AUX, AIRPLAY, QPLAY, UPNP, SPOTIFY, BLUETOOTH
# usable sources are listed with isLocal=true, ignore sources marked isLocal=false which will return error HTTP 500
set [::http::geturl $url/sources](body)
# change input to a new source
set source AUX
::http::geturl $url/select -query ""
# change volume to 30% using HTTP POST
::http::geturl $url/volume -query "30"
# change to preset 3 of 6 using HTTP POST
::http::geturl $url/key -query "PRESET_3"
# get info about what is currently playing, find itemName in returned XML
set [::http::geturl $url/now_playing](body)
======
The official Bose Soundtouch app available from https://downloads.bose.com/ced/soundtouch/soundtouch_controller_app/index.html
I am currently developing an TCL/TK interface to the speaker to control some of its basic functions:
Set Power On/off
Get What is currently playing
Get/Set speaker volume
Get/Set channel presets 1-6
Comments are welcome.