Scenes Usage Guide
Firmware Usage Guide
about
In IoT and ESP RainMaker, a scene is a predefined set of parameter values across multiple devices, activated via phone apps, voice assistants, or schedules. Scenes enable seamless automation, allowing users to trigger multiple actions with one command, enhancing convenience and efficiency. Implemented entirely on the node as a service, they simplify control while the cloud acts as a gateway.
Examples include an “Evening” scene that adjusts lighting or a “Night” scene that dims lights and activates cooling. By optimizing energy use, scenes offer a practical and cost-effective IoT solution.
Usage Guide
Enable Scenes
The ESP RainMaker exposes a single API to enable scenes:
esp_err_t esp_rmaker_scenes_enable(void);
important
This API should be called after esp_rmaker_node_init()
but before esp_rmaker_start()
.
- The maximum number of scenes supported can be configured by using
CONFIG_ESP_RMAKER_SCENES_MAX_SCENES
config option. - You can find this in
idf.py menuconfig
according to the steps below:
- Deactivation support can be enabled by setting:
CONFIG_ESP_RMAKER_SCENES_DEACTIVATE_SUPPORT=y
- This is kept disabled by default because deactivating a scene would require saving the previous values of params and then restoring them to those values, which could be complex and can also lead to inconsistent behavior.
- The RainMaker core does not do this even if the support is enabled.
- It will just invoke the appropriate service write callback whenever a deactivation request is received.
- Saving/restoring the values will have to be managed by the application registered callback.