On/Off Cluster

This chapter describes the On/Off cluster.

The On/Off cluster has a Cluster ID of 0x0006.

Overview

The On/Off cluster allows a device to be put into the ‘on’ and ‘off’ states, or toggled between the two states. The cluster also provides the following enhanced functionality for lighting:

  • When switching off lights with an effect, saves the last light (attribute) settings to a global scene, ready to be reused for the next switch-on from the global scene - see Section 14.5.2 and Section 14.6

  • Allows lights to be switched on for a timed period (and then automatically switched off) - see Section 14.5.3

To use the functionality of this cluster, you must include the file OnOff.h in your application and enable the cluster by defining CLD_ONOFF in the zcl_options.h file.

It is also necessary to enable the cluster as a server or client, or as both:

  • The cluster server is able to receive commands to change the on/off state of the local device.

  • The cluster client is able to send commands to the server to request a change to the on/off state of the remote device.

The inclusion of the client or server software must be pre-defined in the compile-time options of the application. In addition, if the cluster is to reside on a custom endpoint then the role of client or server must also be specified when creating the cluster instance.

The compile-time options for the On/Off cluster are fully detailed in Section 14.10.

Parent topic:On/Off Cluster

On/Off Cluster Structure and Attribute

The structure definition for the On/Off cluster is:

typedef struct
{
#ifdef ONOFF_SERVER
    zbool                   bOnOff;
#ifdef CLD_ONOFF_ATTR_GLOBAL_SCENE_CONTROL
    zbool                   bGlobalSceneControl;
#endif
#ifdef CLD_ONOFF_ATTR_ON_TIME
    zuint16                 u16OnTime;
#endif
#ifdef CLD_ONOFF_ATTR_OFF_WAIT_TIME
    zuint16                 u16OffWaitTime;
#endif
#ifdef CLD_ONOFF_ATTR_STARTUP_ONOFF
    /* ZLO extension for OnOff Cluster    */             
    zenum8                  eStartUpOnOff;
#endif
#ifdef CLD_ONOFF_ATTR_ATTRIBUTE_REPORTING_STATUS
    zenum8                  u8AttributeReportingStatus;
#endif
#endif
    zuint16                 u16ClusterRevision;
} tsCLD_OnOff;

where:

  • bOnOff is the on/off state of the device (TRUE = on, FALSE = off).

  • bGlobalSceneControl is an optional attribute for lighting that is used with the global scene - the value of this attribute determines whether to permit saving the current light settings to the global scene:

    • TRUE - Current light settings can be saved to the global scene

    • FALSE - Current light settings cannot be saved to the global scene

  • u16OnTime is an optional attribute for lighting used to store the time, in tenths of a second, for which the lights remain ‘on’ after a switch-on with ‘timed off’

    (that is, the time before starting the transition from the ‘on’ state to the ‘off’ state). The special values 0x0000 and 0xFFFF indicate that the lamp must be maintained in the ‘on’ state indefinitely (no timed off).

  • u16OffWaitTime is an optional attribute for lighting used to store the waiting time, in tenths of a second, following a ‘timed off’ before the lights can be again switched on with a ‘timed off’.

Note: If the bGlobalSceneControl attribute and global scene are to be used, the Scenes and Groups clusters must also be enabled - see Chapter 13 and Chapter 12.

  • eStartUpOnOff is an optional attribute that is used in the lighting domain to define the required start-up behavior of a light device when it is supplied with power. It determines the initial value of bOnOff on start-up. The possible values and behaviors are as follows:

eStartUpOnOff

Behavior

0x00

Put the light in the off state - set bOnOff to FALSE

0x01

Put the light in the on state - set bOnOff to TRUE

0x02

Toggle the light from its previous state:

  • If bOnOff was FALSE, set it to TRUE

  • If bOnOff was TRUE, set it to FALSE

