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, 

I can use integers as we to retrieve the values.

If this is easier I'll change everything to integers ( can also use strings if needed).

Regards,

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,

I get en "internal server error" message when:

1. i change volume with the BOSE remote

2. when i change volume with the visualization

But i do get following:

- the value in the visualizations changes when i use the BOSE remomote ;-)

- when i use the visualization to change the volume i get the error message. BUT the volume of het BOSE won't change.

Avatar
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

Avatar
Dave De Busschere
Quote from Ricardo Pinto

Hi,

Probably we're missing something, because POST and GET command is not supposed to interfere with each other.

Can you export your implementation, even if it's not complete, so we can double check?

Best regards

J2043-BOSE lifestyle650.bos

solved the interfear, it was actualy that the Bos was sending his value toward the BOSE.

But i'm still not able to make the Bos visual (Integer) to change to the reading from the BOSE


It just stays on the setting i last used in Bos, so if i change the volume with the BOSE remote, i do get the value with the GET command but i don't see how i can make the Integer change to the actual reading.


Best Regards,

Avatar
Ricardo Pinto

Hi,

Probably we're missing something, because POST and GET command is not supposed to interfere with each other.

Can you export your implementation, even if it's not complete, so we can double check?

Best regards

Avatar
Dave De Busschere

the POST and GET command interfear eachother. When i change the value in the BOSE app to it automaticly changes back to the comfort click value. Because the integer didn't change to the BOSE app vol.

Avatar
Dave De Busschere
Quote from Ricardo Pinto

Excellent!

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

Best regards 

The value on the integer (button) doesn't change when i use the BOSE remote or app?

I'm trying with the programm but no result so far.

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 

Avatar
Dave De Busschere

Muito obrigado Ricardo,

It works :-))))))

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