Simple light on/off with motion not working

Just trying to turn on a light (office master) on motion and then keep it on until there is no further motion for a period of time …why does this not work…?
it seems to ignore the condition that if the motion stays inactive for the time period specified then turn the light off? I tried using a delay instead of the IF , but that didn’t work either.
Im sure its something simple im missing. !
Thanks !

You have to have a trigger for each action you want to cause the rule to run. As it’s written, the only thing causing the rule to run is motion changing to active so it will never execute the If block.

You’ll need to add stays inactive for 45 mins as a trigger, remove your first action, and adjust your if block. You can use context variables so it executes faster because it doesn’t need to query the device state. It would end up looking like this.

If
contact.event.value is active
Then
turn light on
ELSE
turn light off

This will run when motion changes to active > Then and again when motion stays inactive for 45 mins > Else

To use context variable
If > + > Variable > context variable > event > location/devices event > value > active

1 Like

Hi Terri…thanks for the reply…
hmmm…does this look right as you suggest it ? I only set 1 minute as a test …
Doesn’t seem to be turning on at all on motion detect set like this

Also dont really understand the variable part… have not delved into those yet. !
Much appreciated !

Yes. Just add your motion active trigger so it runs to turn on the light.

aaah so 2 triggers at the top …that now makes sense…will give that. a try
Thanks !

1 Like

That works as intended…thank you again…I have now learned something as a bonus which will help me with other rules. :slight_smile:
If you have a spare 5 mins…would love to know where to find info on the context variable part. !

1 Like

The Help Article on context variables is a good start:

If you have any questions or an example you’re looking for clarification on, I would be happy to help. :slight_smile:

1 Like

Thanks Josh…some reading for me to do :slight_smile: Really loving Sharptools…its been a pretty painless transition so far from Webcore for me (famous last words LOL )

1 Like