| |0x03-0xFE|Reserved| |0xFF|Put the light in its previous state - set bOnOff to its previous value|

  • u8AttributeReportingStatus is an optional attribute that should be enabled when attribute reporting is used for the cluster (see Section 2.3.5). The value of this attribute indicates whether there are attribute reports still pending (0x00) or the attribute reports are complete (0x01) - all other values are reserved. This attribute is also described in Section 2.4.

  • u16ClusterRevision is a mandatory attribute that specifies the revision of the cluster specification on which this cluster instance is based. The cluster specification in the ZCL r6 corresponds to a cluster revision of 1. The value is incremented by one for each subsequent revision of the cluster specification. This attribute is also described in Section 2.4.

Parent topic:On/Off Cluster

Attributes for Default Reporting

The following attribute of the On/Off cluster can be selected for default reporting:

  • bOnOff

Attribute reporting (including default reporting) is described in Appendix B. Enabling reports for this attribute is described in Appendix B.3.6.

Parent topic:On/Off Cluster

Initialization

The function         eCLD_OnOffCreateOnOff() is used to create an instance of the On/Off cluster. The function is called by the initialization function for the host device.

Note: If the global scene is to be used to remember light settings, then. Scenes and Groups cluster instances must be created - see Chapter 13 and Chapter 12.

Parent topic:On/Off Cluster

Sending Commands

The NXP implementation of the ZCL provides functions for sending commands between an On/Off cluster client and server. A command is sent from the client to one or more endpoints on the server. Multiple endpoints can usually be targeted using binding or group addressing.

Switching On and Off

A remote device (supporting the On/Off cluster server) can be switched on, switched off or, toggled between the on and off states by calling the function eCLD_OnOffCommandSend() on a cluster client. In the case of a toggle, if the device is initially in the on state it is switched off and if the device is initially in the off state it is switched on.

Timeout on the ‘On’ Command

On receiving an ‘On’ command, a timeout is applied such that the ‘on’ state is maintained for a specified duration before automatically switching to the ‘off’ state. This timeout is defined using the optional attributes u16OnConfigurableDurationand eDurationUnitOfMeasurement. The timeout duration in seconds is given by:

u16OnConfigurableDuration * 10^(power from eDurationUnitOfMeasurement)

The attribute u16OnConfigurableDuration can be set locally or remotely, while the attribute eDurationUnitOfMeasurement must be set locally. A maximum timeout duration can be defined locally via the optional attribute u16MaxDuration, which puts an upper limit on the value of u16OnConfigurableDuration.

The attribute u16OnConfigurableDuration can be set remotely using the eZCL_SendWriteAttributesRequest() function. On receiving this write request, the local ZCL checks that the requested duration is within the permissible range (see Section 2.3.3.1) - if the request exceeds the maximum permitted value, the timeout duration is clipped to this maximum.

For full details of the above attributes, refer to Section 14.2.

When an ‘On’ command is received, an E_ZCL_CBET_CLUSTER_CUSTOM event is generated. The application is responsible for implementing the timeout described above, if it is enabled. First, the application must check the attributes u16OnConfigurableDuration and eDurationUnitOfMeasurement to make sure they have valid values. If so, the application must start a timer to implement the timeout for the duration defined by these attributes. On expiration of the timer, the application must switch from the ‘on’ state to the ‘off’ state by (locally) writing to the bOnOff attribute.

Parent topic:Switching On and Off

On/Off with Transition Effect

If the Level Control cluster (see Chapter 16) is also used on the target device, an ‘On’ or ‘Off’ command can be implemented with a transition effect, as follows:

  • If the optional Level Control ‘On Transition Time’ attribute is enabled, an ‘On’ command results in a gradual transition. This transition is from the ‘off’ level to the ‘on’ level over the time-interval specified by the attribute.

  • If the optional Level Control ‘Off Transition Time’ attribute is enabled, an ‘Off’ command results in a gradual transition from the ‘on’ level to the ‘off’ level over the time-interval specified by the attribute.

Parent topic:Switching On and Off

