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 22 made on Tuesday January 24, 2017 at 18:49
luke2008
Long Time Member
Joined:
Posts:
August 2008
20
I got mine working, not sure if its the most efficient way but it does the job. You will need to change the User ID & IP for it to work with your system.

Hope this helps.

Luke

Turn Lights On --

var socket = new TCPSocket(false);
var result="";


var JSON_on='{"on":true, "sat":212, "bri":254,"hue":13123}';

function getInfos(commands)
{
socket.write('PUT /api/Hue User ID Here/groups/all/action HTTP/1.1\r\nContent-Length: '+commands.length+'\r\n\r\n'+commands);

}

socket.onConnect = function()
{
getInfos(JSON_on);
};

socket.onData = function()
{

};

socket.onClose = function()
{
socket = null
}

socket.onIOerror = function() {
System.print("error");
try {
socket.close()
socket = null
} catch(e) {}
}

socket.connect('Hue Bridge IP Address Here', 80, 3000);

Lights Off --

var socket = new TCPSocket(false);
var result="";


var JSON_on='{"on":false}';

function getInfos(commands)
{
socket.write('PUT /api/Hue User ID Here/groups/all/action HTTP/1.1\r\nContent-Length: '+commands.length+'\r\n\r\n'+commands);

}

socket.onConnect = function()
{
getInfos(JSON_on);
};

socket.onData = function()
{

};

socket.onClose = function()
{
socket = null
}

socket.onIOerror = function() {
System.print("error");
try {
socket.close()
socket = null
} catch(e) {}
}

socket.connect('Hue Bridge IP Address Here', 80, 3000);
Panasonic TX65-DX902*Onkyo-TX-NR5007*Mordaunt Short Alumni 11.2*Philips Pronto TSU9600/ RFX9600


Hosting Services by ipHouse