Bose SoundTouch Binding

Hi @tiknx,

I receive this error in the log with the actual binding:

2017-10-12 21:25:09.829 [WARN ] [undtouch.internal.XMLResponseHandler] - SoundTouch 300: Unhandled XML entity during Updates: audiospeakerattributeandsetting

2017-10-12 21:25:09.842 [WARN ] [undtouch.internal.XMLResponseHandler] - SoundTouch 300: Unhandled XML entity during Updates: audiospeakerattributeandsetting

2017-10-12 21:25:09.979 [ERROR] [undtouch.internal.XMLResponseHandler] - SoundTouch 300: Unknown SourceType: PRODUCT - needs to be defined!

thanks a lot :wink:

Hi Chris, hi all,
I 've just found this discussion right a second ago.
I have a Bose Soundlink Mini and a Soundtouch Wireless link and I Wonder if there is a possible way redirecting Sound of the Android to Bluetooth and to the wireless lan protocol of the bose?
Or if maybe somebody investigated a solution? I think this is a common problem if you just want to play Sound from any app to your boses via Bluetooth and wireless at the same time. I would like to build or implement something like this if not existiert. Synchronizing is hopefully not the issue. But what do you think, how and is it possible?

Thanks in advance for your answers and help I appreciate! Sorry for stumbling into the discussion like this


Best Peter

Thank you so much for your effort to make it work again. Fantastic work.

Does your current binding allow to play URLs/Files? I’m planning to have some openHAB information as voice messages via SoundTouch. I know that it’s possible via FHEM, so I was wondering if I can make it work for openHAB2 as well.

Thanks in advance

Hi Pedda,

Interesting question. I just tried it with our SoundTouch speakers - And it worked. I had a bluetooth source (handy) connected to one of the speakers, and other speakers as “members” on this speakers and the bluetooth sound was distributed over the wireless SoundTouch protocol. Never the less when I played a video from Youtube there was a noticeable delay between sound and video - I assume the equipment needs this delay for buffering & distribution purposes.

Okay, back to your Equipment - Both things I haven’t heard yet. After some quick googling - The “SoundTouch Wireless link” seems to be a member of the SoundTouch concept, and it should work with that. But the “Soundlink Mini” just seems to be a bluetooth speaker without any SoundTouch support - I think it won’t work with that. But it should work with all other devices out of the SoundTouch family.

Cheers,
Chris

Hi @Plattenblog,

Thank you for your acknowledgments. :wink:

To answer your question: Currently we don’t have a way to directly play URLs/Files. We (@tiknx and me ) had discussed this internally several times but had no real idea how to integrate it properly into the OpenHAB concept. Maybe also because there wasn’t a real usage of it jet.
Never the less @tiknx integrated an ‘extended’ ID storage. So when you have a fixed set of sounds to play (i.e. a Ringer for the Door-Bell, and some fixed announcements) you could use this feature.
The SoundTouch only has 6 integrated ‘preset’ places, the plugin provides a lot of additional places. Just open the sound you want to save with your favourite SoundTouch APP, then send a number > 6 to the saveAsPreset channel. This would store this file to this preset position. Sending the same number to the presetControl channel should play the saved sound.
Would this be an option? Otherwise we could discuss a way to play URL directly.

Cheers,
Chris

Hi Chris,

Thanks for your reply and your time to investigate! You must know, that at
the moment, I am for myself only evaluating the idea on a very abstract and
theoretical level with little system knowledge (I know embedded linux
system quite well, and I know very basic stuff of the android system (as I
have programmed a very little app in it and as a heavy user of the system
:-))

Okay, back to your Equipment - Both things I haven’t heard yet. After some
quick googling - The “SoundTouch Wireless link” seems to be a member of the
SoundTouch concept, and it should work with that. But the “Soundlink Mini”
just seems to be a bluetooth speaker without any SoundTouch support - I
think it won’t work with that. But it should work with all other devices
out of the SoundTouch family.

yeah, that is right, it won’t work because Bose did not intend to do so.But
if you could connect a bluetooth source like your smartphone via bluetooth
to a Soundlink mini and manage to redirect the stream of sound to a
Soundtouch at the same time. The soundtouch app could manage to stream the
sound of a NAS to the Soundtouch, how does this work (is it only routing
and controling, and the rest does the soundtouch?). But anyway in the same
way the NAS streams to the soundtouch, the android could do the same. The
rest would be then “pitching” the echo out.

