Scenes Server#

API and Callbacks for the Scenes Cluster Server Component.

Silicon Labs implementation of the Scenes server cluster. This component supports commands for setting up and recalling scenes. Scenes are stored in a table and each scene consists of a set of values for attributes in other clusters. Clusters that extend the scene table do so through extension field sets. This component supports extensions for the On/Off, Level Control, Thermostat, Color Control, Door Lock, and Window Covering clusters. If the application includes any of these clusters, the component automatically includes and manages the attributes in those clusters. For example, if the application includes the On/Off server cluster, the component saves and recalls the On/Off attribute as part of saving or recalling scenes. Some ZLL extensions are implemented in this component and will be included automatically for ZLL applications. If the ZLL Scenes server cluster component is also enabled, this component uses it for handling some additional ZLL enhancements. Otherwise, these ZLL extensions are disabled. This component requires extending in order to interact with the actual hardware.

Functions#

sl_zigbee_af_scenes_make_valid(uint8_t endpoint, uint8_t sceneId, uint16_t groupId)
bool
sl_zigbee_af_scenes_server_parse_add_scene(const sl_zigbee_af_cluster_command_t *cmd, uint16_t groupId, uint8_t sceneId, uint16_t transitionTime, uint8_t *sceneName, uint8_t *extensionFieldSets)
bool
sl_zigbee_af_scenes_server_parse_view_scene(const sl_zigbee_af_cluster_command_t *cmd, uint16_t groupId, uint8_t sceneId)
bool
sl_zigbee_af_scenes_server_custom_recall_scene_cb(const sl_zigbee_af_scene_table_entry_t *const sceneEntry, uint16_t transitionTimeDs, sl_zigbee_af_status_t *const status)

Scenes Server Custom Recall Scene.

Variable Documentation#

sl_zigbee_af_scenes_server_entries_in_use#

uint8_t sl_zigbee_af_scenes_server_entries_in_use

Definition at line 65 of file app/framework/plugin/scenes/scenes.h

sl_zigbee_af_scenes_server_scene_table#

sl_zigbee_af_scene_table_entry_t sl_zigbee_af_scenes_server_scene_table[]

Definition at line 88 of file app/framework/plugin/scenes/scenes.h

Function Documentation#

sl_zigbee_af_scenes_set_scene_count_attribute#

sl_zigbee_af_status_t sl_zigbee_af_scenes_set_scene_count_attribute (uint8_t endpoint, uint8_t newCount)
Parameters
N/Aendpoint
N/AnewCount

Definition at line 56 of file app/framework/plugin/scenes/scenes.h

sl_zigbee_af_scenes_make_valid#

sl_zigbee_af_status_t sl_zigbee_af_scenes_make_valid (uint8_t endpoint, uint8_t sceneId, uint16_t groupId)
Parameters
N/Aendpoint
N/AsceneId
N/AgroupId

Definition at line 58 of file app/framework/plugin/scenes/scenes.h

sl_zigbee_af_scenes_server_parse_add_scene#

bool sl_zigbee_af_scenes_server_parse_add_scene (const sl_zigbee_af_cluster_command_t * cmd, uint16_t groupId, uint8_t sceneId, uint16_t transitionTime, uint8_t * sceneName, uint8_t * extensionFieldSets)
Parameters
N/Acmd
N/AgroupId
N/AsceneId
N/AtransitionTime
N/AsceneName
N/AextensionFieldSets

Definition at line 103 of file app/framework/plugin/scenes/scenes.h

sl_zigbee_af_scenes_server_parse_view_scene#

bool sl_zigbee_af_scenes_server_parse_view_scene (const sl_zigbee_af_cluster_command_t * cmd, uint16_t groupId, uint8_t sceneId)
Parameters
N/Acmd
N/AgroupId
N/AsceneId

Definition at line 109 of file app/framework/plugin/scenes/scenes.h

sl_zigbee_af_scenes_server_custom_recall_scene_cb#