Parent topic:Sending Commands

Switching Off Lights with Effect

In the case of lighting, lights can be (remotely) switched off with an effect by calling the function eCLD_OnOffCommandOffWithEffectSend() on an On/Off cluster client.

Two ‘off effects’ are available and there are variants of each effect:

  • Fade, with the following variants:

    • Fade to off in 0.8 seconds (default)

    • Reduce brightness by 50 % in 0.8 seconds then fade to off in 4 seconds

    • No fade

  • Rise and fall, with (currently) only one variant:

    • Increase brightness by 20 % (if possible) in 0.5 seconds then fade to off in 1 second (default)

Parent topic:Sending Commands

Switching On Timed Lights

In the case of lighting, lights can be switched on temporarily and automatically switched off at the end of a timed period. This kind of switch-on can be initiated remotely using the function CLD_OnOffCommandOnWithTimedOffSend() on an On/Off cluster client. In addition, a waiting time can be implemented after the automatic switch-off, during which the lights cannot be switched on again using the above function (although a normal switch-on is possible).

The following values must be specified:

  • Time for which the lights remain on (in tenths of a second)

  • Waiting time following the automatic switch-off (in tenths of a second)

In addition, the circumstances in which the command can be accepted must be specified - that is, accepted at any time (except during the waiting time) or only when the lights are already on. The latter case can be used to initiate a timed switch-off.

Parent topic:Sending Commands

Parent topic:On/Off Cluster

Saving Light Settings

In the case of lighting, the current light (attribute) settings can be automatically saved to a ‘global scene’ when switching off the lights using the function eCLD_OnOffCommandOffWithEffectSend(). If the lights are, then switched on with the E_CLD_ONOFF_CMD_ON_RECALL_GLOBAL_SCENE option in eCLD_OnOffCommandSend(), the saved light settings are reloaded. In this way, the system remembers the last light settings used before switch-off and resumes with these settings at the next switch-on. This feature is useful when the light levels are adjustable using the Level Control cluster (Chapter 16) and/or the light colours are adjustable using the Colour Control cluster (Chapter 31).

The attribute values corresponding to the current light settings are saved (locally) to a global scene with scene ID and group ID both equal to zero. Therefore, to use this feature:

  • Scenes cluster must be enabled and a cluster instance created

  • Groups cluster must be enabled and a cluster instance created

  • Optional On/Off cluster attribute bGlobalSceneControl must be enabled

The above attribute is a boolean which determines whether to permit the current light settings to be saved to the global scene. The attribute is set to FALSE after a switch-off using the function eCLD_OnOffCommandOffWithEffectSend(). It is set to TRUE after a switch-on or a change in the light settings (attributes) - more specifically, after a change resulting from a Level Control cluster ‘Move to Level with On/Off’ command, from a Scenes cluster ‘Recall Scene’ command, or from an On/Off cluster ‘On’ command or ‘On With Recall Global Scene’ command.

Parent topic:On/Off Cluster

Functions

The following On/Off cluster functions are provided in the NXP implementation of the ZCL:

  1. eCLD_OnOffCreateOnOff

  2. _OnOffCommandSend

  3. eCLD_OnOffCommandOffWithEffectSend

  4. eCLD_OnOffCommandOnWithTimedOffSend

eCLD_OnOffCreateOnOff

teZCL_Status eCLD_OnOffCreateOnOff(
    tsZCL_ClusterInstance *psClusterInstance,
    bool_t bIsServer,
    tsZCL_ClusterDefinition *psClusterDefinition,
    void *pvEndPointSharedStructPtr,
    uint8 *pu8AttributeControlBits,
    tsCLD_OnOffCustomDataStructure
*psCustomDataStructure);

Description

This function creates an instance of the On/Off cluster on an endpoint. The cluster instance is created on the endpoint which is associated with the supplied tsZCL_ClusterInstance structure and can act as a server or a client, as specified.

