1) Give a description of the problem
I’ve tried to put together a door knock piston for my screen door using a smartthings multipurpose sensor. I can’t filter out door knocks from motion you get from opening and closing a screen door.
2) What is the expected behavior?
In this piston a door knock is when acceleration changes to active and the screen door is closed. When I knock on the screen door, it should send me an sms saying “Door knocked”. If acceleration is detected but is immediately followed by the door opening, it should not send me an sms saying “Door knocked”. The act of closing the screen door should not send me an sms saying “Door Knocked”.
3) What is happening/not happening?
Knocking on the door while the screen door is closed seems to be working.
I’ve added a trigger that says the door should be closed for 2 seconds (does this mean the next 2 seconds?), so if the door is closed, and acceleration is detected followed by the door opening within 2 seconds, then it should no longer continue with the piston. I believe this is working.
When I close the door because there is obviously acceleration when closing the door and the door will be closed, it senses it as a door knock. So I added another condition that says that if the door’s contact state did not change in the last 3 seconds it should no longer continue with the piston. That is, before it was closed, it was open, so this condition should have caught that but it doesn’t. I still get a Door knocked sms.
I don’t know if there is a much simpler method of doing this but I’m completely stuck.
**4) Post a Green Snapshot of the piston![image|45x37]
5) Attach any logs (From ST IDE and by turning logging level to Full)
|+1ms|╔Received event [Front Screen Door].acceleration = active with a delay of 115ms|
|---|---|
|+124ms|║RunTime Analysis CS > 22ms > PS > 48ms > PE > 55ms > CE|
|+126ms|║Runtime (38170 bytes) successfully initialized in 48ms (v0.3.104.20180323) (125ms)|
|+127ms|║╔Execution stage started|
|+137ms|║║Comparison (enum) closed is (string) closed = true (1ms)|
|+138ms|║║Condition #62 evaluated true (7ms)|
|+141ms|║║Comparison (enum) active changes_to (string) active = true (1ms)|
|+142ms|║║Cancelling condition #32's schedules...|
|+143ms|║║Condition #32 evaluated true (4ms)|
|+149ms|║║Comparison (enum) closed stays (string) closed = true (1ms)|
|+151ms|║║Adding a timed trigger schedule for condition 63|
|+152ms|║║Cancelling condition #63's schedules...|
|+153ms|║║Condition #63 evaluated false (10ms)|
|+154ms|║║Condition group #29 evaluated false (state did not change) (22ms)|
|+156ms|║║Fast executing schedules, waiting for 1996ms to sync up|
|+2159ms|║║Cancelling condition #63's schedules...|
|+2159ms|║║Condition #63 evaluated true (1ms)|
|+2179ms|║║Comparison (enum) open did_not_change = true (15ms)|
|+2180ms|║║Cancelling condition #64's schedules...|
|+2181ms|║║Condition #64 evaluated true (21ms)|
|+2181ms|║║Cancelling condition #29's schedules...|
|+2182ms|║║Condition group #29 evaluated true (state changed) (25ms)|
|+2184ms|║║Cancelling statement #30's schedules...|
|+2201ms|║║Executed virtual command sendSMSNotification (12ms)|
|+2209ms|║╚Execution stage complete. (2082ms)|
|+2210ms|╚Event processed successfully (2210ms)|