Welcome!
Scene Scripting enables programmable logic within automation workflows. It extends standard scene capabilities by supporting dynamic behaviors, runtime condition evaluation, device state management, and multi-device orchestration.
This documentation covers script architecture, device interaction, and implementation practices for advanced automation scenarios.
The scripting transforms the scenes from static configurations into flexible, programmable automation units that can adapt to a wide range of scenarios.
All Scene Scripts are written in JavaScript, allowing you to use familiar syntax and logic structures to build powerful automations.
Example
The following script demonstrates the basic structure of a Scene Script. It triggers once when a specific device turns ON and logs a message to the console.
var light = Shelly.getDevice("x"); // Replace "x" with your Device ID
light.setTriggerOnce("on");
Shelly.sendPhoneStandardNotification("Hello World! The light has been turned on.");
To deploy this:
- Open the Script Editor.
- Create a new Custom Script.
- Map your device ID to the
lightvariable. - Save and Start the script.