Automation with - When Switch is turned from ON or OFF

I’m trying to find a way to create an automation in the new app with the the following condition:

  • When a switch is flipped from the OFF to ON position, or ON to OFF
    I know Webcore used to have that option, but I can’t find this in the new app automation possibilities.
    The only thing that the automation provides is When Switch in ON or is OFF.
    I want to implement an automation based on this: IF Someone arrives home, or leaves home then do this, not base on: iIF Someone is home or is not home.
    The switch is linked to my phone presence.
    Any ideas? Thanks

So, If someone arrives home and switch is off then turn it on and vice versa?

Not sure if that is right, but multiple automations are the equivalent to “else-if” or an “or”, I suppose…Like, one automation could say if is on then this, and another automation could say if off, then this.

I’m also thinking a virtual switch could be triggered as a reference, as a variable condition in the automation(s).

I’ve not made much use of virtual switches/devices but it might be something to look into, as well.

*The only presence sensor I have is my galaxy phone, but if I initiate the routine as Member Location, with the precondition Paul descrbes below, it seems to do what you are wanting.

I believe in Routines when you select on or off in the IF statement you are actually telling it to do that when the switch CHANGES to on or off.

If you want the action to happen in a Routine when switch is already in the on or off position, you need to mark that IF as a precondition. With a precondition you will need a 2nd IF to trigger the action.

1 Like

I have the option in the If section for On or Off to trigger the routine.


Select a THEN of ‘on or off’ to toggle a switch…

1 Like

Is this a screenshot from the new smartthings app? or are you showing me an Alexa app screenshot?
I was talking about Smartthings automations.

This is a screenshot from what app? How come you have a black background? My Smartthings is with a white background

If you have a Samsung Galaxy phone, there is an option to have the ST app follow the phone’s mode setting. I don’t know if it’s available for other android phones. At the time of this writing It is not available for devices using iOS.

1 Like

The toggle option is available for some devices in the new smartthings app.

Here is one of mine.

  1. Choose add an automation. Then for the IF, choose “Device Status”

  1. this will bring up a list of available devices. Choose the one you want to use.

(I chose Atomic.)

  1. you will get a pop-up with the device status options. Mine gives me the option to toggle.

Note that my device is a simple on/off switch. I don’t believe you will be able to use this for a dimmer.

1 Like

Thanks a lot, no, mine is also a switch, a Meross switch not a dimmer. Now I see On ro Off means Toggle from on to off, or from off to on. I get it now

1 Like

I have an iPhone, so that’s why.
I don’t understand how come Samsung they can’t make things the same on both OS platforms…

1 Like

I know that if the On/Off is used as an action in an automation, it will toggle the switch from whatever state it is in to the other. Apparently what you wanted to do.

But as a condition, I’ve never even thought about it, but now it leaves me wondering…

No, I want to use this as a condition… I’ll give it a try and let you know


Hi @Titus , yep as others have said but to confirm, this is the ST app on stock Android (Pixel phone) in dark mode…

Happy automating…

1 Like

That’s from the new SmartThings app.