The idea would be send an audio stream sent by any audio application and
send it to the bluetooth as well as redirecting it over wireless lan and
the SONOS(?) protocol to the soundtouch, acting like a NAS, i.e. a logitech
squeeze box (which works)

What I don’t know - besides everything else :smiley: - now is:

  1. Do I have the control in Android over the audio stream? Or can it only
    be done in OS level?

  2. Is it possible to get the data of the stream why setting bluetooth as
    the sink of the audio stream? Also the OS question


For me I was just evaluating if it would be worth the time!

  1. Is Android programmed Java tasks fast enough to do the job on any or the
    super smartphone?

I hope not to bother you or the discussion, if that is even possible.

Cheers
Peter

Thanks for the quick reply. Interesting idea, Chris! I’m basically looking for the SoundTouch / OpenHAB to read out a short summary of the day, during breakfast. This may include calendar highlights of the week, weather, etc. So that’s TTS played via SoundTouch. If i connect “a” file with a preset, I can keep the name and change the file itself (with new announcement) and that may work, correct?

Is your exenteded ID storage features documented? I’m still a total newbie with openHAB.

Thanks again
Björn

hi @Plattenblog

i implemented this feature about a year ago. I do not find a time to work on the binding at the moment, but as i remember a file stored on a NAS is presetable. So if you select a file on the nas using the app, you can set it as preset using the channel “saveAsPreset 7”. Then you can use it like all other presets by sending “preset 7”.

If you can manage to change this file automatically every day this should work!

Hi marvkis,
I got the same problem as morizm. I downloaded the 2.1.0 file just a minute ago but there ist no ZoneAdd here as well. Also the sha256 sum of the file I’ve downloaded here https://github.com/marvkis/org.openhab.binding.bosesoundtouch-dist is different. It’s 912443F6338F8106C3F511463E9A6481EF20C3A28FFA49FE5C38D013C4BF1B6F. Maybe you can have a look if there is the correct file on github?

Thanks

Hi @sayhelloto,

you are right - in the repository was a wrong file. Cannot tell how it has made it there
 Now it should be the correct one. Please try it 


Sorry for that.

Bye,
Chris

Hi marvkis,

thank you for uploading the correct file. ZoneAdd works for me now.

Unfortunately the OperationMode BLUETOOTH does not work for me anymore. It states “OperationMode 'BLUETOOTH ’ is not supported yet.” in the log file. Are you working on this? Just wondering because it worked before.

Hi all,

