Sending Remote Commands
The NXP implementation of the ZCL provides functions for sending commands between a Scenes 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.
Note: Commands can also be issued for operations on the local node, as described in Section 13.5.
Creating a Scene
In order to create a scene, add an entry for the scene to the Scene table on every device that contains a cluster, which is associated with the scene.
Use the function eCLD_ScenesCommandAddSceneRequestSend() to request a scene to be added to a Scene table on a remote device. Invoking this function sends a request to a single device or to multiple devices (using binding or group addressing). The fields of the Scene table entry are specified in the payload of the request.
Alternatively:
The function eCLD_ScenesCommandEnhancedAddSceneRequestSend() can be used to request that a scene is added to a Scene table on a remote device. This method allows the transition time for the scene to be set in units of tenths of a second (rather than seconds).
A scene can be created by saving the current attribute settings of the relevant clusters. In this way, the current state of the system can be captured as a scene and reapplied ‘at the touch of a button’ when required. For example scenes can be created for lighting levels in a ‘smart lighting’ system. The current settings are stored as a scene in the Scene table using eCLD_ScenesCommandStoreSceneRequestSend(). This function can send the request to a single device or multiple devices. If a Scene table entry exists with the same scene ID and group ID, the existing cluster settings in the entry are overwritten with the new ‘captured’ settings.
Note: This operation of capturing the current system state as a scene does not result in meaningful settings for the transition time and scene name fields of the Scene table entry. If non-null values are required for these fields, the table entry should be created in advance with the desired field values using eCLD_ScenesCommandAddSceneRequestSend().
Parent topic:Sending Remote Commands
Copying a Scene
Scene settings can be copied from one scene to another scene on the same remote endpoint using the eCLD_ScenesCommandCopySceneSceneRequestSend() function. This function allows the settings from an existing scene with a specified source scene ID and associated group ID to be copied to a new scene with a specified destination scene ID and associated group ID.
Note: If an entry corresponding to the target scene ID and group ID exists in the Scene table on the endpoint, the entry settings are overwritten with the copied settings. Otherwise, a new Scene table entry is created with these settings.
The above function also allows all scenes associated with particular group ID to be copied to another group ID. In this case, the original scene IDs are maintained but are associated with the new group ID (any specified source and destination scene IDs are ignored). Thus, the same scene IDs are associated with two different group IDs.
Parent topic:Sending Remote Commands
Applying a Scene
The cluster settings of a scene stored in the Scene table can be retrieved and applied to the system by calling eCLD_ScenesCommandRecallSceneRequestSend(). Again, this function can send a request to a single device or to multiple devices (using binding or group addressing).
If the required scene does not contain any settings for a particular cluster or there are some missing attribute values for a cluster, these attribute values remain unchanged in the implementation of the cluster - that is, the corresponding parts of the system do not change their states.
Parent topic:Sending Remote Commands
Deleting a Scene
Two functions are provided for removing scenes from the system:
eCLD_ScenesCommandRemoveSceneRequestSend() can be used to request the removal of the destination endpoint from a particular scene - that is, to remove the scene from the Scene table on the target device.
eCLD_ScenesCommandRemoveAllScenesRequestSend() can be used to request that the target device removes scenes associated with a particular group ID/address - that is, remove all Scene table entries relating to this group ID. Specifying a group ID of 0x0000 removes all scenes not associated with a group.
Parent topic:Sending Remote Commands
Obtaining Information about Scenes
The following functions are provided for obtaining information about scenes:
eCLD_ScenesCommandViewSceneRequestSend() can be used to request information on a particular scene on the destination endpoint. Only one device may be targeted by this function. The target device returns a response containing the relevant information.
Alternatively, eCLD_ScenesCommandEnhancedViewSceneRequestSend() can be used, which allows the transition time for the scene to be obtained in units of tenths of a second (rather than seconds).
eCLD_ScenesCommandGetSceneMembershipRequestSend() can be used to discover which scenes are associated with a particular group on a device. The request can be sent to a single device or to multiple devices. The target device returns a response containing the relevant information (in the case of multiple target devices, no response is returned from a device that does not contain a scene associated with the specified group ID). In this way, the function can be used to determine the unused scene IDs.
Parent topic:Sending Remote Commands
Parent topic:Scenes Cluster