The function must be called when setting up a custom endpoint containing one or more selected clusters (rather than the whole set of clusters supported by a standard ZigBee device). This function creates an On/Off cluster instance on the endpoint, but instances of other clusters may also be created on the same endpoint by calling their corresponding creation functions.

Note: Do not call this function for an endpoint on which a standard ZigBee device is used. In this case, the device and its supported clusters must be registered on the endpoint using the relevant device registration function.

When used, this function must be the first On/Off cluster function called in the application, and must be called after the stack has been started and after the ZCL has been initialized.

The function requires an array to be declared for internal use, which contains one element (of type uint8) for each attribute of the cluster. The array length should therefore equate to the total number of attributes supported by the On/Off cluster. The function initialises the array elements to zero.

Parameters

  • psClusterInstance: Pointer to structure containing information about the cluster instance to be created (see Section 6.1.16). This structure is updated by the function by initialising individual structure fields.

  • bIsServer: Type of cluster instance (server or client) to be created:

    • TRUE - server

    • FALSE - client

  • psClusterDefinition: Pointer to structure indicating the type of cluster to be created (see Section 6.1.2). In this case, this structure must contain the details of the On/Off cluster. This parameter can refer to a pre-filled structure called sCLD_OnOff which is provided in the OnOff.h file.

  • pvEndPointSharedStructPtr: Pointer to the shared structure used for attribute storage. This parameter should be the address of the structure of type tsCLD_OnOff which defines the attributes of On/Off cluster. The function initialises the attributes with default values.

  • pu8AttributeControlBits: Pointer to an array of uint8 values, with one element for each attribute in the cluster (see above)

  • psCustomDataStructure: Pointer to a structure containing the storage for internal functions of the cluster (see Section 14.8.1)

Returns

  • E_ZCL_SUCCESS

  • E_ZCL_ERR_PARAMETER_NULL

Parent topic:Functions

eCLD_OnOffCommandSend

teZCL_Status eCLD_OnOffCommandSend(
    uint8 u8SourceEndPointId,
    uint8 u8DestinationEndPointId,
    tsZCL_Address *psDestinationAddress,
    uint8 *pu8TransactionSequenceNumber,
    teCLD_OnOff_Command eCommand);

Description

This function sends a custom command instructing the target device to perform the specified operation on itself: switch off, switch on, toggle (on-to-off or off-to-on), or switch on with settings retrieved from the global scene, This last option (On with Recall Global Scene) is described in Section 14.6 and, if used, must be enabled in the compile-time options on the server (target), as indicated in Section 14.10.

The device receiving this message generates a callback event on the endpoint on which the On/Off cluster was registered.

If the Level Control cluster (see Chapter 16) is also used on the target device, an ‘On’ or ‘Off’ command can be implemented with a transition effect, as follows:

  • If the optional Level Control ‘On Transition Time’ attribute is enabled, an ‘On’ command results in a gradual transition. This transition is from the ‘off’ level to the ‘on’ level over the time-interval specified in the attribute.

  • If the optional Level Control ‘Off Transition Time’ attribute is enabled, an ‘Off’ command results in a gradual transition from the ‘on’ level to the ‘off’ level over the time-interval specified in the attribute.

Parameters

  • u8SourceEndPointId: Number of the local endpoint through which to send the request. This parameter is used both to send the message and to identify the instance of the shared structure holding the required attribute values.

  • u8DestinationEndPointId: Number of the endpoint on the remote node to which the request is sent. This parameter is ignored when sending to address types eZCL_AMBOUND and eZCL_AMGROUP

  • psDestinationAddress: Pointer to a structure holding the address of the node to which the request is sent

  • pu8TransactionSequenceNumber: Pointer to a location to receive the Transaction Sequence Number (TSN) of the request

  • eCommand: Command code, one of the following:

    • E_CLD_ONOFF_CMD_OFF

    • E_CLD_ONOFF_CMD_ON

    • E_CLD_ONOFF_CMD_TOGGLE

    • E_CLD_ONOFF_CMD_ON_RECALL_GLOBAL_SCENE

    • E_CLD_ONOFF_CMD_TOGGLE

