Repeating Piston Only If A Condition Is Met


#1

I’m taking another shot at this Piston this year…

It is designed to send an SMS to multiple phones if the temperature is freezing.

I’m wondering if the first line condition should be somewhere else. Basically I want this to repeat every 90 minutes unless the door has opened in the last hour every 90 minutes, which means someone has already gone in.

Then continue to check the temperature and door sensor every 90 minutes.

OR ---- Would this one work better?


#2

Please post the green snapshot of the second piston so I don’t have to recreate it… one too many drinks :wink:


#3

The second one is right above the first one… I’m thinking it might work better…

Not sure why it got moved ahead of the original…


#4

It’s not showing the import code


#5

I figured out the cropped image thing… Something with the editor I’m using… Uggh.

Anyway, those other 2 were doing random times that were not going to work.

I think this one is going to work, I’m just not sure it is going to be reliable. I shortened the times to test it— so far so good. I’m going to want it to check every 3 hours. This one seems to send every 10 minutes, except while the door is open. The weird thing is the door was open for an hour and it didn’t send ony messages during that time, even though there was no change for more than 10 minutes, but as soon as the door closed, it began sending every 10 minutes. That is fine,

10/5/2021, 8:17:26 PM +75ms
+0ms ╔Received event [Home].time = 1633479446815 with a delay of -741ms
+99ms ║RunTime Analysis CS > 38ms > PS > 10ms > PE > 52ms > CE
+102ms ║Runtime (37679 bytes) successfully initialized in 10ms (v0.3.113.20210203) (100ms)
+103ms ║╔Execution stage started
+124ms ║║Comparison (decimal) 71.81 is_less_than_or_equal_to (integer) 90 = true (2ms)
+126ms ║║Condition #3 evaluated true (11ms)
+275ms ║║Comparison (enum) closed did_not_change = true (141ms)
+278ms ║║Condition #4 evaluated true (151ms)
+280ms ║║Condition group #2 evaluated true (state did not change) (165ms)
+284ms ║║Cancelling statement #5’s schedules…
+310ms ║║Executed virtual command sendSMSNotification (17ms)
+316ms ║╚Execution stage complete. (212ms)
+318ms ║Setting up scheduled job for Tue, Oct 5 2021 @ 8:27:26 PM EDT (in 600s)
+327ms ╚Event processed successfully (327ms)
10/5/2021, 8:07:26 PM +354ms
+0ms ╔Received event [Home].time = 1633478846815 with a delay of -461ms
+83ms ║RunTime Analysis CS > 40ms > PS > 8ms > PE > 34ms > CE
+86ms ║Runtime (37677 bytes) successfully initialized in 8ms (v0.3.113.20210203) (83ms)
+87ms ║╔Execution stage started
+110ms ║║Comparison (decimal) 71.81 is_less_than_or_equal_to (integer) 90 = true (2ms)
+112ms ║║Condition #3 evaluated true (13ms)
+290ms ║║Comparison (enum) closed did_not_change = true (169ms)
+291ms ║║Condition #4 evaluated true (178ms)
+292ms ║║Condition group #2 evaluated true (state did not change) (194ms)
+295ms ║║Cancelling statement #5’s schedules…
+310ms ║║Executed virtual command sendSMSNotification (10ms)
+313ms ║╚Execution stage complete. (226ms)
+315ms ║Setting up scheduled job for Tue, Oct 5 2021 @ 8:17:26 PM EDT (in 600s)
+324ms ╚Event processed successfully (324ms)
10/5/2021, 7:57:26 PM +227ms
+0ms ╔Received event [Home].time = 1633478246815 with a delay of -589ms
+69ms ║RunTime Analysis CS > 31ms > PS > 8ms > PE > 31ms > CE
+72ms ║Runtime (37677 bytes) successfully initialized in 8ms (v0.3.113.20210203) (70ms)
+73ms ║╔Execution stage started
+94ms ║║Comparison (decimal) 74.18 is_less_than_or_equal_to (integer) 90 = true (1ms)
+95ms ║║Condition #3 evaluated true (13ms)
+302ms ║║Comparison (enum) closed did_not_change = true (199ms)
+304ms ║║Condition #4 evaluated true (208ms)
+305ms ║║Condition group #2 evaluated true (state did not change) (223ms)
+307ms ║║Cancelling statement #5’s schedules…
+313ms ║║Executed virtual command sendSMSNotification (1ms)
+316ms ║╚Execution stage complete. (244ms)
+318ms ║Setting up scheduled job for Tue, Oct 5 2021 @ 8:07:26 PM EDT (in 600s)
+326ms ╚Event processed successfully (327ms)
10/5/2021, 7:47:26 PM +115ms
+1ms ╔Received event [Home].time = 1633477646815 with a delay of -700ms
+48ms ║RunTime Analysis CS > 17ms > PS > 6ms > PE > 25ms > CE
+50ms ║Runtime (37677 bytes) successfully initialized in 6ms (v0.3.113.20210203) (49ms)
+51ms ║╔Execution stage started
+68ms ║║Comparison (decimal) 74.18 is_less_than_or_equal_to (integer) 90 = true (1ms)
+70ms ║║Condition #3 evaluated true (9ms)
+249ms ║║Comparison (enum) closed did_not_change = true (173ms)
+250ms ║║Condition #4 evaluated true (180ms)
+251ms ║║Condition group #2 evaluated true (state did not change) (191ms)
+253ms ║║Cancelling statement #5’s schedules…
+268ms ║║Executed virtual command sendSMSNotification (9ms)
+271ms ║╚Execution stage complete. (220ms)
+273ms ║Setting up scheduled job for Tue, Oct 5 2021 @ 7:57:26 PM EDT (in 600s)
+287ms ╚Event processed successfully (287ms)
10/5/2021, 7:37:26 PM +148ms
+0ms ╔Received event [Home].time = 1633477046815 with a delay of -667ms
+76ms ║RunTime Analysis CS > 36ms > PS > 7ms > PE > 33ms > CE
+79ms ║Runtime (37679 bytes) successfully initialized in 7ms (v0.3.113.20210203) (77ms)
+80ms ║╔Execution stage started
+105ms ║║Comparison (decimal) 74.18 is_less_than_or_equal_to (integer) 90 = true (2ms)
+107ms ║║Condition #3 evaluated true (17ms)
+240ms ║║Comparison (enum) closed did_not_change = true (126ms)
+242ms ║║Cancelling condition #4’s schedules…
+244ms ║║Condition #4 evaluated true (136ms)
+245ms ║║Cancelling condition #2’s schedules…
+247ms ║║Condition group #2 evaluated true (state changed) (157ms)
+250ms ║║Cancelling statement #5’s schedules…
+259ms ║║Executed virtual command sendSMSNotification (2ms)
+263ms ║╚Execution stage complete. (184ms)
+265ms ║Setting up scheduled job for Tue, Oct 5 2021 @ 7:47:26 PM EDT (in 600s)
+273ms ╚Event processed successfully (273ms)
10/5/2021, 7:27:26 PM +94ms
+1ms ╔Received event [Home].time = 1633476446815 with a delay of -721ms
+71ms ║RunTime Analysis CS > 40ms > PS > 7ms > PE > 23ms > CE
+73ms ║Runtime (37679 bytes) successfully initialized in 7ms (v0.3.113.20210203) (72ms)
+74ms ║╔Execution stage started
+91ms ║║Comparison (decimal) 74.18 is_less_than_or_equal_to (integer) 90 = true (1ms)
+92ms ║║Condition #3 evaluated true (9ms)
+188ms ║║Comparison (enum) closed did_not_change = false (88ms)
+190ms ║║Condition #4 evaluated false (96ms)
+191ms ║║Condition group #2 evaluated false (state did not change) (108ms)
+193ms ║╚Execution stage complete. (119ms)
+195ms ║Setting up scheduled job for Tue, Oct 5 2021 @ 7:37:26 PM EDT (in 600s)
+202ms ╚Event processed successfully (201ms)
10/5/2021, 7:17:26 PM +127ms
+1ms ╔Received event [Home].time = 1633475846815 with a delay of -688ms
+84ms ║RunTime Analysis CS > 48ms > PS > 7ms > PE > 28ms > CE
+86ms ║Runtime (37677 bytes) successfully initialized in 7ms (v0.3.113.20210203) (84ms)
+87ms ║╔Execution stage started
+108ms ║║Comparison (decimal) 75.37 is_less_than_or_equal_to (integer) 90 = true (2ms)
+111ms ║║Condition #3 evaluated true (12ms)
+216ms ║║Comparison (enum) closed did_not_change = false (96ms)
+219ms ║║Cancelling condition #4’s schedules…
+220ms ║║Condition #4 evaluated false (109ms)
+221ms ║║Cancelling condition #2’s schedules…
+222ms ║║Condition group #2 evaluated false (state changed) (125ms)
+226ms ║╚Execution stage complete. (138ms)
+227ms ║Setting up scheduled job for Tue, Oct 5 2021 @ 7:27:26 PM EDT (in 600s)
+235ms ╚Event processed successfully (235ms)
10/5/2021, 7:07:29 PM +677ms
+0ms ╔Received event [Home].time = 1633475246815 with a delay of 2861ms
+75ms ║RunTime Analysis CS > 33ms > PS > 9ms > PE > 33ms > CE
+78ms ║Runtime (37677 bytes) successfully initialized in 9ms (v0.3.113.20210203) (77ms)
+79ms ║╔Execution stage started
+104ms ║║Comparison (decimal) 75.37 is_less_than_or_equal_to (integer) 90 = true (1ms)
+105ms ║║Condition #3 evaluated true (13ms)
+401ms ║║Comparison (enum) closed did_not_change = true (289ms)
+403ms ║║Condition #4 evaluated true (296ms)
+404ms ║║Condition group #2 evaluated true (state did not change) (311ms)
+406ms ║║Cancelling statement #5’s schedules…
+430ms ║║Executed virtual command sendSMSNotification (17ms)
+433ms ║╚Execution stage complete. (354ms)
+435ms ║Setting up scheduled job for Tue, Oct 5 2021 @ 7:17:26 PM EDT (in 596s)
+444ms ╚Event processed successfully (444ms)
10/5/2021, 6:57:26 PM +754ms
+0ms ╔Received event [Home].time = 1633474646815 with a delay of -62ms
+83ms ║RunTime Analysis CS > 40ms > PS > 11ms > PE > 33ms > CE
+87ms ║Runtime (37680 bytes) successfully initialized in 11ms (v0.3.113.20210203) (85ms)
+88ms ║╔Execution stage started
+107ms ║║Comparison (decimal) 76.56 is_less_than_or_equal_to (integer) 90 = true (1ms)
+108ms ║║Condition #3 evaluated true (10ms)
+248ms ║║Comparison (enum) closed did_not_change = true (132ms)
+249ms ║║Cancelling condition #4’s schedules…
+250ms ║║Condition #4 evaluated true (141ms)
+252ms ║║Cancelling condition #2’s schedules…
+253ms ║║Condition group #2 evaluated true (state changed) (155ms)
+256ms ║║Cancelling statement #5’s schedules…
+333ms ║║Executed virtual command sendSMSNotification (72ms)
+337ms ║╚Execution stage complete. (249ms)
+338ms ║Setting up scheduled job for Tue, Oct 5 2021 @ 7:07:26 PM EDT (in 599s)
+345ms ╚Event processed successfully (345ms)