What am I doing wrong? I can get the lights to toggle with reed sensors so I know my Hue stuff is correct. Please help!
var hue_bridge=<%Hue bridge IP address_H%>;
var hue_user = <%Hue username%>;
var hue_lampids = <%Hue lamp IDs (separate by ,)%>;
var sensors = <#PIR sensor_[72]_N#>;
function (sensor) {
sensor.timedOut = function () {
hue_lampids.split(",").forEach(function(id){
KumoApp.httpCall("http://"+hue_bridge+"/api/" + hue_user+"/lights/"+id+"/state", "PUT",
'{"on": false}');
});
};
sensor.detected = function () {
hue_lampids.split(",").forEach(function(id){
KumoApp.httpCall("http://"+hue_bridge+"/api/" + hue_user+"/lights/"+id+"/state", "PUT",
'{"hue": 50000,"on": true,"bri": 200}');
});
};
});