Returns

  • E_ZCL_SUCCESS

  • E_ZCL_ERR_PARAMETER_NULL

  • E_ZCL_ERR_EP_RANGE

  • E_ZCL_ERR_EP_UNKNOWN

  • E_ZCL_ERR_CLUSTER_NOT_FOUND

  • E_ZCL_ERR_ZBUFFER_FAIL

  • E_ZCL_ERR_ZTRANSMIT_FAIL

If an error is returned by the ZigBee PRO stack function which is invoked by this function to transmit the data, this error may be obtained by calling eZCL_GetLastZpsError().

Parent topic:Functions

eCLD_OnOffCommandOffWithEffectSend

teZCL_Status eCLD_OnOffCommandOffWithEffectSend(
    uint8 u8SourceEndPointId,
    uint8 u8DestinationEndPointId,
    tsZCL_Address *psDestinationAddress,
    uint8 *pu8TransactionSequenceNumber,
    tsCLD_OnOff_OffWithEffectRequestPayload *psPayload);

Description

This function sends a custom ‘Off With Effect’ command instructing the target lighting device to switch off one or more lights with the specified effect, which can be one of:

  • fade (in two phases or no fade)

  • rise and fall

Each of these effects is available in variants. The required effect and variant are specified in the command payload. For the payload details, refer to “Off With Effect Request Payload “.

The device receiving this message generates a callback event on the endpoint on which the On/Off cluster was registered.

Following a call to this function, the light settings on the target device are saved to a global scene, after which the attribute bGlobalSceneControl is set to FALSE - for more details, refer to Section 14.6.

If used, the ‘Off With Effect’ command must be enabled in the compile-time options on both the client and server, as described in Section 14.10.

Parameters

  • u8SourceEndPointId: Number of the local endpoint through which to send the request. This parameter is used both to send the message and to identify the instance of the shared structure holding the required attribute values.

  • u8DestinationEndPointId: Number of the endpoint on the remote node to which the request is sent. This parameter is ignored when sending to address types eZCL_AMBOUND and eZCL_AMGROUP.

  • psDestinationAddress: Pointer to a structure holding the address of the node to which the request is sent.

  • pu8TransactionSequenceNumber: Pointer to a location to receive the Transaction Sequence Number (TSN) of the request.

  • psPayload: Pointer to a structure containing the payload for this message (see Section 14.8.2).

Returns

  • E_ZCL_SUCCESS

  • E_ZCL_ERR_PARAMETER_NULL

  • E_ZCL_ERR_EP_RANGE

  • E_ZCL_ERR_EP_UNKNOWN

  • E_ZCL_ERR_CLUSTER_NOT_FOUND

  • E_ZCL_ERR_ZBUFFER_FAIL

  • E_ZCL_ERR_ZTRANSMIT_FAIL

If an error is returned by the ZigBee PRO stack function which is invoked by this function to transmit the data, this error may be obtained by calling eZCL_GetLastZpsError().

Parent topic:Functions

eCLD_OnOffCommandOnWithTimedOffSend

teZCL_Status eCLD_OnOffCommandOnWithTimedOffSend(
    uint8 u8SourceEndPointId,
    uint8 u8DestinationEndPointId,
    tsZCL_Address *psDestinationAddress,
    uint8 *pu8TransactionSequenceNumber,
    tsCLD_OnOff_OnWithTimedOffRequestPayload
    *psPayload);

Description

This function sends a custom ‘On With Timed Off’ command instructing the target lighting device to switch on one or more lights for a timed period and then switch them off. In addition, a waiting time can be implemented after switch-off, during which the lights cannot be switched on again.

The following functionality must be specified in the command payload:

  • Time for which the lights must remain on.

  • Waiting time during which switched-off lights cannot be switched on again.

  • Whether this command can be accepted at any time (outside the waiting time) or only when a light is on.

