Door Reminder Piston is notifying me too much


#1

1) Give a description of the problem
(The piston is contacting/notifying me every single time the front door sensor is closed.)

2) What is the expected behavior?
(I want the piston to notify me only when the front door sensor is closed, BUT only after it has been opened for 90 seconds or more.)

3) What is happening/not happening?
(It is contacting me if the front door sensor has been opened for 90 seconds. So that part is working fine. And it’s also contacting me after the door closes after 90 seconds too.)

4) Post a Green Snapshot of the pistonimage
(

)

5) Attach any logs (From ST IDE and by turning logging level to Full)
( 3/23/2018, 3:20:48 PM +308ms
+3ms ╔Received event [Home].test = 1521836448303 with a delay of 1ms
+150ms ║RunTime Analysis CS > 22ms > PS > 103ms > PE > 28ms > CE
+158ms ║Runtime (41811 bytes) successfully initialized in 103ms (v0.3.000.20180224) (151ms)
+161ms ║╔Execution stage started
+202ms ║║Comparison (enum) closed stays (string) open = false (4ms)
+205ms ║║Cancelling any timed trigger schedules for condition 4
+207ms ║║Cancelling statement #4’s schedules…
+208ms ║║Condition #4 evaluated false (31ms)
+209ms ║║Condition group #1 evaluated false (state did not change) (33ms)
+227ms ║║Cancelling condition #13’s schedules…
+228ms ║║Condition #13 evaluated false (15ms)
+229ms ║║Cancelling condition #11’s schedules…
+230ms ║║Condition group #11 evaluated false (state changed) (17ms)
+238ms ║╚Execution stage complete. (79ms)
+243ms ╚Event processed successfully (243ms))

REMOVE BELOW AFTER READING


#2

I’d use a variable to track a notice sent. For example, a boolean noticeSent = ''

After line 22 add
Set variable noticeSent = true

After line 25 add
And
variable noticeSent = true

After line 29 add
Set variable noticeSent = false

I think that should do it. A regular open/close less than 90 secs shouldn’t trigger the notice.


#3

Thanks alot eibyer. I’ve updated the code and I’ll test it out later when I get home.


#4

Yep that worked perfectly!