webCoRE Dock Knocked notification


#1

1) Give a description of the problem
Unexpected triggering

2) What is the expected behavior?
Door is knocked and not open in 5 secs then Notification sent

3) What is happening/not happening?
If the door is opened within the 5 secs then another notification is triggered

**4) Post a Green Snapshot of the piston![image|45x37]

5) Attach any logs (From ST IDE and by turning logging level to Full)
(PASTE YOUR LOGS HERE BETWEEN THE MARKS)

REMOVE BELOW AFTER READING
If a solution is found for your question then please mark the post as the solution.


#2

Your problem will be that opening the door triggers new acceleration which resets the timer. I know you have the contact closed restriction but it’s a bit of a race condition as contact open and aceleration active will be fighting to report first.

Also, you have a trigger inside a trigger which is a recipe for disaster (it’s impossible for two triggers to occur at the exact same time).

I can imagine a solution in my head but I’m not at a computer for a while so can’t knock up an example right now (will try later)

Basically:

define variable
Boolean knockKnock

IF
Aceleration Changes To active
AND
Door IS closed
AND
knockKnock IS false
THEN
set variable knockKnock = true

IF
knockKnock IS true
AND
door is closed
THEN
with location (Cancel on condition change)
wait 5 seconds
Send notification
wait 10 seconds (suggested timeout period)
set variable knockKnock = false

IF Door IS Closed
AND
knockKnock IS True
then
Wait 10 seconds (to allow time for acceleration to go inactive)
set variable knockKnock = false


#3

Another simpler one would probably just do a Wait 5 seconds, then Send Push. It will get canceled anyway when the door opens.


#4

I was thinking that but opening / closing the door will trigger new acceleration which will restart the counter.


#5

Yeah, better add that variable for good measure :slight_smile:


#6

Something like this?

IS the with location (Cancel on condition change) = the default Task Cancellation Policy (Cancel tasks on condition state change)


#7

yeah, it’s the default setting… just put it in my sudo code to explain how it’s meant to work.

You’ll need to force subscriptions on lines 33 and and 43.

You may find you need to extend the 10 seconds on line 39… depends how long you want to give yourself to open the door. Ideally knock will still be true when you open the door to prevent closing the door triggering things.


#8

Sorry Robin for my ignorance

Can you explain ‘You’ll need to force subscriptions on lines 33 and and 43’ please?


#9

Thanks Robin
How do I force a subscription for a variable state change? I have changed the code on 43 see below


#10

Changing it to a trigger (like you’ve just done on line 43) will force the automatic subscription.

To keep it as an ‘IS’ condition, you can just click on the IF, click the cog symbol, and change subscription to ‘always’ instead of ‘Automatic’


#11

I have had success with the above piston, thank you all. I am trying to eliminate the false alarem from the smart lock opening and closing. How would I add that condition?


#12

This was a great starting point for me, so thank you.

I used the SmartThings Multi-sensor and narrowed down the threeaxis x position. But after more door knock testing, I believe I also need to do a “falls below” -1000 on the x axis.

How would I do an equivalent of Contact Sensor axisX rises above 50 OR falls below -1000?


#13

Hello, bringing back an old thread to life. I was trying to set up a door knock scenario to when vibration is sensed I get a push notification, however I was getting a lot of false alerts.

So I thought if I have it combined with motion detected with my ring doorbell then it might eliminate false alerts from someone bumping into the door or some random vibration.

Using the sample from above here is what I got. Any help is greatly appreciated.

Also, just curios why line 43 uses “changes to” instead of “is”

Thanks!!