For the payload details, refer to “On With Timed Off Request Payload”.

The device receiving this message generates a callback event on the endpoint on which the On/Off cluster was registered.

If used, the ‘On With Timed Off’ command must be enabled in the compile-time options on both the client and server, as described in Section 14.10.

Parameters

  • u8SourceEndPointId: Number of the local endpoint through which to send the request. This parameter is used both to send the message and to identify the instance of the shared structure holding the required attribute values.

  • u8DestinationEndPointId: Number of the endpoint on the remote node to which the request is sent. This parameter is ignored when sending to address types eZCL_AMBOUND and eZCL_AMGROUP.

  • psDestinationAddress: Pointer to a structure holding the address of the node to which the request is sent.

  • pu8TransactionSequenceNumber: Pointer to a location to receive the Transaction Sequence Number (TSN) of the request.

  • psPayload: Pointer to a structure containing the payload for this message (see Section 14.8.2).

Returns

  • E_ZCL_SUCCESS

  • E_ZCL_ERR_PARAMETER_NULL

  • E_ZCL_ERR_EP_RANGE

  • E_ZCL_ERR_EP_UNKNOWN

  • E_ZCL_ERR_CLUSTER_NOT_FOUND

  • E_ZCL_ERR_ZBUFFER_FAIL

  • E_ZCL_ERR_ZTRANSMIT_FAIL

If an error is returned by the ZigBee PRO stack function which is invoked by this function to transmit the data, this error may be obtained by calling eZCL_GetLastZpsError().

Parent topic:Functions

Parent topic:On/Off Cluster

Structures

Custom Data Structure

The On/Off cluster requires extra storage space to be allocated to be used by internal functions. The structure definition for this storage is shown below:

typedef struct
{
    uint8     u8Dummy;
} tsCLD_OnOffCustomDataStructure;

The fields are for internal use and no knowledge of them required.

Parent topic:Structures

Custom Command Payloads

Off With Effect Request Payload

typedef struct
{
    zuint8                 u8EffectId;
    zuint8                 u8EffectVariant;
} tsCLD_OnOff_OffWithEffectRequestPayload;

where:

  • u8EffectId indicates the required ‘off effect’:

    • 0x00 - Fade

    • 0x01 - Rise and fall

      • All other values are reserved.

  • u8EffectVariant indicates the required variant of the specified ‘off effect’ - the interpretation of this field depends on the value of u8EffectId, as indicated in the table below.

u8EffectId

u8EffectVariant

Description

0x00
(Fade)

0x00

Fade to off in 0.8 seconds (default)

0x01

No fade

0x02

Reduce brightness by 50 % in 0.8 seconds then fade to off in 4 seconds

0x03-0xFF

Reserved

0x01
(Rise and fall)

0x00

Increase brightness by 20 % (if possible) in 0.5 seconds then fade to off in 1 second (default)

0x01-0xFF

Reserved

0x02-0xFF

0x00-0xFF

Reserved

On With Timed Off Request Payload

typedef struct
{
    zuint8                 u8OnOff;
    zuint16                u16OnTime;
    zuint16                u16OffTime;
} tsCLD_OnOff_OnWithTimedOffRequestPayload;

where:

  • u8OnOff indicates when the command can be accepted:

    • 0x00 - at all times (apart from in waiting time, if implemented)

    • 0x01 - only when light is on

      • All other values are reserved.

  • u16OnTime is the ‘on time’, expressed in tenths of a second in the range 0x0000 to 0xFFFE.

  • u16OffTime is the ‘off waiting time’, expressed in tenths of a second in the range 0x0000 to 0xFFFE

Parent topic:Structures

Parent topic:On/Off Cluster

Enumerations

teCLD_OnOff_ClusterID

The following structure contains the enumerations used to identify the attributes of the On/Off cluster.

