Sleep or pause for a few seconds?


#1

Hi folks, I’ve got a SmartThings hub v2 in the mail but I’m getting started early…

Is there a reliable and convenient way to introduce sub-minute delays into SmartApps? I am hoping to build a security system where when motion is detected a warning strobe or sound plays for ~10 seconds before triggering a full alarm and notification. I don’t want to use the scheduler since (1) I don’t trust it to be reliable, given the issues it’s apparently had and (2) it’s precision is in the minute range and I don’t want to give a potential intruder much time before the alarm goes off.

I am also open to recommendations for less-convenient workarounds, such as calling a local REST service which waits then calls into a Web Services SmartApp.

Either way, reliability is important here. Hopefully I’m not going with the wrong platform?

Thanks.


(Kevin) #2

When it comes to SmartThings, don’t expect anything to be reliable. They’re putting a lot of effort into stabilizing the system so hopefully at some point that will no longer be the case, but it’s most likely going to take some time.

The Aeon Labs Multifunction Siren device handler I’ve built for the Aeon Siren supports this functionality, You can make it chirp for a specific number of seconds before sounding the alarm and then you can make the alarm automatically turn off after a specified number of seconds. I’m only aware of one person that has had problems with the reliability of the beeping.

That being said, for my SmartApps that need precise timing that runs less than 1 minute, I’m using an Arduino Undo with the Arduino ThingShield. This will probably cost about $55 to implement.

It’s worked flawlessly for several months, but I’m not sure if it’s still needed since the new scheduler seems to be working well.

This is what I’m doing, but there are probably others that have found ways to implement this functionally using other free services.

FYI: SmartApps can only run for 20 seconds so I wouldn’t trust a sleep/delay command for anything more than a few seconds.