How To: SmartThings Scenes with Simulated Switches

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:

  1. Create a Virtual/Simulated Switch
  2. Create an automation to run the Scene when the Virtual/Simulated Switch is turned on
  3. Authorize the new Virtual/Simulated Switches in!

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
  1. Login to the SmartThings IDE:
  2. Tap My Device Handlers
  3. Tap Create New Device Handler
  4. Select From Code
  5. Copy and Paste the contents of the Virtual Momentary Switch raw code
  6. Tap the Create button at the bottom
  7. After being redirected, tap the Save button at the top of the page
  8. 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

  1. Login to the SmartThings IDE:

  2. Click My Devices in the top navigation bar

  3. Click the New Device button in the top-right corner

  4. Enter a Name for the device (eg. ‘Scene Away’ )
    Note: The Label field can be left blank

  5. Enter a Device Network Id (eg. ‘Scene_Away’)
    Note: The Zigbee Id should be left blank

  6. Open the Type dropdown and select Virtual Momentary Switch

  7. Leave the Version as ‘Published’

  8. Select your Location (eg. Home)

  9. Optionally, select your Hub

  10. 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
  1. Open the new Samsung SmartThings mobile app
  2. Tap the + icon in the top-right
  3. Select Add automation
  4. In the If section, tap the large + in the center of the page
  5. Select Device status
  6. Select your desired virtual/simulated switch (eg. Scene Away)
  7. Select On
  8. Tap Next to move on to the Then section
  9. In the Then section, tap the large + in the center of the page
  10. Select Run Scenes
  11. Tap the + for the relevant Scene (eg. Away) to select it
  12. Tap Save
  13. Tap Done
  14. Optionally adjust the provided Automation name and tap Ok to save the automation

3. Authorize the Switch in and Use

  1. From your User Page
  2. Tap Manage Connections
  3. Select SmartThings
  4. 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!


2 posts were split to a new topic: SmartThings App Reporting Devices Offline