We’ve covered a myriad of things based on how you can make your Smart Home smarter based on your location information, but one we haven’t touched on yet is locking your door. We’ve already got a Morning Industry deadbolt, a MorningLinc Insteon controller to activate it, and a hidden door sensor to detect the state of the lock, so we just need to write a quick program to automatically lock the door when we leave the house, using MobiLinc’s geofence feature.
The program itself is pretty straightforward; if the MobiLinc variable is set indicating we’ve gone more than 100 meters from the house, and the door is not currently locked, send an alert and throw the lock:
If $Matts_iPhone_home-100meter is 0 And Status 'Sensors / Front Door Lock' is On Then Resource 'Pushover - Security Alert (door - front lock)' Set 'Foyer - Front Door Lock' Lock Door Else - No Actions