Your Universal Remote Control Center
RemoteCentral.com
Philips Pronto Professional Forum - View Post
Up level
Up level
The following page was printed from RemoteCentral.com:

Login:
Pass:
 
 

Original thread:
Post 12 made on Wednesday September 9, 2020 at 19:36
Lyndel McGee
RC Moderator
Joined:
Posts:
August 2001
12,636
If you continue with the URL you are using, you will need to issue 12 http requests to get information for 12 different devices. Hence why I voted for Randman's approach.

I'm hoping that if you use Randman's URL you can get back multiple devices in a single request. I leave this for you to try.

Take this url...
htt_p:// HOMESEER-IP-ADDRESS/JSON?request=getstatus&ref=349

and omit the &ref=349

htt_p:// HOMESEER-IP-ADDRESS/JSON?request=getstatus


If this works and you get information for all devices, you will have a device array that can be checked using if/else and for loops.

What you will need to know is the ref-id of each device you want to determine which device goes to which label.

// This is modified callback that allows you to process multiple device entries.
function processResponse(rcvd)
{
var jsonObj = JSON.parse(rcvd);
// Loop through Devices using a for loop as you would with any array testing for conditions as needed.
GUI.widget('DEV0').label = jsonObj.Devices[0].value;
GUI.widget('DEV1').label = jsonObj.Devices[1].value;
}
Lyndel McGee
Philips Pronto Addict/Beta Tester


Hosting Services by ipHouse