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.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);