Prevent action on a light that is already on

i have tried searching for a solutoin to my item, but have come up dry. A caveat, I am not a programmer so when modifying the coding is simple, I likely still don’t understand it.

I have a motion sensor in a hallway by my bedroom set to trigger my kitchen light at 20% dim for when my wife gets up to exercise at 4:30ish am. It is set to allow triggering between 4:15am and 6:30am (right after I get up).

When she wanders down the hall, she will usually turn up the light to a more reasonable value.

Now the problem. If she walks in an area where the motion sensor can see her, it resets the dim to 20%. My first attempt was to only allow triggering once per day, but this wiped out the other 2-3 times per day where it would be useful.

Is there a way to prevent triggering the system if the light is already on?

There are several different ways to do this, but by far the most straightforward is going to be to use core.

Core is very complex, but there are many community members will be glad to help you get a rule set up to do just what you want. Just let them know upfront that you will need a step-by-step because you don’t have a programming background. :sunglasses:

I’ve done this in CoRE using a variable. Instead of caring about the level, I want to make sure that if I manually turn the light on, it doesn’t turn off when there is no motion. You use case is a bit more complex, but I think you can do the same. If the light was manually turned on don’t set the level when motion is detected.

Using CoRE:

Piston Mode-Latching

If “Date & Time” is between X and Y
AND
Group This:
—>Light “switch” is off
OR
Light “dimmer” level is less than or equal to 20%
<—Finish Group
AND
Motion Sensor is active
THEN
Turn On

Latching Part:
But-If
Light “dimmer” is less than or equal to 20%
AND
“Date &Time” is between X and Y
AND
Motion Sensor is inactive
THEN
Wait X amount of time
Turn off

Here is the Piston
Took me a while to understand how CoRE works but if you follow this piston then it will do exactly what you need. In my case, if the light is above 30% then it will not go back down to 30% because of motion and will disregard the nightlight piston.

I have another piston as a catch all after no motion for 15 minutes.

1 Like

Thanks Ron. I found Core after I posted this. Took 3 minutes to make my first piston, and now have a working solution. Why this type of engine doesn’t exist by default stymies me. I use MacroDroid for this on my phone and it works wonderful. Here is my solution to this problem.

1 Like