Skip to Content
🚀 We just launched! Please star us on Github!

Scenes

Scenes let you trigger multiple device actions with a single tap. For example, a “Movie Night” scene could dim the lights, close the blinds, and turn on the TV — all at once.


How Scenes Work

A scene is a named collection of actions. When you trigger a scene, the system executes each action in order. Actions can target any device property — turning things on/off, setting brightness levels, changing temperatures, and more.

Each scene has:

  • Name — a friendly label (e.g., “Good Morning”, “Away Mode”)
  • Category — an optional grouping like lighting, climate, media, security, or energy
  • Actions — the list of device commands to execute
  • Space — an optional room or zone the scene belongs to

Scene Categories

Scenes can be organized by category to make them easier to find:

CategoryUse Case
LightingControl lights across rooms
ClimateSet thermostats and HVAC
MediaControl speakers, TVs, and streaming
SecurityArm/disarm sensors and locks
EnergyOptimize power consumption
Morning / NightDaily routines
Work / Relax / Party / MovieActivity-based presets
Home / AwayPresence-based automation
Custom / GenericAnything else

Managing Scenes via the API

Scenes are managed through the REST API. You can create, update, delete, and trigger scenes programmatically.

Create a Scene

curl -X POST http://smart-panel.local:3000/api/scenes \ -H "Content-Type: application/json" \ -H "Authorization: Bearer <token>" \ -d '{ "data": { "name": "Movie Night", "category": "movie", "enabled": true, "actions": [ { "type": "local", "configuration": { "device_id": "<device-uuid>", "channel_id": "<channel-uuid>", "property_id": "<property-uuid>", "expected_value": false } } ] } }'

Trigger a Scene

curl -X POST http://smart-panel.local:3000/api/scenes/<scene-id>/trigger \ -H "Authorization: Bearer <token>" \ -H "Content-Type: application/json" \ -d '{ "data": { "source": "manual" } }'

List All Scenes

curl http://smart-panel.local:3000/api/scenes \ -H "Authorization: Bearer <token>"

Scene Actions

Each action within a scene targets a specific device property and sets it to an expected value. Actions execute sequentially in the order they are defined.

Actions can be managed separately:

  • GET /api/scenes/:id/actions — list actions for a scene
  • POST /api/scenes/:id/actions — add a new action
  • PATCH /api/scenes/:id/actions/:actionId — update an action
  • DELETE /api/scenes/:id/actions/:actionId — remove an action

Scene Execution

When a scene is triggered:

  1. The system verifies the scene is enabled and triggerable
  2. Actions are executed in order, targeting the specified device properties
  3. Each action’s result (success or failure) is tracked
  4. The scene’s last_triggered_at timestamp is updated

By default, scene execution continues even if an individual action fails. This ensures that one unresponsive device doesn’t block the rest of your scene.


Scene Properties

PropertyTypeDescription
namestringDisplay name (required)
categorystringScene category (e.g., lighting, movie, custom)
descriptionstringOptional description
enabledbooleanWhether the scene can be triggered (default: true)
triggerablebooleanWhether manual triggering is allowed (default: true)
editablebooleanWhether the scene can be modified (default: true)
ordernumberDisplay order in lists
primary_space_idUUIDOptional space (room/zone) association
💡

Some scenes created by plugins may have editable set to false, meaning they cannot be modified or deleted through the API.


What’s Next?

  • Explore the API Reference for the full scenes endpoint documentation
  • Learn how to organize devices into Spaces for better scene targeting
Last updated on