Override motion sensor rule if light is activated directly through My Home> Things on the app?

I got some smart bulbs yesterday and they are working fine.
I set them up so that they are triggered by a motion sensor and then turn off after 1 minute of inactivity.
The issue is that if I specifically choose to turn a bulb on, i.e. not using motion, the bulb will still turn off 1 minute later.
Is there a way for me to turn a light on and have it stay on until I turn it off?

Thank you for any help.

1 Like

Trying to do the same thing. There should be some sort of priority like background / foreground.

Just to clarify as someone changed the title of my post, but it was not correct.

I want the motion sensor rule to be ignored when I specifically choose the bulb from the ‘my home’ section of the app.

This page:

Add a Thing_samsung-galaxynote5-white-portrait cop

Solved it. Follow these instructions and this seems to do it.
Virtual Switches are the solution.


Sorry this only partially solves the problem. The light will stay on forever if turned on specifically, but if it detects motion, the light will then go off after the predefined time. Haven’t worked out a way to ignore the motion sensor if the light is already on. Think you can use a illuminance sensor, but I don’t have one.

This is something that you can easily accomplish with WebCoRE. You have more complex qualifications than what can be handled through a Routine or Smart Lighting.

You headed down the correct path by adding a virtual switch, but in order to have specific qualifications, building Pistons with these qualifications will allow you to do the following:

  1. PISTON ONE: If virtual switch changes to On (manually switched), then turn on the physical device (bulb).

  2. PISTON TWO: If motion sensor changes to Active, and Virtual Switch is Off then Turn on physical device (bulb), Wait one Minute, Then turn physical Light off.

  3. PISTON THREE: If the virtual device or physical device changes to Off (manually or Alexa), then turn off the virtual switch and the physical device (bulb).

These 3 Pistons will replace all Routines and/or Smart Lighting rules you have created.

This way when you manually press the virtual switch or tell Alexa to turn on/off the virtual switch, the first or third Piston will fire. Now as long as the Virtual Switch remains on, Piston 2 will not fire if Motion is detected.

1 Like

Thanks, I have no idea how to use webcore, do I have to install something to use it?

I was going to use this, but it keeps giving an error:


There are 1000s of people using WebCoRE and many people will assist and even help you write Pistons or help you understand something you don’t know… The Pistons I described above are very basic so anyone can help with this. It may be intimidating at first, so before you say, I’m not a programmer or I’m not very technical, it looks more complicated than it is. After you get your feet wet, you will understand it in no time. I say this because so many people without any technical knowledge say the same thing above all the time and then later come back saying, OMG, I wish I had spent the few hours a lot sooner to accomplish every single thing I need for SmartThings. The fact that you did your own reading and research and figured out about Virtual Switches and how to create one, webCoRE is something that you can do. Trust me, I know these things. :sunglasses:

1 Like

Thanks I’ll definitely have a go at this.

Why use 3 different Pistons? All of this can be wrapped up in one Piston.

I would use a couple of variables to simply.

Was simply giving an understanding of the concept to someone that has no prior knowledge without overwhelming them and explaining it as to how equivalent Individual Routines would be created. Easier to digest in the beginning.

1 Like

I’ve just ‘written’ my first webcore code. See if it works when I get home.

Basically said
if, motion detected and between these times and light is off
then, turn light on, wait 30secs, turn off.

Fingers crossed!

Hi I’m new here and trying to do something similar but doesn’t seem to work.

I want my lutron caseta to turn on if motion is detected but to stay on if the physical switch is press on. I built the 3 pistons like you said but as soon as I walk in the room it starts the motion rule even tought the virtual switch is “on”

piston state for 1 and 3 is false but I don’t get why

Can you help me out please

I tought I had the logic figure out but it seems not