Z-Stack API Reference  3.3.1
ZCL On Off Cluster

Macros

#define ATTRID_ON_OFF   0x0000
 Represents the On/Off device state.
 
#define ATTRID_ON_OFF_GLOBAL_SCENE_CTRL   0x4000
 
#define ATTRID_ON_OFF_ON_TIME   0x4001
 
#define ATTRID_ON_OFF_OFF_WAIT_TIME   0x4002
 
#define COMMAND_OFF   0x00
 On receipt of this command, a device SHALL enter its 'Off' state.
 
#define COMMAND_ON   0x01
 On receipt of this command, a device SHALL enter its 'On' state.
 
#define COMMAND_TOGGLE   0x02
 
#define COMMAND_OFF_WITH_EFFECT   0x40
 
#define COMMAND_ON_WITH_RECALL_GLOBAL_SCENE   0x41
 
#define COMMAND_ON_WITH_TIMED_OFF   0x42
 
#define EFFECT_ID_DELAY_ALL_OFF   0x00
 
#define EFFECT_ID_DYING_LIGHT   0x01
 
#define EFFECT_VARIANT_FADE_TO_OFF   0x00
 
#define EFFECT_VARIANT_NO_FADE   0x01
 
#define EFFECT_VARIANT_DIM_DOWN   0x01
 
#define EFFECT_VARIANT_DIM_UP   0x00
 

Detailed Description

Macro Definition Documentation

§ ATTRID_ON_OFF_GLOBAL_SCENE_CTRL

#define ATTRID_ON_OFF_GLOBAL_SCENE_CTRL   0x4000

In order to support the use case where the user gets back the last setting of the devices

§ ATTRID_ON_OFF_OFF_WAIT_TIME

#define ATTRID_ON_OFF_OFF_WAIT_TIME   0x4002

The OffWaitTime attribute specifies the length of time (in 1/10ths second) that the "off" state SHALL be guarded to prevent an on command turning the device back to its "on" state (e.g., when leaving a room, the lights are turned off but an occupancy sensor detects the leaving person and attempts to turn the lights back on).

§ ATTRID_ON_OFF_ON_TIME

#define ATTRID_ON_OFF_ON_TIME   0x4001

The OnTime attribute specifies the length of time (in 1/10ths second) that the "on" state SHALL be maintained before automatically transitioning to the "off" state when using the On with timed off command.

§ COMMAND_OFF_WITH_EFFECT

#define COMMAND_OFF_WITH_EFFECT   0x40

The Effect Identifier field is 8-bits in length and specifies the fading effect to use when switching the device off.

§ COMMAND_ON_WITH_RECALL_GLOBAL_SCENE

#define COMMAND_ON_WITH_RECALL_GLOBAL_SCENE   0x41

The On With Recall Global Scene command allows the recall of the settings when the device was turned off.

§ COMMAND_ON_WITH_TIMED_OFF

#define COMMAND_ON_WITH_TIMED_OFF   0x42

The On With Timed Off command allows devices to be turned on for a specific duration with a guarded off duration so that SHOULD the device be subsequently switched off, further On With Timed Off commands.

§ COMMAND_TOGGLE

#define COMMAND_TOGGLE   0x02

On receipt of this command, if a device is in its 'Off' state it SHALL enter its 'On' state. Otherwise, if it is in its 'On' state it SHALL enter its 'Off' state.