Event listener or delay?

I’m trying to build a script which satisfies a normal security system like flow. Basically

  • If the security system is on & If door one is breached
  • then do something for 30 seconds while the person has time to enter the code
  • If the code isn’t entered in 30 seconds, sound the alarm

It sounds simple, but between STHM and SharpTools I’m finding it isn’t that simple.

I’ve tried a bunch of different things, but it really comes back to needing an event listener or delay mechanism. To my knowledge, there is no way for me to “wait” for 30 seconds on a rule then evaluate state of devices or variables again. Additionally there is no way for me to create a second rule then say “run that one in 30 seconds”.

I would love to see some of the community thoughts around this. SharpTools is pretty impressive and I’m loving it thus far, I just want it to be slightly more powerful.

For this part you could add a delay action to wait 30 seconds followed by your IF blocks. Example

door A changes to open

Delay 30 seconds

IF (all)
Door is open
STHM is armed

sound alarm

do x, y, z

1 Like

What @Terri said, but expounding on it. It sounds as if you want to do something during the 30 seconds, perhaps a countdown buzzer. Also, you won’t be able to address the STHM in Sharptools rules directly. You will need to either use a Mode or create a virtual switch indicate the STHM status. You will toggle that with SmartThings Routines.

So using @Terri’s logic:

IF Door x contact changes to open

IF vEdge_STHM is On //ie if STHM is armed
Countdown chirp thing ON
DELAY 30 seconds
Countdown chirp thing OFF
IF vEdge_STHM is On //ie if STHM is armed
Siren ON
//do whatever, or nothing

Unfortunately, you are not going to keep the app from giving you a STHM alert, but you will prevent a siren or other notifications from taking place. But you don’t have to use the STHM. Just do the above with virtual switches, etc.

1 Like

Wait, where are you guys seeing a delay? I don’t see that as an option in the rule framework.


Hmm, I somehow didn’t see this. I now feel dumb :). Ty!!

@Bry is there any way to do something to a dashboard during that countdown time? I have a “chirp thing” but it kind of sucks. I’d love to show a live countdown if possible, or flash something on the screen. Does SharpTools have a way to POST to a dashboard from the Rule Engine?

BTW, thank you all…huge help!!

Flashing on the screen would probably be the easiest. A bit primitive, but you could add an appropriately-sized icon for a virtual switch that would be turned ON during the countdown. Set the ON color to something attention getting and use one of the funky animations to make it stand out.

Maybe use the chirp thing for the last x seconds, like where an alarm panel would change the cadence of the sounder to indicate that you’re running out of time.

The problem with a countdown, I think, is that however designed, it would be a parallel process and due to latency, probably wouldn’t be accurate.

That’s a good idea. I can mess around with that.

I’m not aiming for super high accuracy in the timing…I’m running a Konnected board on top of my normal alarm system and I’m just experimenting with better user experiences than what I had in the past. So far everything is working out pretty well except losing network connection makes it fail over to the normal alarm.

Sharptools has really sparked my creativity. I like the style of this platform and I think it could get pretty powerful. It would be awesome if they could let us target the dashboard events from the rules engine.