Help on getting data from http response

Avatar
  • updated
  • Under review

I'm  trying to get data from the respnonse "actualvolume" 

I've been exploring the forum here but i can't figure out what i'm doing wrong.


Parse type: Jhson

I get this response:

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

Image 2282

Image 2283

Image 2284


Image 2288

Avatar
Dave De Busschere

hi Ricardo,

no luck . But previous to get the volume  i had to use the token: volume.targetvolume

So i tried here for the "stationname" what you typed and also token nowplaying.stationname,  now_playing.stationname,  nowplaying.contentitem.stationname

All without result, hmmmm?

Avatar
Ricardo Pinto

Hi,

Can you test with source, instead of nowPlaying.source? This is to extract the source input name.

If you want to extract the station name, can you test with token stationName?

Best regards

Avatar
Dave De Busschere
Quote from Fabien Fuster

Hi Dave,

Can you post a copy of your real xml answer. I will try to help out from there..

playnow.txt

Avatar
Fabien Fuster

Hi Dave,

Can you post a copy of your real xml answer. I will try to help out from there..

Avatar
Dave De Busschere

Hi there,

I got quite a lot working on the BOSE, Burt I'm stuck with retrieving some data/respons.

I would like to see what source or radio station is playing.

I got the GET command to work and receive the xml respons but when I try to isolate the specific data I get lost (no respons).

Here are the screen shots from the BOSE api site with the commands

Someone a clue??


I'm about to post soon the integration :-)




Avatar
Ricardo Pinto

LOL! What the hell is "Gabbo"? Liked the funny joke on BOSE API documentation...


Sorry to be late, wasn't able to come back before :-)


Fabien Fuster is another advanced user Dave. Any hints from him, are right in the spot.

You're in the right track, soon you'll be able to dominate the BOSE integration :-D

Best regards

Avatar
Dave De Busschere
Quote from Fabien Fuster

Hi Dave,

Reading the data, if not mistaking, you should send the following :

<key state="press" sender="Gabbo">MUTE</key>

Regards,

Hi thanks,

It was the "Gabbo" I forgot 

It works.

Avatar
Fabien Fuster

Hi Dave,

Reading the data, if not mistaking, you should send the following :

<key state="press" sender="Gabbo">MUTE</key>

Regards,

Avatar
Dave De Busschere


Bom dia Ricardo,

Now we (you and me) got the volume control to work, I'm moving to the next part MUTE and ON/OFF.

I don't see how I input the key_value and key_status in the post data?

<key state="$KEY_STATE" sender="$KEY_SENDER">$KEY_VALUE</key>

(At he bottom of this message is my input), without result.

I also changed the $key_value with "MUTE" and $KEY_STATE with"press".


Muito obrigado,

Here is the list reference from Bose:


Avatar
Dave De Busschere
Quote from Ricardo Pinto

Hi,

Try this....

You are using Double values to get the data, and I was expecting integers, so I wasn't getting there...

Import this example and test it.

- Insert the "Volume button" double on the visualization;

- I used a Percentage template for the default value;

- Change the style to manual;

- On the Status Values create from 0 to 100;

- Set Show Bar to True;

- Choose 0 as Decimal places;

- Choose Control Type as Percent Setter;

I suppose that when the "actual" double updates, or with cyclical call, the volume button value will update.

For that, the Program gets the "actual" double as trigger, and sets that value to the button. So if you have cyclical get active for the volume, in theory the button in the visualization should change also.

Best regards

Casa-BOSE lifestyle650.bos

Hi Recardo,

Got it working.

I put everything on integer instead of double. 

Thanks for al the effort you put into it.