Routine stopped working

I have a simple routine to re-lock my front door.

If front door lock state is unlocked AND
If front door open/close sensor state is closed for 20 minutes THEN
lock the front door lock

This has worked for a long time but now, it does not re-lock the door.

I can lock and unlock the door from the SmartThings app just fine, so it’s not an issue of not being able to control the lock. Also the open/close sensor works fine. It has 67% battery and when I open and close the door, the app correctly shows the status change to open and back to closed. So by all accounts this should be working, but it’s not.

Ideas on how to conduct further troubleshooting?

I would change the Routine to be:

If door lock is unlocked (precondition)
  Door sensor closed for 20 mins
Then
  Lock door lock
1 Like

Oh sorry I forgot to mention the if door lock is unlocked IS coded as a pre-condition.

Ok, then I would add a notification action to the Routine to see if it is actually being triggered. I would also do driver logging with the CLI to see if commands are being sent to the lock and how the lock is responding.

I would check the History tab of the lock and the device to see if it’s correct and also in Menu - History to see if the routine triggered or not.

Could you elaborate on how to do driver logging from the CLI? I’ve not done any SmartThings troubleshooting since back in the IDE days. I presume adding the notification action to the THEN clause is what you meant?

The history tab of both devices correctly shows the state changes as I open/close the door or unlock/lock the lock. I don’t know what you mean by Menu - History. Back in the IDE days I’d check the device logs. I presume Menu - History is the modern day equivalent. I just don’t know where or what it is.

1 Like

SmartThings app, Menu tab, History. At least on Android, there you can see the routines that have been activated and when.

Thanks. All I see there are various sensors reporting their status (e.g. leak sensors, motion sensors). Nothing about any routines being run. What might such an entry look like? Why might I not have any?

If it was activated it would be an event with the routine name and a text below saying “Routine activated”.

Guess we can assume the routine is not triggered at all.

I may try creating a new routine, maybe starting only with the sensor and then adding the lock precondition, just to see where’s the problem. I had to recreate a routine from scratch once because it just didn’t trigger (I added a cloud device to a local routine and the routine broke completely, not your case but worth a try creating a new one and checking step by step).

Will give that a try.

I created this


There’s no record of it being triggered in the history.

I have a couple other routines that turn lights on and off at various times and I do see those routines being triggered in the history, so it is not as if no routines are ever being triggered. I’m not sure what to try next.

I don’t really know what the initial conditions of a Routine are, but even in the most pessimistic case it looks like it ought to work once you have unlocked and locked the door, and opened and closed the door, at least once after saving.

Hmm maybe that is the problem. I can’t say with any confidence that I actually did that after saving the routine. I will try that and see if it helps.

In the end, deleting and recreating the routine to lock the door worked. So I am happy now and thank you all for your help. I do wonder, though, what causes a routine that has worked for many moons to suddenly need recreating in order to keep it working (and more to the point, what’s to guarantee that won’t happen again in the future). Fortunately it wasn’t but it could have been very bad. My door could have not re-locked right after I left for an extended period, leaving my house open to whomever cared to try the door.

There is no hub logging like in the old IDE. Only support can see the logs for the O/S part of the hub.

You can, however, do driver logging for devices using an Edge driver installed on a hub. The ST CLI can be run on a Linux/Windows/macOS computer and logging for a driver can be started using the command “smartthings edge:drivers:logcat” and then selecting the desired driver. You can also do logging for all drivers using the “-a” command line option.

This post also discusses how to filter the various severity levels of log messages to make it easier for troubleshooting.

1 Like