bool sl_zigbee_af_scenes_server_custom_recall_scene_cb (const sl_zigbee_af_scene_table_entry_t *const sceneEntry, uint16_t transitionTimeDs, sl_zigbee_af_status_t *const status)

Scenes Server Custom Recall Scene.

Parameters
N/AsceneEntry

pointer to sl_zigbee_af_scene_table_entry_t for recalled scene Ver.: always

N/AtransitionTimeDs

transition time in deci-seconds (1/10 sec) Ver.: always

N/Astatus

pointer to return sl_zigbee_af_status_t Ver.: always

Customize the implementation of the Scenes cluster RecallScene command for desired behavior when gradually transitioning to the specified scene over the specified transition time interval.

Upon entry to this callback, the presented scene table entry has been verified to be valid for the endpoint, group ID, and scene ID referenced in the received ZCL Scenes cluster RecallScene command.

NOTE: If this callback is implemented, the expectation is that it will INITIATE the scene transition behavior and return promptly with prospective success or failure status, rather than execute through the full duration of the transition time before returning.

NOTE: The scene table entry pointer, and the information in the scene table entry, are available only during the execution of this callback function. The scene table entry information (NOT the pointer) must be copied and saved before returning from this callback function if it will need to be referenced at other times to perform the desired transition behavior (for example, by a timer-based periodic handler launched by this callback).

If the value of transitionTimeDs is 0xFFFF, the transition time information configured in the scene table entry should be used.

Upon arriving at the target scene configuration, the custom implementation should set the Scenes cluster attributes CurrentScene and CurrentGroup to the scene ID and group ID values contained in the sceneEntry, and set the SceneValid attribute to true.

Returns true if a customization of this callback HAS been IMPLEMENTED. This REQUIRES that a valid sl_zigbee_af_status_t value has been written to the status argument. Status will be SL_ZIGBEE_ZCL_STATUS_SUCCESS if the scene transition has been initiated successfully, even though the transition time has not fully elapsed and the full effect of the scene transition over the transition time has not yet completed. Otherwise, a suitable error status value should be returned in the status argument.

Returns false if a customization of this callback HAS NOT been implemented. In this case, the Scenes plugin will perform default handling (apply target scene settings immediately without regard for the specified transition time).

Returns

  • true if custom callback is implemented false if custom callback is not implemented (apply default handling)


Definition at line 162 of file app/framework/plugin/scenes/scenes.h

Macro Definition Documentation#

sl_zigbee_af_scenes_make_invalid#

#define sl_zigbee_af_scenes_make_invalid
Value:
sl_zigbee_af_scenes_cluster_make_invalid_cb

Definition at line 63 of file app/framework/plugin/scenes/scenes.h

sl_zigbee_af_scenes_server_retrieve_scene_entry#

#define sl_zigbee_af_scenes_server_retrieve_scene_entry
Value:
(entry, i)

Definition at line 89 of file app/framework/plugin/scenes/scenes.h

sl_zigbee_af_scenes_server_save_scene_entry#

#define sl_zigbee_af_scenes_server_save_scene_entry
Value:
(entry, i)

Definition at line 91 of file app/framework/plugin/scenes/scenes.h

sl_zigbee_af_scenes_server_num_scene_entries_in_use#

#define sl_zigbee_af_scenes_server_num_scene_entries_in_use
Value:
()

Definition at line 93 of file app/framework/plugin/scenes/scenes.h

sl_zigbee_af_scenes_server_set_num_scene_entries_in_use#

#define sl_zigbee_af_scenes_server_set_num_scene_entries_in_use
Value:
(x)

Definition at line 95 of file app/framework/plugin/scenes/scenes.h

sl_zigbee_af_scenes_server_incr_num_scene_entries_in_use#

#define sl_zigbee_af_scenes_server_incr_num_scene_entries_in_use
Value:
()

Definition at line 97 of file app/framework/plugin/scenes/scenes.h

sl_zigbee_af_scenes_server_decr_num_scene_entries_in_use#

#define sl_zigbee_af_scenes_server_decr_num_scene_entries_in_use
Value:
()

Definition at line 99 of file app/framework/plugin/scenes/scenes.h