Collaborator: Audrey Chou ([email protected])
We noticed the alert mode have very nice glowing + slowly flashing effect in class so we modified the web app and made the 6 lights in 404 glowing (alert:lselect) one by one with 10 sec delay time, achieving a firelyer lighting up in the darkness effect performance.
We lit the lights up in the order of their size: 7-8-1-4-9-10
(please turn on sound as well)
[https://drive.google.com/file/d/1noxL6ufvwIZi6eTpibHx9_SjAsIQrlGf/view?usp=sharing](https://drive.google.com/file/d/1noxL6ufvwIZi6eTpibHx9_SjAsIQrlGf/view?usp=sharing)
We noticed that in a request, if “alert:lselect” is turned on, even if you specify other parameters in the same request (on/off, brightness, color temp) they will be ignored and keep the previous settings. So we send 2 requets: the first to set the brightness and warmth and turn it on, the immediate second one set it to alert:lselect mode.
We used the debugger to confirm on the brightness and color tempreture we want first, then we code this into the webapp as a button’s callback function as following:
function breathEverything(event) {
// Set light brightness and color tempreture.
let lightState0 = {
on: true,
bri: 100,
ct: 500,
alert: "none",
};
// Start flashing.
let lightState1 = {
alert: "lselect",
};
sendRequest('lights/7/state/', 'PUT', lightState0);
sendRequest('lights/7/state/', 'PUT', lightState1);
setTimeout(function() {
sendRequest('lights/8/state/', 'PUT', lightState0);
sendRequest('lights/8/state/', 'PUT', lightState1);
setTimeout(function() {
sendRequest('lights/1/state/', 'PUT', lightState0);
sendRequest('lights/1/state/', 'PUT', lightState1);
setTimeout(function() {
sendRequest('lights/4/state/', 'PUT', lightState0);
sendRequest('lights/4/state/', 'PUT', lightState1);
setTimeout(function() {
sendRequest('lights/9/state/', 'PUT', lightState0);
sendRequest('lights/9/state/', 'PUT', lightState1);
setTimeout(function() {
sendRequest('lights/10/state/', 'PUT', lightState0);
sendRequest('lights/10/state/', 'PUT', lightState1);
}, 10000);
}, 10000);
}, 10000);
}, 10000);
}, 10000);
}
debug counsel - http://172.22.151.183/debug/clip.html
Hue API V1 - https://developers.meethue.com/develop/hue-api/lights-api/
172.22.151.183
API key - Jzxbg02ITPAe7lWKtywcNCpWe2MtQBTnwDlVMRza
light # | state/on | bri | hue | sat | effect | xy | ct | alert |
---|---|---|---|---|---|---|---|---|
1 | x | x | x | x | ||||
4 | x | x | x | x | ||||
7 | x | x | x | x | ||||
8 | x | x | x | x | ||||
9 | x | x | x | x | ||||
10 | x | x | x | x |