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 1 made on Tuesday March 5, 2024 at 13:38
mpg7321
Regular Member
Joined:
Posts:
June 2020
113
Been trying to get feedback from my HUE system, heres the code that so far does not work, any help would be appreciated. Code runs once when page is being displayed.

var url = CF.widget("Hue_URL","HUE").label;
var socket = new TCPSocket();
socket.onConnect = function() {
prefix2 = 'GET /api/Y1Vpd5qwJVnjsRIdxFThJR0jsdcdaEvrQVe0NYM/lights'
postfix2 = ' HTTP/1.1\r\n'
try {
socket.write(prefix2+postfix2);
socket.write("HOST:+url+\r\n\r\n");
} catch(e) {
socket.close()
};
};
socket.onData = function() {
var info = socket.read();
var bright = info.split('"3":\{"state":\{"on":true,"bri":').pop().split(',"alert"')[0];
CF.widget("Hue_Level").label = bright;
};


Hosting Services by ipHouse