Author Topic: Bose SoundTouch API Integration  (Read 1512 times)

Offline Maartenvt

  • Full Member
  • ***
  • Posts: 146
  • Karma: +0/-0
Bose SoundTouch API Integration
« on: January 08, 2017, 05:51:00 am »
Hi Everybody,

I'm trying to get the Bose API integrated into my Vera.... unfortunately without any luck....I was hoping if you guys could help me with this.

I've attached the Bose documentation
Vera Edge (Firmware rev. 1.7.2406), 1x Düwi INTERACT³ light switch, 1x  ZIR010 Motion Sensor.

Offline Martin79

  • Newbie
  • *
  • Posts: 9
  • Karma: +0/-0
Re: Bose SoundTouch API Integration
« Reply #1 on: February 12, 2017, 05:56:19 pm »
Hi,
something new on your project?
i would like to integrate it too :-)

greetings
martin

Offline Martin79

  • Newbie
  • *
  • Posts: 9
  • Karma: +0/-0
Re: Bose SoundTouch API Integration
« Reply #2 on: February 13, 2017, 01:10:53 pm »
ok,
i found this code for the fibaro. but i still don`t know what to change that it is working with vera?

{"name":"Bose","type":"virtual_device","properties":{"deviceIcon":209,"currentIcon":"209","log":"","logTemp":"","mainLoop":"","visible":"true","rows":[{"type":"button","elements":[{"id":1,"lua":true,"waitForResponse":false,"caption":"Power","name":"Button1","empty":false,"msg":"IP = fibaro:get(fibaro:getSelfId(), \"IPAddress\")\nTCP = fibaro:get(fibaro:getSelfId(), \"TCPPort\")\n\nBOSE = Net.FHttp(IP,TCP)-- mettre l'adresse ip de son soundtouch\nfibaro:log('POWER')\n \n-- method for key_value\npress = '<key state=\"press\" sender=\"Gabbo\">POWER</key>'\nrelease = '<key state=\"release\" sender=\"Gabbo\">POWER</key>'\nresponse ,status, errorCode = BOSE:POST('/key', press)\nresponse ,status, errorCode = BOSE:POST('/key', release)","buttonIcon":209,"favourite":false,"main":true},{"id":2,"lua":true,"waitForResponse":false,"caption":"Mute","name":"Button2","empty":false,"msg":"IP = fibaro:get(fibaro:getSelfId(), \"IPAddress\")\nTCP = fibaro:get(fibaro:getSelfId(), \"TCPPort\")\n\nBOSE = Net.FHttp(IP,TCP)-- mettre l'adresse ip de son soundtouch\nfibaro:log('MUTE')\n \n-- method for key_value\npress = '<key state=\"press\" sender=\"Gabbo\">MUTE</key>'\nrelease = '<key state=\"release\" sender=\"Gabbo\">MUTE</key>'\nresponse ,status, errorCode = BOSE:POST('/key', press)\nresponse ,status, errorCode = BOSE:POST('/key', release)","buttonIcon":209,"favourite":false,"main":false}]},{"type":"button","elements":[{"id":3,"lua":true,"waitForResponse":false,"caption":"&lt;","name":"Button51","empty":false,"msg":"IP = fibaro:get(fibaro:getSelfId(), \"IPAddress\")\nTCP = fibaro:get(fibaro:getSelfId(), \"TCPPort\")\n\nBOSE = Net.FHttp(IP,TCP)-- mettre l'adresse ip de son soundtouch\nfibaro:log('PREV_TRACK')\n \n-- method for key_value\npress = '<key state=\"press\" sender=\"Gabbo\">PREV_TRACK</key>'\nrelease = '<key state=\"release\" sender=\"Gabbo\">PREV_TRACK</key>'\nresponse ,status, errorCode = BOSE:POST('/key', press)\nresponse ,status, errorCode = BOSE:POST('/key', release)","buttonIcon":209,"favourite":false,"main":false},{"id":4,"lua":true,"waitForResponse":false,"caption":"&gt;","name":"Button52","empty":false,"msg":"IP = fibaro:get(fibaro:getSelfId(), \"IPAddress\")\nTCP = fibaro:get(fibaro:getSelfId(), \"TCPPort\")\n\nBOSE = Net.FHttp(IP,TCP)-- mettre l'adresse ip de son soundtouch\nfibaro:log('NEXT_TRACK')\n \n-- method for key_value\npress = '<key state=\"press\" sender=\"Gabbo\">NEXT_TRACK</key>'\nrelease = '<key state=\"release\" sender=\"Gabbo\">NEXT_TRACK</key>'\nresponse ,status, errorCode = BOSE:POST('/key', press)\nresponse ,status, errorCode = BOSE:POST('/key', release)","buttonIcon":209,"favourite":false,"main":false},{"id":5,"lua":true,"waitForResponse":false,"caption":"-","name":"Button53","empty":false,"msg":"IP = fibaro:get(fibaro:getSelfId(), \"IPAddress\")\nTCP = fibaro:get(fibaro:getSelfId(), \"TCPPort\")\n\nBOSE = Net.FHttp(IP,TCP)-- mettre l'adresse ip de son soundtouch\nfibaro:log('VOLUME_DOWN')\n \n-- method for key_value\npress = '<key state=\"press\" sender=\"Gabbo\">VOLUME_DOWN</key>'\nrelease = '<key state=\"release\" sender=\"Gabbo\">VOLUME_DOWN</key>'\nresponse ,status, errorCode = BOSE:POST('/key', press)\nresponse ,status, errorCode = BOSE:POST('/key', release)","buttonIcon":209,"favourite":false,"main":false},{"id":6,"lua":true,"waitForResponse":false,"caption":"+","name":"Button54","empty":false,"msg":"IP = fibaro:get(fibaro:getSelfId(), \"IPAddress\")\nTCP = fibaro:get(fibaro:getSelfId(), \"TCPPort\")\n\nBOSE = Net.FHttp(IP,TCP)-- mettre l'adresse ip de son soundtouch\nfibaro:log('VOLUME_UP')\n \n-- method for key_value\npress = '<key state=\"press\" sender=\"Gabbo\">VOLUME_UP</key>'\nrelease = '<key state=\"release\" sender=\"Gabbo\">VOLUME_UP</key>'\nresponse ,status, errorCode = BOSE:POST('/key', press)\nresponse ,status, errorCode = BOSE:POST('/key', release)","buttonIcon":209,"favourite":false,"main":false}]},{"type":"button","elements":[{"id":7,"lua":true,"waitForResponse":false,"caption":"♬ Play/Pause ♬","name":"Button55","empty":false,"msg":"IP = fibaro:get(fibaro:getSelfId(), \"IPAddress\")\nTCP = fibaro:get(fibaro:getSelfId(), \"TCPPort\")\n\nBOSE = Net.FHttp(IP,TCP)-- mettre l'adresse ip de son soundtouch\nfibaro:log('PLAY_PAUSE')\n \n-- method for key_value\npress = '<key state=\"press\" sender=\"Gabbo\">PLAY_PAUSE</key>'\nrelease = '<key state=\"release\" sender=\"Gabbo\">PLAY_PAUSE</key>'\nresponse ,status, errorCode = BOSE:POST('/key', press)\nresponse ,status, errorCode = BOSE:POST('/key', release)","buttonIcon":209,"favourite":false,"main":false}]},{"type":"button","elements":[{"id":8,"lua":true,"waitForResponse":false,"caption":"1","name":"Button31","empty":false,"msg":"IP = fibaro:get(fibaro:getSelfId(), \"IPAddress\")\nTCP = fibaro:get(fibaro:getSelfId(), \"TCPPort\")\n\nBOSE = Net.FHttp(IP,TCP)-- mettre l'adresse ip de son soundtouch\nfibaro:log('PRESET_1')\n \n-- method for key_value\npress = '<key state=\"press\" sender=\"Gabbo\">PRESET_1</key>'\nrelease = '<key state=\"release\" sender=\"Gabbo\">PRESET_1</key>'\nresponse ,status, errorCode = BOSE:POST('/key', press)\nresponse ,status, errorCode = BOSE:POST('/key', release)","buttonIcon":209,"favourite":false,"main":false},{"id":9,"lua":true,"waitForResponse":false,"caption":"2","name":"Button32","empty":false,"msg":"IP = fibaro:get(fibaro:getSelfId(), \"IPAddress\")\nTCP = fibaro:get(fibaro:getSelfId(), \"TCPPort\")\n\nBOSE = Net.FHttp(IP,TCP)-- mettre l'adresse ip de son soundtouch\nfibaro:log('PRESET_2')\n \n-- method for key_value\npress = '<key state=\"press\" sender=\"Gabbo\">PRESET_2</key>'\nrelease = '<key state=\"release\" sender=\"Gabbo\">PRESET_2</key>'\nresponse ,status, errorCode = BOSE:POST('/key', press)\nresponse ,status, errorCode = BOSE:POST('/key', release)","buttonIcon":209,"favourite":false,"main":false},{"id":10,"lua":true,"waitForResponse":false,"caption":"3","name":"Button33","empty":false,"msg":"IP = fibaro:get(fibaro:getSelfId(), \"IPAddress\")\nTCP = fibaro:get(fibaro:getSelfId(), \"TCPPort\")\n\nBOSE = Net.FHttp(IP,TCP)-- mettre l'adresse ip de son soundtouch\nfibaro:log('PRESET_3')\n \n-- method for key_value\npress = '<key state=\"press\" sender=\"Gabbo\">PRESET_3</key>'\nrelease = '<key state=\"release\" sender=\"Gabbo\">PRESET_3</key>'\nresponse ,status, errorCode = BOSE:POST('/key', press)\nresponse ,status, errorCode = BOSE:POST('/key', release)","buttonIcon":209,"favourite":false,"main":false}]},{"type":"button","elements":[{"id":11,"lua":true,"waitForResponse":false,"caption":"4","name":"Button41","empty":false,"msg":"IP = fibaro:get(fibaro:getSelfId(), \"IPAddress\")\nTCP = fibaro:get(fibaro:getSelfId(), \"TCPPort\")\n\nBOSE = Net.FHttp(IP,TCP)-- mettre l'adresse ip de son soundtouch\nfibaro:log('PRESET_4')\n \n-- method for key_value\npress = '<key state=\"press\" sender=\"Gabbo\">PRESET_4</key>'\nrelease = '<key state=\"release\" sender=\"Gabbo\">PRESET_4</key>'\nresponse ,status, errorCode = BOSE:POST('/key', press)\nresponse ,status, errorCode = BOSE:POST('/key', release)","buttonIcon":209,"favourite":false,"main":false},{"id":12,"lua":true,"waitForResponse":false,"caption":"5","name":"Button42","empty":false,"msg":"IP = fibaro:get(fibaro:getSelfId(), \"IPAddress\")\nTCP = fibaro:get(fibaro:getSelfId(), \"TCPPort\")\n\nBOSE = Net.FHttp(IP,TCP)-- mettre l'adresse ip de son soundtouch\nfibaro:log('PRESET_5')\n \n-- method for key_value\npress = '<key state=\"press\" sender=\"Gabbo\">PRESET_5</key>'\nrelease = '<key state=\"release\" sender=\"Gabbo\">PRESET_5</key>'\nresponse ,status, errorCode = BOSE:POST('/key', press)\nresponse ,status, errorCode = BOSE:POST('/key', release)","buttonIcon":209,"favourite":false,"main":false},{"id":13,"lua":true,"waitForResponse":false,"caption":"6","name":"Button43","empty":false,"msg":"IP = fibaro:get(fibaro:getSelfId(), \"IPAddress\")\nTCP = fibaro:get(fibaro:getSelfId(), \"TCPPort\")\n\nBOSE = Net.FHttp(IP,TCP)-- mettre l'adresse ip de son soundtouch\nfibaro:log('PRESET_6')\n \n-- method for key_value\npress = '<key state=\"press\" sender=\"Gabbo\">PRESET_6</key>'\nrelease = '<key state=\"release\" sender=\"Gabbo\">PRESET_6</key>'\nresponse ,status, errorCode = BOSE:POST('/key', press)\nresponse ,status, errorCode = BOSE:POST('/key', release)","buttonIcon":209,"favourite":false,"main":false}]},{"type":"button","elements":[{"id":14,"lua":true,"waitForResponse":false,"caption":"Aux","name":"Button61","empty":false,"msg":"IP = fibaro:get(fibaro:getSelfId(), \"IPAddress\")\nTCP = fibaro:get(fibaro:getSelfId(), \"TCPPort\")\n\nBOSE = Net.FHttp(IP,TCP)-- mettre l'adresse ip de son soundtouch\nfibaro:log('AUX_INPUT')\n \n-- method for key_value\npress = '<key state=\"press\" sender=\"Gabbo\">AUX_INPUT</key>'\nrelease = '<key state=\"release\" sender=\"Gabbo\">AUX_INPUT</key>'\nresponse ,status, errorCode = BOSE:POST('/key', press)\nresponse ,status, errorCode = BOSE:POST('/key', release)","buttonIcon":209,"favourite":false,"main":false}]}]},"actions":{"pressButton":1,"setSlider":2,"setProperty":2}}

Offline Maartenvt

  • Full Member
  • ***
  • Posts: 146
  • Karma: +0/-0
Re: Bose SoundTouch API Integration
« Reply #3 on: February 17, 2017, 10:15:57 am »
Well, its a start. Do you have clean code? or code files? this is just a text dump (unreadable)  ???
Vera Edge (Firmware rev. 1.7.2406), 1x Düwi INTERACT³ light switch, 1x  ZIR010 Motion Sensor.

Offline Maartenvt

  • Full Member
  • ***
  • Posts: 146
  • Karma: +0/-0
Re: Bose SoundTouch API Integration
« Reply #4 on: February 17, 2017, 05:11:49 pm »
Attached a more readable file. I've tried to figure out on how to get this into a virtual device in Vera. But simply don't got the coding skills

Hopefully somebody here at the forum can help us? ??
Vera Edge (Firmware rev. 1.7.2406), 1x Düwi INTERACT³ light switch, 1x  ZIR010 Motion Sensor.

Offline Martin79

  • Newbie
  • *
  • Posts: 9
  • Karma: +0/-0
Re: Bose SoundTouch API Integration
« Reply #5 on: February 17, 2017, 07:54:22 pm »
i`ve found it on this page: https://forum.fibaro.com/index.php?/topic/20752-bose-virtual-device-onoff-button/#comment-83394
i`ve tried to attache the file from there, but the type is not allowed here...

would be great for use with echo dot :-)

Offline Maartenvt

  • Full Member
  • ***
  • Posts: 146
  • Karma: +0/-0
Re: Bose SoundTouch API Integration
« Reply #6 on: February 24, 2017, 08:07:14 am »
I got the following XML from my Bose using the Vera UPNP.
Vera Edge (Firmware rev. 1.7.2406), 1x Düwi INTERACT³ light switch, 1x  ZIR010 Motion Sensor.

Offline Maartenvt

  • Full Member
  • ***
  • Posts: 146
  • Karma: +0/-0
Re: Bose SoundTouch API Integration
« Reply #7 on: February 26, 2017, 02:31:32 pm »
Ok, did some coding based on some examples. Its not the most clean code, but it works within my Vera (within scenes only)

Its not much, but at least you can get the "Now Playing" XML in to variable. This is for me handy to run within scenes. Feel free to extend with additional GET information and maybe even POST commands.

Creating a full plugin within Vera is in my opinion to complex, I just don't get :)

Hopefully somebody can pick it up and help us with this to extend and create a plugin
« Last Edit: February 26, 2017, 03:05:12 pm by Maartenvt »
Vera Edge (Firmware rev. 1.7.2406), 1x Düwi INTERACT³ light switch, 1x  ZIR010 Motion Sensor.