Stop multiple notification with door sensor


#1

1) Give a description of the problem
Two different pistons trigger in the space of <3 seconds. Garage door open piston and garage door shut piston sends multiple messages that the door is open.

2) What is the expected behavior?
The section roller garage door has a magnetic sensor on it.
When the sensor opens, it triggers the piston (only once).
When the sensor closes, it triggers the piston (only once)

3) What is happening/not happening?
When the door opens, it triggers the open piston, then the shut piston almost immediately. Then the open piston again. This is despite me placing a stays open for 3 seconds, or stays away from closed for 3 seconds to prevent this kind of behaviour.

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

Shut piston

5) Attach any logs (From ST IDE and by turning logging level to Full)
`These logs (from Garage door shut piston) show the piston is executing twice within 3 seconds, so it’s not waiting the 3 seconds it should
09/11/2017, 08:43:14 +162ms
+1ms ╔Received event [EU Location].time = 1510177395799 with a delay of -1637ms
+158ms ║RunTime Analysis CS > 21ms > PS > 33ms > PE > 103ms > CE
+167ms ║Runtime (39176 bytes) successfully initialized in 33ms (v0.2.0fd.20171105) (166ms)
+168ms ║╔Execution stage started
+175ms ║║Cancelling condition #7’s schedules…
+175ms ║║Condition #7 evaluated true (1ms)
+183ms ║║Comparison (enum) off is (string) off = true (1ms)
+184ms ║║Condition #9 evaluated true (8ms)
+185ms ║║Cancelling condition #6’s schedules…
+186ms ║║Condition group #6 evaluated true (state changed) (11ms)
+187ms ║║Cancelling condition #1’s schedules…
+187ms ║║Condition group #1 evaluated true (state changed) (14ms)
+189ms ║║Cancelling statement #2’s schedules…
+210ms ║║Executed physical command [Fish Tank Light].off() (18ms)
+211ms ║║Executed [Fish Tank Light].off (20ms)
+214ms ║║Cancelling statement #15’s schedules…
+239ms ║║Executed virtual command sendPushNotification (22ms)
+242ms ║║Fast executing schedules, waiting for 1412ms to sync up
+1666ms ║║Cancelling condition #13’s schedules…
+1666ms ║║Condition #13 evaluated true (1ms)
+1672ms ║║Comparison (enum) off is (string) on = false (1ms)
+1674ms ║║Condition #14 evaluated false (6ms)
+1674ms ║║Condition group #8 evaluated false (state did not change) (9ms)
+1676ms ║╚Execution stage complete. (1508ms)
+1683ms ╚Event processed successfully (1683ms)

09/11/2017, 08:43:12 +575ms
+2ms ╔Received event [Garage Door].contact = closed with a delay of 150ms
+198ms ║RunTime Analysis CS > 29ms > PS > 50ms > PE > 118ms > CE
+206ms ║Runtime (39164 bytes) successfully initialized in 50ms (v0.2.0fd.20171105) (203ms)
+207ms ║╔Execution stage started
+221ms ║║Comparison (enum) closed stays (string) closed = true (2ms)
+223ms ║║Adding a timed trigger schedule for condition 7
+226ms ║║Cancelling condition #7’s schedules…
+227ms ║║Condition #7 evaluated false (11ms)
+228ms ║║Cancelling condition #6’s schedules…
+229ms ║║Condition group #6 evaluated false (state changed) (14ms)
+230ms ║║Cancelling condition #1’s schedules…
+231ms ║║Condition group #1 evaluated false (state changed) (17ms)
+238ms ║║Comparison (enum) closed stays (string) closed = true (2ms)
+240ms ║║Adding a timed trigger schedule for condition 13
+243ms ║║Cancelling condition #13’s schedules…
+243ms ║║Condition #13 evaluated false (11ms)
+244ms ║║Condition group #8 evaluated false (state did not change) (13ms)
+247ms ║╚Execution stage complete. (41ms)
+249ms ║Setting up scheduled job for Thu, Nov 9 2017 @ 8:43:15 AM AEDT (in 2.976s), with 1 more job pending
+264ms ╚Event processed successfully (264ms)`


#2

Have you tried the following?
IF
Contact sensor is Open.
THEN
WITH
RGB Bulb 1
DO
Wait 5 seconds
Set Level to 20%

Perhaps this way if there is a blip of open/close/open in the initial opening of the garage door, the task will start/stop/start and because of the wait you will not see the blip. If that makes sense.


#3

I did think about that earlier, but wouldnt that just wait 5 seconds after the contact sensor changes to open, and send all multiple notifications with a 5 second delay?


#4

I used to have this setup in the ST app, and within the app there is a function that only sends the notification once in a set amount of time.

Is there an equivalent in webcore. I’m looking for these pistons to only fire once every 30 seconds minimum.


#5

Try using a condition.

Only when Dior remains open for not than 5 minutes
Do with
Location
Send message

Do with
rbw bulb
Set color
Set level


#6

Thanks. I seems to have solved it with your idea, slightly different.


#7

OK, so my initial idea didnt work, and ended up creating a global variable, and got the pistons to change the global variable. Works well.


#8

I’m having a similar issue to the original post. I have a door sensor that closes when my doorbell is pushed and a piston that sends a notification. We’re getting 2, 3, or 4 notifications with one push of the button.

I tried creating a local variable and setting pushed=true and then if pushed=true then send a notification. If pushed=true for 3 seconds, reset to false. I would think that would do it, but we’re still getting multiples. I’m assuming that it’s registering open & closed in rapid succession (my logs look similar to above), so I thought setting a variable with a reset delay would fix it, but nope.

:thinking:


#9

Post a piston copy and possibly a log so we can check it out.


#10

Here’s the piston. I started with something much simpler and only added the variable as a way to intercept the rapid open/close states.


#11

Try it in this arrangement… if it cancels the timer, click the With and set the TCP to Never cancel


#12

I think i figured it out. I had parallelism enabled while trying to eliminate semaphore errors. I turned it off and tested it and only got one notification. I’ll test it more later when I’m not pinging my wife’s phone at work. Lol

Fwiw, I’ve already started simplifying the piston again and had planned something very similar to yours. (Trying to work on my phone, which isn’t working well. Gotta get back to my desk.)