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

Maartenvt

  • Full Member
  • ***
  • Posts: 144
  • Karma: +0/-0
Bose SoundTouch API Integration
« on: January 08, 2017, 02: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.

Martin79

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

greetings
martin

Martin79

  • Newbie
  • *
  • Posts: 9
  • Karma: +0/-0
Re: Bose SoundTouch API Integration
« Reply #2 on: February 13, 2017, 10:10:53 am »
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}}

Maartenvt

  • Full Member
  • ***
  • Posts: 144
  • Karma: +0/-0
Re: Bose SoundTouch API Integration
« Reply #3 on: February 17, 2017, 07: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.

Maartenvt

  • Full Member
  • ***
  • Posts: 144
  • Karma: +0/-0
Re: Bose SoundTouch API Integration
« Reply #4 on: February 17, 2017, 02: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.

Martin79

  • Newbie
  • *
  • Posts: 9
  • Karma: +0/-0
Re: Bose SoundTouch API Integration
« Reply #5 on: February 17, 2017, 04: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 :-)