Security Examples with Rule Engine

One of the more popular use cases for the SharpTools Rule Engine has been augmenting or enhancing security around the smart home. For example:

  • Automatically lock doors and set alarm status before bed time
  • Schedule lights to turn on and off while on vacation
  • Nightly security check sends a notification for unlocked or open doors

:warning: As with anything security related around your home, make sure you understand the the options that are available to you and how they work. SharpTools does not endorse any specific rule and no warranty is implied with the use of the software.

In general, I personally do not automate the control of things like garage doors or locks, but I do find value in getting notifications if doors are left open or unlocked.

The following Knowledge Base articles provide a good introduction to the Rule Engine and how to use Notifications:

Once you’ve had a chance to take a look at the above articles and get comfortable with the concepts of the Rule Engine, here’s a few example security rules. What rules are you using around your house?


Automatically lock doors and set alarm status before bed time

In this rule, we setup a Time based trigger that runs every night at 9 PM. This kicks off the flow which includes an IF Condition which checks if the Front Door was left unlocked. If it’s unlocked, we send a command to lock it, otherwise we do nothing (empty flow)

Details (tap to expand)

Triggers
Timer Trigger > Timer

Here’s what it looks like while editing…

Flow
Action > Device: Lock
Action > Location (HSM): Arm Night


Schedule lights to turn on and off while on vacation

In order to accomplish this, we’ll create multiple rules. For demonstration purposes, we’ll create one rule around sunset and another for later in the evening, but you might choose to customize this with multiple rules at different times of the day or by including delays within the rule so different lights turn on at different times to better simulate a household ‘waking up’ or ‘going to sleep’.

Sunset Rule

Details (tap to expand)

Triggers
Timer Trigger > Timer (sunset)

Note that we’ve chosen to kick this rule off 30 minutes before sunrise to simulate starting to turn on some of the lights before sunrise hits, but you can adjust this as you see fit.

Flow
Action > Device1 On
Delay
Action > Device2 On
…etc

Late Evening Rule

Details (tap to expand)

Timer Trigger > Timer (evening)

Flow
Action > Device1 Off
Delay
Action > Device2 Off
…etc

Notify if doors are left unlocked or open

In this rule, we’ll setup a trigger that runs every evening at a time that we would expect the doors to be locked. If the door is left unlocked, we’ll send a notification letting us know that it’s still unlocked so we can either manually lock it from our dashboard or by physically locking it.

Details (tap to expand)

Triggers
Timer Trigger > Timer

Flow
Note that we choose to use an ‘is not’ comparison here. By doing this, we’re checking if the door is not locked since there are several other states this particular lock could be in (unlocked, jammed, unknown).

IF Front Door lock IS NOT Locked
THEN Send Notification

IF Condition > Device
Action > Notification


image

1 Like