Vera - Smarter Home Control Forum

General => AV Control => Topic started by: Maartenvt on January 08, 2017, 05:51:00 am

Title: Bose SoundTouch API Integration
Post by: Maartenvt 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
Title: Re: Bose SoundTouch API Integration
Post by: Martin79 on February 12, 2017, 05:56:19 pm
Hi,
something new on your project?
i would like to integrate it too :-)

greetings
martin
Title: Re: Bose SoundTouch API Integration
Post by: Martin79 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}}
Title: Re: Bose SoundTouch API Integration
Post by: Maartenvt 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)  ???
Title: Re: Bose SoundTouch API Integration
Post by: Maartenvt 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? ??
Title: Re: Bose SoundTouch API Integration
Post by: Martin79 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 :-)
Title: Re: Bose SoundTouch API Integration
Post by: Maartenvt on February 24, 2017, 08:07:14 am
I got the following XML from my Bose using the Vera UPNP.
Title: Re: Bose SoundTouch API Integration
Post by: Maartenvt 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
Title: Re: Bose SoundTouch API Integration
Post by: robie on November 29, 2017, 02:55:05 am
hi. i am waiting for vera to support this.  this is already supported by smart things hub, any chance that vera can put more effort here