How To: SmartThings Home Monitor with Virtual Switches

SmartThings Home Monitor is a powerful tool in the SmartThings ecosystem for monitoring your home’s security and taking action when events occur (eg. notifying you, closing valves, etc).

Unfortunately, the ‘new’ SmartThings Home Monitor (STHM) associated with the new Samsung SmartThings app cannot be controlled by third party applications yet, so in this article we’ll describe how you can use Virtual Switches to integrate STHM with third party apps like SharpTools.io

If you’re looking for a video version of this post that you can follow along with, check out @Justin_Newbury from SimplySmart123’s video!

https://www.youtube.com/watch?v=pLiftPyqKYg

↓↓ Jump directly to the instructions ↓↓

Background

One point of confusion is that SmartThings has two different versions of Smart Home Monitor - one associated with the SmartThings Classic App and another associated with the Samsung SmartThings App.

While they are very similar in functionality, only the “Smart Home Monitor” associated with the SmartThings Classic app can be controlled directly by third party apps like SmartThings.

Historically, even the first party Custom Automation builder within the new Samsung SmartThings app couldn’t even automate STHM control. But lucky for us, the Custom Automation builder just received the ability to control STHM in the past few weeks (end of Oct 2019).

Smart Home Monitor SmartThings Home Monitor
Acronym SHM STHM
Mobile App SmartThings Classic Samsung SmartThings
App Logo image image
3rd Party Integrations :white_check_mark: :x:*
SharpTools Integration :white_check_mark: :x:*
Custom Automations
(new app)
:x: :white_check_mark:

Using Virtual Switches with STHM

Since the Custom Automation builder recently received support for controlling STHM, we can use that along with Virtual Switches to provide integration with other SmartApps like SharpTools!

The overall concept is to:

  1. Create virtual switches for each STHM state
  2. Create automations to link each switch being turned on to the appropriate STHM state being activated
  3. Create automations to link each STHM state change to mark the switches associated with the ‘inactive’ states as off
  4. Authorize the new Virtual Switches in SharpTools.io!

:warning: Note that SmartThings has some limits on how frequently you can change your STHM state via automation. In general day-to-day usage, you won’t likely run into this, but you may run into it when you are testing things after first setting it up.

1. Create Virtual Switches

Using the SmartThings IDE, create a Virtual Switch for each of the STHM States:

  • Armed Away
  • Armed Stay
  • Disarmed

Expand the steps below for more details. Be sure to repeat the steps to create a virtual switch for each of the states noted immediately above.

Detailed Steps

To create a Virtual Switch

  1. Login to the SmartThings IDE:
    https://account.smartthings.com

  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. Armed Stay)
    Note: The Label field can be left blank

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

  6. Open the Type dropdown and select Virtual Switch

  7. Leave the Version as ‘Published’

  8. Select your Location (eg. Home)

  9. Optionally, select your Hub

  10. Click Create

2. Create Automations to Control STHM when Virtual Switch turns on

Using the new Custom Automation builder in the new Samsung SmartThings app, create automations that change the STHM mode when each one of your virtual switches are activated.

IF 'Armed Stay' (Virtual Switch) changes to 'On'
THEN Set 'STHM' to 'Armed Stay'

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 switch (eg. Armed Stay)
  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 Change the Security mode
  11. Select the relevant state (eg. Armed (stay))
  12. Tap Save
  13. Tap Done
  14. Optionally adjust the provided Automation name and tap Ok to save the automation

Repeat the steps above for each of the other virtual switches.

Note: When creating the automation for Disarmed, it may inject a Send Notification action. Feel free to remove this action if you don’t want to be notified of the change.

Once this is complete, you will have successfully setup the automations that allow you to control STHM using switches. Proceed to the next step to keep the virtual switch state in sync with STHM.

3. Create automations to update Switch state when STHM state changes

In the previous step, we setup automations to control STHM when the switch state changed to On. In this step, we’ll setup automations to properly turn the switch state on or off when STHM state changes (eg. if it is changed manually or through other automations).

IF `STHM` changes to `Armed Stay`
THEN Set `Armed Stay` to `on`
     Set `Disarmed` to `off`
     Set `Armed Away` to `off`
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 Security mode
  6. Select your desired state (eg. Armed (stay))
    Note: leave the Wait before activating option switched off.
  7. Tap Save to confirm your selection
  8. Tap Next move on to the Then section
  9. In the Then section, tap the large + in the center of the page
  10. Select Control Devices
  11. Select all three virtual switches and tap Next (eg. Armed Away, Armed Stay, Disarmed)
  12. Important Step! Ensure that the switch which matches the STHM state you are working on is set to On and the others are set to Off

    eg. If you are working on the Armed (stay) STHM state, then set the switches to

    Armed Away = Off
    Armed Stay= On
    Disarmed = Off

    Note: You can tap on each switch in the list to change its desired action

    Leave ‘Delay this action’ and ‘Auto turn off’ disabled if prompted

  13. Tap Done
  14. Optionally adjust the provided Automation name and tap Ok to save the automation

Repeat the steps above for each of the other STHM states.

4. Authorize Switched in SharpTools.io and Use

  1. From your SharpTools.io User Page
  2. Tap Manage Connections
  3. Select SmartThings
  4. Follow the prompts, making sure to select the new Armed Away, Armed Stay, and Disarmed virtual switches you created

From here, you can add these three switches to your dashboard or use them in rules as normal!

:warning: As a reminder, SmartThings has some limits on how frequently you can change your STHM state via automation. In general day-to-day usage, you won’t likely run into this, but you may run into it when you are testing things after first setting it up.

If you hit the threshold for how frequently you can run an STHM automation, wait 1-2 minutes and then try again. As of writing this post, this limits had been increased slightly and appear to be reset every minute.

I followed this post to setup 3 buttons for controlling STHM. One thing I noticed is that if I click on a switch tile that is already on, it turns it off. Ie, it toggles the switch. This breaks the behavior of having 3 buttons in which one and only one can be on. (I can force all 3 to be off by doing this).

Did I miss a step above that covered this? Or anyone have a suggestion?

Would Hubitat “fix” this? Ie, by giving me native access to the equivalent of STHM instead of forcing me to use virtual switches?

SharpTools does have direct access to Hubitat’s equivalent to STHM / SHM. They call it Hubitat Safety Monitor (HSM).

You could setup a rule that said when all three switches are turned off that it should try to turn one of the switches back on.

Better than nothing. I’ll try this.

Only thing is, which state do you default to? I can’t default to Disarmed, since this is the one tile which is access protected with a PIN.

Longer term, still thinking about switching to HE.

You could setup the rule in SharpTools and take advantage of the new Variables feature. Each time one of the STHM switches are activated, you could store the last activated ‘STHM state’ in a variable… then when all three switches get turned off, you could use that variable to determine which switch to turn back on.

Edit: If you haven’t already, be sure to let SmartThings support know that you want third-party apps like SharpTools to have STHM support. I would also suggest posting in the Get ready to make the switch! - Announcements - SmartThings Community thread where Blake Arnold (SmartThings Product Manager) is active and let him know you want SharpTools to have STHM access.

1 Like

Since we’re moving towards the newer ST app and using STHM, can you make new icons that look like the disarm, arm home and arm away for the virtual switch tiles? I see them in the classic picker SHM and they look good. Thanks David

2 Likes

Hi @Super_Dave, welcome to the community. I’ve noted your request and thanks for your feedback. :grinning: