Door lock light returns to normal

I wish I was better at understanding basic rules, I’m certain this is easier than I think.

I’m trying to get a lamp to change to red when the door lock has been left unlocked after a certain amount of time. Then, Once locked I would like for it to turn back to 2700 temp and fade to zero after a minute.

I was able to get the light to turn red after the lock was unlocked for the time period, but bells I cannot get it to turn back to normal.

Right now your Rule is only triggering when the lock remains unlocked for 30 seconds. Add a second IF in the Trigger section for locked to have the Rule fire when the lock changes to Locked.

Add a new IF in the Flow before the actions to turn the light red to say IF lock is unlocked.

1 Like

Sorry I am not following. Thank you for looking at this and the response. I Don understand how to add the if under triggers.

The top yellow section are your triggers. This needs to include anything that happens to run your rule. So you need to add another Trigger of door changes to locked.

In the FLOW section, since you now have 2 triggers you will need to 2 IF blocks.
Leave the IF block you already have but delete the top 2 actions.
Add another IF block (the same as you already did) but use door stays unlocked for 30 sec. Under THEN add turn light on and set red actions.


It’s venturing into ‘advanced’ topics, but they could also use Context Variables to distinguish which type of event triggered the rule.

For example, if the two triggers are:

  • Lock stays unlocked for 30 seconds
  • Lock changes to locked

The Context Variable > Event > Device > Value ($context.event.value) could be checked as it should either be locked or unlocked. The beauty of this is the rule is then completely driven by the events and it doesn’t need to query SmartThings to ask for the state of the lock.

1 Like