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
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
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

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
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
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
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

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

Please take note on characters, some are lowercase, and other uppercase.

I've parsed the xml response to json, and get correct answers with the following token names:

nowPlaying.ContentItem.source

nowPlaying.stationName

Can you copy paste them and test? Don't write them down in just lowercase, copy them as I wrote, as it has upper and lowercase on the API documentation

Avatar
Dave De Busschere
Quote from Ricardo Pinto

Please take note on characters, some are lowercase, and other uppercase.

I've parsed the xml response to json, and get correct answers with the following token names:

nowPlaying.ContentItem.source

nowPlaying.stationName

Can you copy paste them and test? Don't write them down in just lowercase, copy them as I wrote, as it has upper and lowercase on the API documentation

nope no luck there. could it be that the response is a text instead of a number (value)?

Avatar
Ricardo Pinto

I think so, those values are supposed to be strings, so if you're using integer or double it won't work...

Test it out with strings, and use the token names I've wrote, and be careful with the uppercase and lowercase characters.

BR