Working with Scenes
With Scenes you can simultaneously set a group of devices to a particular state.
Scenes are different from Automations. For example, an Automation can be configured to “Notify me if a door opens when I’m not home.” This Automation, when activated, will wait for the door to open when you are not home to notify you.
On the other hand a scene can be configured as “Turn on my living room light, turn off my bedroom light, turn on my kitchen light, and set the brightness level and pick this color,” and this scene will set these devices instantly as soon as the scene is activated.
Scenes do not have triggers; Automations do. Moreover, a scene can be used as a part of an Automation. See Scenes in the SmartThings app.
Interaction with SmartThings Cloud
Use the Scenes API to work with scenes.
See Working with Scenes for an example of how to list and execute scenes using the Scenes API.
Personal access tokens require Scenes scopes. See Authorization and Permissions.
Rate limits and guardrails apply for Scenes. See Rate limits.
Example with Postman
Make sure you have at least two bulbs paired to the SmartThings Hub in your account.
In this example we will create two scenes using the SmartThings mobile app. Using Postman, we will list and execute these two scenes with the Scenes API.
Using this guide, Scenes in the SmartThings app create two scenes: one for turning ON both the bulbs at once, and the second scene for turning OFF both the bulbs at once.
Install the Postman app and create a Postman account for yourself (a free account is sufficient for this example).
Obtain SmartThings personal access token
If you don't have it already, open your Samsung account.
Next, get a personal access token for calling the SmartThings API. You will use this as a bearer token in the Postman app. Go to the personal access tokens page and click on the Generate new token on top-right.
Make sure that you select Scenes > Read all scenes and Scenes > Execute all scenes for Authorized Scopes.
Get a list of scenes
To get a list of scenes you created, you need to send a GET request to the
Start Postman. In the Authorization section of the Postman window, for the TYPE field, select Bearer Token from the drop-down menu list. This will display the Token form field on the right. Copy and paste here the personal access token that you generated above.
In the Postman window, select GET and type in the SmartThings API
In the response window of Postman you will see the two scenes you created above. Make a note of the
sceneId fields of the two scenes, as you will need them to execute these scenes next.
Execute a scene
To execute a scene you need to send a POST request to the
- In the Postman window, select POST and using the
sceneIdof the scene that turns ON both the bulbs instantly, type in the SmartThings API
You will see that the two bulbs are turned on.
Next, turn OFF the bulbs using the
sceneId of the scene that turns OFF the bulbs.