Need advice on adding a lockout time for presence sensor


#1

1) Give a description of the problem
I would like to add some sort of a timeout/lockout on the first half of this piston (similar to the one in the 2nd half of the piston), but I’m not quite sure how to structure the logic. The problem I’m having with the piston as it current is, is when one of the presence sensors arrives, then changes to away, and back to arrived in a very short period of time. This ends up setting the house to ‘Home’, then back to ‘Away’, but won’t set it back to ‘Home’ again due to the timeout in the 2nd half of the piston. If there was a timeout in the first half, I think it would solve the issue.

2) What is the expected behaviour?
When a presence sensor arrives and then changes to away again rapidly, the portion of the piston that sets the house to ‘away’ wouldn’t run due to a minimum timeout of some sort.

3) What is happening/not happening?

**4) Post a Green Snapshot of the piston!

5) Attach logs after turning logging level to Full


#2

Hi there,
Just wanted share a couple of things.
1 - I’d highly recommend NOT to use a presence sensor with any Lock/Security related features of your home.
I don’t mean to tell you what to do with your house. I just learnt the hard way. My door was unlocked, garage door was wide open for 2 days straight:))) Luckily I live in a very safe area.

2 - Presence sensors are not fast and reliable at the moment. Maybe it’ll change but it is what it is for now. If you enter your home and leave fast, you will have similar problems.

3 - If you want to use presence sensors just for added security and functionality, add a motion sensor and/or open close sensor to the equation.


#3

You can use something like this to check how long the presence sensor was in its previous state before it changed to its current state. (For this example, I used 5 minutes).

(previousAge([presenceDeviceName : presence])-age([presenceDeviceName : presence]))/60000 is less than 5

FWIW, I would probably restructure your piston, eliminating the “on event” and using two separate IF/THEN statements rather than the ELSE IF. Just something to think about.

I use presence extensively in my home security system, but I agree with @ike2018 that there are very serious concerns in doing so. I’m fortunate that my tasker-based presence sensors are now 99.8% reliable, but I have nevertheless built multiple redundancies into everything. For example, when doors are unlocked or open too long, I receive notifications (both via webCoRE and from the manufacturers’ own app) and have the doors and locks promptly close and lock themselves. I have cameras to provide a visual confirmation. Every security-related piston has time and vacation-based restrictions, is programmed to ignore presence “jumps” (rapid changes like you describe above), and in general is much ‘happier’ to close and lock a door than open or unlock it. I could go on, but you get the point. I’m entirely serious when I say it took months of work before I began to trust any of it.


#4

Yes same here…
I have few different safety pistons and messages etc.
If i fell something weird, two cameras pointed at the door both inside and out.