API help

Avatar
  • updated

Hi,

I'm newt the api's. I'd like to get some information from our Bose. but I don't know how to get started with the api.

this is what I want to do:

https://bosedevs.bose.com/discussion/433/power-control

do I use http or basic devices, how do I put the get command in the api (command, string,....?)

thanks in advance,

Dave

Avatar
Dave De Busschere

When I look at the Bose website (special-types) it looks like the response is a flag?

sorry for being a amateur, but when I able to retrieve the responsdata and publish it in bos I'm on a go. 

https://developer.bose.com/special-types

Avatar
Dave De Busschere

I get this response:

{"?xml":{"@version":"1.0","@encoding":"UTF-8"},"volume":{"@deviceID":"C4F312D5994F","targetvolume":"16","actualvolume":"16","muteenabled":"false"}}

Avatar
Ricardo Pinto

Hi,

When you send the Get command, you get a Response Data, and a Response Data Xml to Json on bOS.

Can you copy past your Response Data Xml to Json here?

Best regards

Avatar
Dave De Busschere

Hi guys,

I'm able to get response from the Bose when I give a GET command.


example: GET /volume

get this respons from the Bose


<?xml version="1.0" ?>
<volume deviceID="$MACADDR">
<targetvolume>$INT</targetvolume>
<actualvolume>$INT</actualvolume>
<muteenabled>$BOOL</muteenabled>
</volume>

Where actualvolume in this case was 16.

How can I make this particular value visible in the app.

So I can see in the app the actual volume.

Or in other cases: which room is playing, what channel is playing, ....

I don't see what object I must chose to do display this particular value?

Thanks,

Avatar
Ricardo Pinto

Hi Dave,

I think that most of the features you refer are possible to create, but it needs some time, effort, and specially one/more SoundTouch products to test several scenarios.

I'd be happy to help, unfortunately I don't own any Bose SoundTouch products, so I think you'll have to be our "lab mouse" :-)


PS: Anyone's who's willing to send me any compatible SoundTouch product for testing, I'm in Portugal, contact me :-P


Best regards

Avatar

Hey Dave, great work!

As Ricardo said, please publish this integration to our Example Library once you have it ready for a chance to win a free Jigsaw/Colibri unit or additional discount for your next purchase and also help other users! :)

Tks!

Avatar
Dave De Busschere

I didn't know either because when I typed the url In the browser without port number it connected to the Bose.

I found it by luck in seeing it the Bose api forum.

I'll share when I have something. 

I have some ideas, perhaps some people here have more knowledge/ideas in controlling audio

I thought about:

- all off

- music on when you come home

- zone select (living room, TV-room, bathroom, office,...)

- maybe doorbell sound (when someone rings the doorbell)

- ....

Avatar
Ricardo Pinto

Really? That's great.

Haven't noticed any ports references on the SoundTouch API documentation...I read so quickly that I don't even remember any ports.


Now you can improve it, and even share your integration if you want.

Best regards

Avatar
Dave De Busschere

Got it working, I had to put the correct

 port in the url ;-)

Avatar
Dave De Busschere

Found this in the log file:

But I'm a dummy in trying to understand this :-)

Anyone with a clue?

Devices : 11/17/2019 9:58:19 PM : Error : Devices\Http : Error connecting to device. Unable to read data from the transport connection: Connection reset by peer. at System.Net.HttpWebRequest.RunWithTimeoutWorkerT (System.Threading.Tasks.Task`1TResult workerTask, System.Int32 timeout, System.Action abort, System.Func`1TResult aborted, System.Threading.CancellationTokenSource cts) 0x000f8 in :0

at System.Net.WebResponseStream.ReadAsync (System.Byte buffer, System.Int32 offset, System.Int32 count, System.Threading.CancellationToken cancellationToken) 0x0025d in :0

at System.IO.Stream.CopyToAsyncInternal (System.IO.Stream destination, System.Int32 bufferSize, System.Threading.CancellationToken cancellationToken) 0x00116 in :0

at System.Net.Http.HttpContent.LoadIntoBufferAsync (System.Int64 maxBufferSize) 0x000a9 in <5f44f3bd9eda455dbecd0c6b7eee09cc>:0

at System.Net.Http.HttpClient.SendAsyncWorker (System.Net.Http.HttpRequestMessage request, System.Net.Http.HttpCompletionOption completionOption, System.Threading.CancellationToken cancellationToken) 0x00171 in <5f44f3bd9eda455dbecd0c6b7eee09cc>:0

at ComfortClick.Http.Driver.HttpDriver.SendCommand (ComfortClick.Http.Commands.HttpCommand command, System.Object stateValue, ComfortClick.Http.Common.TextEncodingEnum encoding) 0x00213 in :0