Condition Logic for Custom Automations

I’m using the latest Smartthings mobile app on Android (i.e., not the classic version).

Goal: I’d like to have an automation that only runs in Away mode, but can be triggered when motion is detected by any of my motion sensors.

Attempted Approach: I’ve tried using a custom automation with multiple conditions, but it appears that there are just two end-member options for the logic of how conditions are met: “All Conditions” or “Any Condition.”

Problem with Approach: If I select “All Conditions,” I believe the automation would require motion detection by all sensors in addition to being in Away mode. Alternatively, if I select “Any Condition,” I believe the automation would run whenever my system is in Away mode and not wait for any motion detection or run whenever motion is detected by any motion sensor regardless of whether or not the system is in Away mode.

Possible Solution: I realize I could make a new custom automation for each motion sensor, each of which would use the “All Conditions” mode to require Away mode and motion from that sensor.

However, this is not desirable because I want to have the action include quite a few things (turn a bunch of lights on for five minutes, notify me that motion has been detected, and activate a siren for one minute) – this would be cumbersome to manage with multiple motion sensors, especially if I want to do things like change the included lights or the duration of the actions.

Rejected Solution: I don’t want to use Smart Home Monitor, even though it is designed to do much of this, because I don’t want to require use of the app to arm and disarm. Rather, I want to have this behavior in place whenever my system is in Away mode. By taking this approach, I can do things like make it so that entering the house using our smart lock serves to disable the “Away-mode alarm” action, and that’s appealing so I can have others easily check on the house from time to time while we’re away without worrying about arming or disarming the system.

Is there a more efficient way to do this?

Your assessment of the limitations is accurate. Probably time for you to look into Webcore.


Thanks; I’ll give that a shot for a long-term solution.

In the meantime, as we have travel plans in the near future, I did come up with a way to do this that is slightly more convenient:

I still ended up using a separate automation for each motion sensor, with each automation’s condition logic requiring all conditions to be met (i. e., Away Mode and motion from that sensor), but I realized each automation doesn’t need to include all of the lighting actions.

Instead, each automation just initiates the siren, and I coupled that with an automation that runs the alarm lighting when in Away Mode and the siren goes off, and another to notify me when those same conditions are met. (At least I don’t have redundant commands to set the lighting.)

Another trick was figuring out how to make it so we can initiate Away Mode using voice commands with our Google Assistant devices, while also delaying the mode switch for a few minutes to give us time to leave… I’m sure others have found more elegant ways to do this, but here’s the approach I’m trying:

I made two Virtual Switches through the web interface, with one of them called “Away Mode,” so it can be turned in via voice (e.g., " OK Google, turn on Away Mode) so it’s easy to activate, and the other called Away Mode Delayed.

Next, I made an automation that runs whenever the Away Mode switch is turned on, and its still is to turn on the Away Mode Delayed switch with a delay of, say, three minutes. Finally, another automation runs when that switch is turned on, and that one actually changes the mode to Away.

Meanwhile, I have two other similar virtual switches for Home and Night modes, with each doing the work of actually changing the system’s mode (and making sure the other virtual switches she turned off).

To automate the switch back to Home Mode, another automation activates that switch whenever the garage door is opened (it has a tilt sensor on it) or the front door smart lock is opened.

The final piece of this convoluted “alarm system” was to make yet another automation called “Persistent Away Mode,” that I’ll turn on when we leave for vacation and turn back off when we’re just stepping out for short periods of time. When the automation is on, the away mode switch is turned back on whenever the garage door closes or the front door is locked. With two adults and three kids coming and going all the time I don’t want that as normal behavior because it would frequently become armed when not intended; I usually want setting Away Mode to require action from one of us.

But, when on vacation, I plan to have friends check on the house from time to time, and I want them to be able to enter via the garage or front door and otherwise not have to worry about arming/disarming the system. (I’ll just make sure to tell them to only close the garage or lock the door when they leave.)

I do realize that few, if any, will read all of this, but I thought I’d write it out partly just to organize the steps in my own mind so I’ll be better able to remember how it works :wink:


The following might be of interest:

How to Get Started Creating Complex Rules in SmartThings (2017) (SmartThings Classic)

1 Like

Create a virtual switch and turn it on in a custom automation when any of your conditions are met. Then create a new custom automation to execute when your virtual switch is on AND mode is away. You can then change the first automation with any devices as required.

1 Like