Skip to main content

Turn group of luminaires on/off/dim

To control the dim level of a group of luminaires you can send a CONTROL message to server over active WebSocket connection (and opened wire). The "id" parameter of the message is the ID (number) of the related group of the network related to the current wire. The "level" parameter of the message is the wanted dim level (number) for the related luminaires.

let wire = 1; // Use same wire ID as was used in the related OPEN message for the targeted network
let value = 0.5; // Dim value can be anything from 0 to 1
let group_id = 1; // ID of the related group

if (webSocket.readyState === webSocket.OPEN) {
const data = JSON.stringify({
"wire": wire,
"method": "controlGroup",
"id": group_id,
"level": value
});

socket.send(decodeURIComponent(escape(data)));
}

When CONTROL luminaire group message was successful then server will send unitChanged events (with updated state info) of all related devices to all related clients and related luminaires will be on/off/dimmed.