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

no result:

tried: volume.actualvolume, .volume.actualvolume, .volume

Avatar
Ricardo Pinto

According to the JSONPath validator / Expression tester, to get the volume the Token Name is:

volume.actualvolume

So your Token is correct.

Probably the data is coming as a String and not as a Double.

Can you test with a String value?

Create two items, CurrentVolume and TargetVolume as Strings. Set the Token names to:

volume.actualvolume and volume.targetvolume

And test it out

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

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

On the Sending menu, change Send Ciclically to true, and on the Cyclical Send Delay use 10s for example, so you can visualize the actual values at least with a 10s interval

Avatar
Jürgen Jürgenson
Quote from Dave De Busschere

I just noticed that the Comfortclick, doesn't update the Json response, only the xml

The first line "Response Data" respons the actual volume = 14

the second line "Response Data Xml to Json" keeps the old respons " actual volume =     16????

I made a button and even if I press this it doesn't change.

The add a "." didn't work.

It also may be just .actualvolume because you already are sending /volume with the first part of the command. Have you tested it on a web browser, does it change the volume when you paste the command in there?

Avatar
Dave De Busschere

I just noticed that the Comfortclick, doesn't update the Json response, only the xml

The first line "Response Data" respons the actual volume = 14

the second line "Response Data Xml to Json" keeps the old respons " actual volume =     16????

I made a button and even if I press this it doesn't change.

The add a "." didn't work.

Avatar
Jürgen Jürgenson

Try to add a . in front of the command see if it helps like ".volume.actualvolume" Also good sites to check if your command works are https://jsonpath.curiousconcept.com/ or http://jsonpathfinder.com/