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#

emberAfScenesSetSceneCountAttribute(uint8_t endpoint, uint8_t newCount)
emberAfScenesMakeValid(uint8_t endpoint, uint8_t sceneId, uint16_t groupId)
bool
emberAfPluginScenesServerParseAddScene(const EmberAfClusterCommand *cmd, uint16_t groupId, uint8_t sceneId, uint16_t transitionTime, uint8_t *sceneName, uint8_t *extensionFieldSets)
bool
emberAfPluginScenesServerParseViewScene(const EmberAfClusterCommand *cmd, uint16_t groupId, uint8_t sceneId)
bool
emberAfPluginScenesServerCustomRecallSceneCallback(const EmberAfSceneTableEntry *const sceneEntry, uint16_t transitionTimeDs, EmberAfStatus *const status)

Scenes Server Custom Recall Scene.

Variable Documentation#

emberAfPluginScenesServerEntriesInUse#

uint8_t emberAfPluginScenesServerEntriesInUse

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

emberAfPluginScenesServerSceneTable#

EmberAfSceneTableEntry emberAfPluginScenesServerSceneTable[]

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

Function Documentation#

emberAfScenesSetSceneCountAttribute#

EmberAfStatus emberAfScenesSetSceneCountAttribute (uint8_t endpoint, uint8_t newCount)
Parameters
N/Aendpoint
N/AnewCount

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

emberAfScenesMakeValid#

EmberAfStatus emberAfScenesMakeValid (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

emberAfPluginScenesServerParseAddScene#

bool emberAfPluginScenesServerParseAddScene (const EmberAfClusterCommand *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

emberAfPluginScenesServerParseViewScene#

bool emberAfPluginScenesServerParseViewScene (const EmberAfClusterCommand *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

emberAfPluginScenesServerCustomRecallSceneCallback#

bool emberAfPluginScenesServerCustomRecallSceneCallback (const EmberAfSceneTableEntry *const sceneEntry, uint16_t transitionTimeDs, EmberAfStatus *const status)

Scenes Server Custom Recall Scene.

Parameters
N/AsceneEntry

pointer to EmberAfSceneTableEntry for recalled scene Ver.: always

N/AtransitionTimeDs

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

N/Astatus

pointer to return EmberAfStatus 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 EmberAfStatus value has been written to the status argument. Status will be EMBER_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#

emberAfScenesMakeInvalid#

#define emberAfScenesMakeInvalid
Value:
emberAfScenesClusterMakeInvalidCallback

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

emberAfPluginScenesServerRetrieveSceneEntry#

#define emberAfPluginScenesServerRetrieveSceneEntry
Value:
(entry, i)

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

emberAfPluginScenesServerSaveSceneEntry#

#define emberAfPluginScenesServerSaveSceneEntry
Value:
(entry, i)

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

emberAfPluginScenesServerNumSceneEntriesInUse#

#define emberAfPluginScenesServerNumSceneEntriesInUse
Value:
()

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

emberAfPluginScenesServerSetNumSceneEntriesInUse#

#define emberAfPluginScenesServerSetNumSceneEntriesInUse
Value:
(x)

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

emberAfPluginScenesServerIncrNumSceneEntriesInUse#

#define emberAfPluginScenesServerIncrNumSceneEntriesInUse
Value:
()

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

emberAfPluginScenesServerDecrNumSceneEntriesInUse#

#define emberAfPluginScenesServerDecrNumSceneEntriesInUse
Value:
()

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