Bose just launched a new Developer Site (https://developer.bose.com/) ,

Would love to have OpenHab great me with my favorit tune when coming home
:wink:
Mike

Hi guys !

I want to install this binding but i don’t know what to do.
I put the .jar file (from https://github.com/marvkis/org.openhab.binding.bosesoundtouch-dist/blob/master/org.openhab.binding.bosesoundtouch-2.1.0-SNAPSHOT.jar) in /usr/share/openhab2/addons/ directory.
What next ?

EDIT : Finally, i installed the binding with success.
But, i have some errors when adding thing (Soundtouch 300) :

Failure : Cannot append to finished buffer

I have good host and mac address in thing configuration


Any solutions ?

Thanks a lot !

Is this Binding accessible through the IoT Marketplace?

The new Sound Touch Notification API should give us the possibility to have a working TTS solution playing a MP3 file. Is there a possibility that the say() functions creates a MP3 file instead of using the default audio sink? Thanks.

Hello,
i use a workaround, by using a rule to send notifications to my Soundtouch. I think it would be nice to have an action like playUrl2Bose i.e

Here is my rule

import java.net.URLEncoder;
rule "BoseTest"
when
  Item Bose_Trigger changed
then
  val String AppKey = "MYSecretAppKey"
  val String BoseIP = "172.17.100.21"
  val String BoseMsg = "Hallo dies ist ein Test"  // BoseTTSText.state
  val String TranslateUrl = "http://translate.google.com/translate_tts?ie=UTF-8&tl=DE&client=tw-ob&q=" + URLEncoder.encode(BoseMsg,"UTF-8")
  val String PostData = '<play_info><app_key>' + AppKey + '</app_key><url>' + TranslateUrl + '</url><service>OpenHAB</service><volume>20</volume></play_info>';

  sendHttpPostRequest("http://" + BoseIP + ":8090/speaker","",PostData)

end

You have to register to the Bose developer site to get an AppKey

What is the correct syntax for rules for zone control?

I have three devices. When the first device is turned on, I want to turn on the other two and add them to a zone together.

My rule below is working to turn them on, but isn’t establishing the zone. I have also tried substituting the name with the MAC, but still no success.

rule "Set Bose Zone"
when
Item Bose1_Power changed
then
sendCommand(Bose2_Power, ON)
sendCommand(Bose3_Power, ON)
sendCommand(Bose1_ZoneControl, “add Dining Room”)
sendCommand(Bose1_ZoneControl, “add Living Room”)
end

I figured it out. I had to change ZoneControl to ZoneAdd.

I added this line to the items file:
String Bose1_ZoneAdd “Zone Add: [%s]” { channel=“bosesoundtouch:device:9884E3BAABA8:zoneAdd” }

(Need to substitiute the correct MAC address into the string.)

Then I updated the rule to look like:
sendCommand(Bose2_Power, ON)
sendCommand(Bose3_Power, ON)
sendCommand(Bose1_ZoneAdd, “Dining Room”)
sendCommand(Bose1_ZoneAdd, “Living Room”)

Hey mbibbey,
i am trying the same - connect my living room to my entrance bose. but what does the “Dining Room” mean? Where do I define this? In the item list?

at the moment it looks like this :
Items:

Dimmer  Bose_Flur_Volume                     		"Volume: [%d %%]"      <volume>      { channel="bosesoundtouch:device:8030DC556A38:volume" }
Switch  Bose_Flur_Mute                       		"mute: [%s]"           <volume_mute> { channel="bosesoundtouch:device:8030DC556A38:mute" }
String  Bose_Flur_OperationMode              		"Mode: [%s]"           <text>        { channel="bosesoundtouch:device:8030DC556A38:operationMode" }
String  Bose_Flur_ZoneInfo                   		"Zone: [%s]"           <text>        { channel="bosesoundtouch:device:8030DC556A38:zoneInfo", autoupdate="false" }
String  Bose_Flur_ZoneControl                		"Zone control: [%s]"   <text>        { channel="bosesoundtouch:device:8030DC556A38:zoneControl" }
String  Bose_Flur_ZoneAdd                    		"Zone add: [%s]"       <text>        { channel="bosesoundtouch:device:8030DC556A38:zoneAdd" }
String  Bose_Flur_Preset                     		"Preset: [%s]"         <text>        { channel="bosesoundtouch:device:8030DC556A38:preset" }
String  Bose_Flur_KeyCode                    		"Key Code: [%s]"       <text>        { channel="bosesoundtouch:device:8030DC556A38:keyCode" }
String  Bose_Flur_nowPlayingAlbum            		"Album: [%s]"          <text>        { channel="bosesoundtouch:device:8030DC556A38:nowPlayingAlbum" }
String  Bose_Flur_nowPlayingArtist           		"Artist: [%s]"         <text>        { channel="bosesoundtouch:device:8030DC556A38:nowPlayingArtist" }
String  Bose_Flur_nowPlayingArtwork          		"Art: [%s]"            <text>        { channel="bosesoundtouch:device:8030DC556A38:nowPlayingArtwork" }
String  Bose_Flur_nowPlayingDescription      		"Description: [%s]"    <text>        { channel="bosesoundtouch:device:8030DC556A38:nowPlayingDescription" }
String  Bose_Flur_nowPlayingItemName         		"Playing: [%s]"        <text>        { channel="bosesoundtouch:device:8030DC556A38:nowPlayingItemName" }
String  Bose_Flur_nowPlayingPlayStatus       		"Play state: [%s]"     <text>        { channel="bosesoundtouch:device:8030DC556A38:nowPlayingPlayStatus" }
String  Bose_Flur_nowPlayingStationLocation  		"Radio Location: [%s]" <text>        { channel="bosesoundtouch:device:8030DC556A38:nowPlayingStationLocation" }
String  Bose_Flur_nowPlayingStationName      		"Radio Name: [%s]"     <text>        { channel="bosesoundtouch:device:8030DC556A38:nowPlayingStationName" }
String  Bose_Flur_nowPlayingTrack            		"Track: [%s]"          <text>        { channel="bosesoundtouch:device:8030DC556A38:nowPlayingTrack" }

Switch  Bose_Wohnzimmer_Power                      	"Power: [%s]"          <switch>      { channel="bosesoundtouch:device:F45EAB524721:power" }
Dimmer  Bose_Wohnzimmer_Volume                     	"Volume: [%d %%]"      <volume>      { channel="bosesoundtouch:device:F45EAB524721:volume" }
Switch  Bose_Wohnzimmer_Mute                       	"mute: [%s]"           <volume_mute> { channel="bosesoundtouch:device:F45EAB524721:mute" }
String  Bose_Wohnzimmer_OperationMode              	"Mode: [%s]"           <text>        { channel="bosesoundtouch:device:F45EAB524721:operationMode" }
String  Bose_Wohnzimmer_ZoneInfo                   	"Zone: [%s]"           <text>        { channel="bosesoundtouch:device:F45EAB524721:zoneInfo", autoupdate="false" }
String  Bose_Wohnzimmer_ZoneControl                	"Zone control: [%s]"   <text>        { channel="bosesoundtouch:device:F45EAB524721:zoneControl" }
String  Bose_Wohnzimmer_ZoneAdd                    	"Zone add: [%s]"       <text>        { channel="bosesoundtouch:device:F45EAB524721:zoneAdd" }
String  Bose_Wohnzimmer_Preset                     	"Preset: [%s]"         <text>        { channel="bosesoundtouch:device:F45EAB524721:preset" }
String  Bose_Wohnzimmer_KeyCode                    	"Key Code: [%s]"       <text>        { channel="bosesoundtouch:device:F45EAB524721:keyCode" }
String  Bose_Wohnzimmer_nowPlayingAlbum            	"Album: [%s]"          <text>        { channel="bosesoundtouch:device:F45EAB524721:nowPlayingAlbum" }
String  Bose_Wohnzimmer_nowPlayingArtist           	"Artist: [%s]"         <text>        { channel="bosesoundtouch:device:F45EAB524721:nowPlayingArtist" }
String  Bose_Wohnzimmer_nowPlayingArtwork          	"Art: [%s]"            <text>        { channel="bosesoundtouch:device:F45EAB524721:nowPlayingArtwork" }
String  Bose_Wohnzimmer_nowPlayingDescription      	"Description: [%s]"    <text>        { channel="bosesoundtouch:device:F45EAB524721:nowPlayingDescription" }
String  Bose_Wohnzimmer_nowPlayingItemName         	"Playing: [%s]"        <text>        { channel="bosesoundtouch:device:F45EAB524721:nowPlayingItemName" }
String  Bose_Wohnzimmer_nowPlayingPlayStatus       	"Play state: [%s]"     <text>        { channel="bosesoundtouch:device:F45EAB524721:nowPlayingPlayStatus" }
String  Bose_Wohnzimmer_nowPlayingStationLocation  	"Radio Location: [%s]" <text>        { channel="bosesoundtouch:device:F45EAB524721:nowPlayingStationLocation" }
String  Bose_Wohnzimmer_nowPlayingStationName      	"Radio Name: [%s]"     <text>        { channel="bosesoundtouch:device:F45EAB524721:nowPlayingStationName" }
String  Bose_Wohnzimmer_nowPlayingTrack            	"Track: [%s]"          <text>        { channel="bosesoundtouch:device:F45EAB524721:nowPlayingTrack" }

  
indent preformatted text by 4 spaces

rule:

when
		Item Bose_Flur_power changed
then
		if (Bose_Flur_Power.state == ON) {
			sendCommand(Bose_Flur_ZoneAdd  , "Bose_Wohnzimmer")
		}
end

Thanks a lot in advance

Hi tizaf,

the “name” for the device to add is either the “MAC” address or the “name” of the device as configured in the app (could be obtained in the paper UI from the properties. The name is also used as initial device name when the thing is initially added.

So in your case a

sendCommand(Bose_Flur_ZoneAdd  , "F45EAB524721")

should do the job


Cheers,
Chris

1 Like