typedef enum 
{
    E_CLD_ONOFF_ATTR_ID_ONOFF                           = 0x0000,
    E_CLD_ONOFF_ATTR_ID_GLOBAL_SCENE_CONTROL            = 0x4000,
    E_CLD_ONOFF_ATTR_ID_ON_TIME,          
    E_CLD_ONOFF_ATTR_ID_OFF_WAIT_TIME,  
    #ifdef CLD_ONOFF_ATTR_STARTUP_ONOFF
    /* ZLO extension for OnOff Cluster    */             
    E_CLD_ONOFF_ATTR_ID_STARTUP_ONOFF,                         
    #endif
} teCLD_OnOff_ClusterID;  

Parent topic:Enumerations

teCLD_OOSC_SwitchType (On/Off Switch Types)

typedef enum 
{
    E_CLD_OOSC_TYPE_TOGGLE,
    E_CLD_OOSC_TYPE_MOMENTARY
} teCLD_OOSC_SwitchType;

Parent topic:Enumerations

teCLD_OOSC_SwitchAction (On/Off Switch Actions)

typedef enum 
{
    E_CLD_OOSC_ACTION_S2ON_S1OFF,
    E_CLD_OOSC_ACTION_S2OFF_S1ON,
    E_CLD_OOSC_ACTION_TOGGLE
} teCLD_OOSC_SwitchAction;

Parent topic:Enumerations

Parent topic:On/Off Cluster

Compile-time options

  • To enable the On/Off cluster in the code to be built, it is necessary to add the following to the zcl_options.h file:

    #define CLD_ONOFF
    
    
  • In addition, to include the software for a cluster client or server or both, it is necessary to add one or both of the following to the same file:

    #define ONOFF_CLIENT
    #define ONOFF_SERVER
    
    
  • The On/Off cluster contains macros that may be optionally specified at compile time by adding some or all of the following lines to the zcl_options.h file.

Optional Attributes

  1. To enable the optional On Configurable Duration attribute, add this line:

    #define CLD_ONOFF_ATTR_ID_ON_CONFIGURABLE_DURATION
    
  2. To enable the optional Duration Unit of Measure attribute, add this line:

    #define CLD_ONOFF_ATTR_ID_DURATION_UNIT_OF_MEASUREMENT
    
    
  3. To enable the optional Maximum Duration attribute, add this line:

    #define CLD_ONOFF_ATTR_ID_MAX_DURATION
    
    
  4. To enable the optional Global Scene Control attribute, add this line:

    #define CLD_ONOFF_ATTR_GLOBAL_SCENE_CONTROL
    
    
  5. To enable the optional On Time attribute, add this line:

    #define CLD_ONOFF_ATTR_ON_TIME
    
    
  6. To enable the optional Off Wait Time attribute, add this line:

    #define CLD_ONOFF_ATTR_OFF_WAIT_TIME
    
    
  7. To enable the optional Start-up On/Off attribute, add this line:

    #define CLD_ONOFF_ATTR_STARTUP_ONOFF
    
    
  8. To enable the optional Attribute Reporting Status attribute, add this line:

    #define CLD_ONOFF_ATTR_ID_ATTRIBUTE_REPORTING_STATUS
    
    

Optional Commands

  1. Add this line to enable processing of the On With Recall Global Scene command on the server:

    #define CLD_ONOFF_CMD_ON_WITH_RECALL_GLOBAL_SCENE
    
  2. Add this line to enable the optional On With Timed Off command on the client and server:

    #define CLD_ONOFF_CMD_ON_WITH_TIMED_OFF
    
  3. Add this line to enable the optional Off With Effect command on the client and server:

    #define CLD_ONOFF_CMD_OFF_WITH_EFFECT
    

Cluster Revision

To define the value (n) of the Cluster Revision attribute, add this line:

#define CLD_ONOFF_CLUSTER_REVISION <n>

The default value is 1, which corresponds to the revision of the cluster in the ZCL r6 specification (see Section 2.4).

Parent topic:On/Off Cluster