SmartThings Scenes are a powerful tool in the SmartThings ecosystem for changing the status of multiple devices simultaneously.
Unfortunately, Scenes are not exposed in the current API that is used to connect SharpTools to SmartThings. That being said, you can use a Simulated Switch to trigger your Scenes!
Using Virtual/Simulated Switches with Scenes
Since the Custom Automation builder has support for running Scenes, we can use that along with Simulated Switches to provide integration with other SmartApps like SharpTools!
The overall concept is to:
- Create a Virtual/Simulated Switch
- Create an automation to run the Scene when the Virtual/Simulated Switch is turned on
- Authorize the new Virtual/Simulated Switches in SharpTools.io!
1. Create Virtual/Simulated Switch
Using the SmartThings IDE, create a Virtual Momentary Switch (custom DTH) for your desired Scene.
Expand the steps below for more details.
Detailed Steps
For convenience, we’ll install a Virtual Momentary Switch device handler that automatically turns itself off. (Virtual Momentary Switch DTH Code)
Install Virtual Momentary Switch Code
- Login to the SmartThings IDE:
https://account.smartthings.com- Tap My Device Handlers
- Tap Create New Device Handler
- Select From Code
- Copy and Paste the contents of the Virtual Momentary Switch raw code
- Tap the Create button at the bottom
- After being redirected, tap the Save button at the top of the page
- Tap Publish > For Me
If you prefer, you can skip this step and use the stock ‘Simulated Switch’ and in the automation step below, change the IF condition to ‘On or Off’.
To create a Virtual Momentary Switch
-
Login to the SmartThings IDE:
https://account.smartthings.com -
Click My Devices in the top navigation bar
-
Click the New Device button in the top-right corner
-
Enter a Name for the device (eg. ‘Scene Away’ )
Note: The Label field can be left blank -
Enter a Device Network Id (eg. ‘Scene_Away’)
Note: The Zigbee Id should be left blank -
Open the Type dropdown and select Virtual Momentary Switch
-
Leave the Version as ‘Published’
-
Select your Location (eg. Home)
-
Optionally, select your Hub
-
Click Create
Alternatively, you could use the stock ‘Simulated Switch’ device Type and change the automation below to be “changes to ‘On or Off’”
2. Create an Automation to Run Scene when Switch turns on
Using the new Custom Automation builder in the new Samsung SmartThings app, create an automation that executes the scene when each one of your virtual/simulated switches are activated.
IF 'Scene Away' (Simulated Switch) changes to 'On'
THEN Run Scene 'Away'
Expand the steps below for more details. Be sure to create an automation for each switch.
Detailed Steps
- Open the new Samsung SmartThings mobile app
- Tap the
+
icon in the top-right - Select Add automation
- In the If section, tap the large
+
in the center of the page - Select Device status
- Select your desired virtual/simulated switch (eg. Scene Away)
- Select On
- Tap Next to move on to the Then section
- In the Then section, tap the large
+
in the center of the page - Select Run Scenes
- Tap the
+
for the relevant Scene (eg. Away) to select it - Tap Save
- Tap Done
- Optionally adjust the provided Automation name and tap Ok to save the automation
3. Authorize the Switch in SharpTools.io and Use
- From your SharpTools.io User Page
- Tap Manage Connections
- Select SmartThings
- Follow the prompts, making sure to select the new Momentary Switch / Simulated Switch
From here, you can add the switches to your dashboard or use them in rules as normal!