From 7c152cd618756fbcc217c02e4499d83a866f2ec1 Mon Sep 17 00:00:00 2001 From: Robin Bolscher Date: Wed, 22 Jul 2026 14:51:51 +0200 Subject: [PATCH] Add StartUpOnOff and GlobalSceneControl attributes to On/Off cluster Adds the two On/Off cluster (0x0006) attributes missing per ZCL spec r8: - globalSceneControl (0x4000, bool) - startUpOnOff (0x4003, enum8) with spec values off/on/toggle/previous per Table 3-46, enabling power-on behavior configuration. --- index.d.ts | 2 ++ lib/clusters/onOff.js | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/index.d.ts b/index.d.ts index 237c971..90cb7e8 100644 --- a/index.d.ts +++ b/index.d.ts @@ -226,8 +226,10 @@ declare module "zigbee-clusters" { } type OnOffClusterAttributes = { onOff: { id: 0x00, type: ZCLDataType }, + globalSceneControl: { id: 0x4000, type: ZCLDataType }, onTime: { id: 0x4001, type: ZCLDataType }, offWaitTime: { id: 0x4002, type: ZCLDataType }, + startUpOnOff: { id: 0x4003, type: ZCLDataType<"off" | "on" | "toggle" | "previous"> }, }; type OnOffClusterCommands = { setOff: { id: 0x00, direction: "DIRECTION_SERVER_TO_CLIENT" }, diff --git a/lib/clusters/onOff.js b/lib/clusters/onOff.js index 3e9bf70..038e2e9 100644 --- a/lib/clusters/onOff.js +++ b/lib/clusters/onOff.js @@ -5,8 +5,18 @@ const { ZCLDataTypes } = require('../zclTypes'); const ATTRIBUTES = { onOff: { id: 0, type: ZCLDataTypes.bool }, + globalSceneControl: { id: 16384, type: ZCLDataTypes.bool }, onTime: { id: 16385, type: ZCLDataTypes.uint16 }, offWaitTime: { id: 16386, type: ZCLDataTypes.uint16 }, + startUpOnOff: { + id: 16387, + type: ZCLDataTypes.enum8({ + off: 0, + on: 1, + toggle: 2, + previous: 255, + }), + }, }; const COMMANDS = {