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
Ricardo Pinto
Quote from Dave De Busschere

1.) Is there a way, to have Bos check the value instantly? I have activated the send cyclically but the value's don't change.

I put the volume to 10 but it stays on 14 until I push the button to send the command.

2.) Can I use a slider to change the volume? I have to integrate the slider value in a post <volume>value</volume>

I was expecting that the GET command would be updated with the cyclical send...

If you test the url, does it change properly? If not, it's Bose who's not sending the correct values...

http://192.168.2.209:8090/volume

Avatar
Dave De Busschere
Quote from Ricardo Pinto

I was expecting that the GET command would be updated with the cyclical send...

If you test the url, does it change properly? If not, it's Bose who's not sending the correct values...

http://192.168.2.209:8090/volume

It work's didn't wait long enough :-)))

Avatar
Dave De Busschere

now I'm trying to post the volume value with an integer (slider or push button) to increase/decrease the volume?

Avatar
Ricardo Pinto

An easy way, but it needs to get adjusted and tested:

- Create a Volume Send integer under the BOSE device;

- Get the integer on the visualization and set it to Percent Setter on the Control Type;

- On the Status Values collection, create the values from 0 to 100, and the Unit to %

- Create a Task under the BOSE device; On the Trigger, use the Volume Send integer, OnChange, AllowRetrigger;

- On the Command of that task, use Run and choose the POST command which sends the volume

- On your POST command of the volume, on the Post Data stuff, use the Properties on the String Editor, to set the Volume Send integer; And on the POST text, instead of using static value for the volume, use the %0 pointer so that it can use the value coming from the Volume Sent integer;

- Likewise, you need to use a task to cyclical get the current volume, and update the status of the "button"

I've posted a more complex way a few minutes ago, but now it doesn't make sense so I deleted the post

If you need more steps, instead of just 10% step, change the Bar Steps on the button visualization, from 10, to 100 (for 1% step), or 20 (for a 5% step).

Test it, and/or adapt the example

Avatar
Dave De Busschere

Obrigado Ricardo,

But I think due to my lack of knowledge, I'm missing some things.

According to our discription I made it as follow:




 

Avatar
Ricardo Pinto

Hi,

I think you're missing some spots there:

On the 3rd image, the integer doesn't need to have a reference

And on the last image, you created a command called task, but it's supposed to be a task and not a command.

So try this:

- On the Integer, delete the reference, leave it empty

- Delete the Command "Task" you created

- Create a Task node, not a command, and call it something like Volume update task

- On that Task, set the Trigger as your Devices\BOSE livestyle650\Integer.Value (set it to OnChange, AllowRetrigger)

- Below, on the Commands of the task, click Add, Run, select your POST vol., choose Function Send (it's the only option).

And test it :) Hope it works

Avatar
Dave De Busschere

Bom dia Ricardo,

About the task is where i get confused, thats why i made a command.

I made the task node, but i can't configure anyrhing, settings is empty?

Do i need to insert a command in the task node? 


Avatar
Ricardo Pinto

Bom dia Dave,

I'm terrible sorry... I call it Task, but in fact it's called Program, DUH! It's a Program task basically...

So resuming:

- Create a Program, not a command, and call it something like Volume update

- On that Program, set the Trigger as your Devices\BOSE livestyle650\Integer.Value (set it to Condition: ValueChanged(OnChange), and click on the AllowRetrigger)

- Below, on the Commands of the Program, click Add, Run, select your POST vol., choose Function Send (it's the only option).

Now this is it! I think... :D

Avatar
Dave De Busschere

Muito obrigado Ricardo,

It works :-))))))

Avatar
Ricardo Pinto

Excellent!

I'm glad that it helped. Does the cyclical get the volume work well also, and update the visualization?

Best regards