New user, piston is looping


#1

1) Give a description of the problem
My piston is looping, and I don’t know why.

2) What is the expected behavior?
The switch opens and the bulb brightness goes up to 100% for 5 seconds and then goes back down to 40%, or the switch was open more than a second and is now closed, and the bulb brightness goes up to 100% for 5 seconds, then goes back down to 40.

3) What is happening/not happening?
After the switch is closed and remains closed, the bulb brightness will go up to 100% for 5 seconds, come down briefly for a second, then go back up to 100%.

What I am trying to do is setup a piston so that when someone opens my back door, the light increases in brightness, but I don’t want the timer to start until the door has closed. I realize I probably did not code this in the most efficient manner, and welcome suggestions on how to make it more efficient.

4) Post a Green Snapshot of the pistonimage

5) Attach any logs (From ST IDE and by turning logging level to Full)
12/1/2017, 11:20:11 PM +977ms

Click to expand

+1ms ╔Received event [Door-back-light].level = 100 with a delay of 83ms
+139ms ║RunTime Analysis CS > 18ms > PS > 48ms > PE > 73ms > CE
+149ms ║Runtime (40884 bytes) successfully initialized in 48ms (v0.2.0ff.20171129) (147ms)
+149ms ║╔Execution stage started
+161ms ║║Comparison (enum) closed is (string) open = false (1ms)
+162ms ║║Condition #7 evaluated false (9ms)
+169ms ║║Comparison (enum) on is (string) on = true (1ms)
+170ms ║║Condition #8 evaluated true (8ms)
+171ms ║║Condition group #1 evaluated true (state did not change) (18ms)
+173ms ║║Cancelling statement #2’s schedules…
+195ms ║║Executed physical command [Door-back-light].setLevel([100]) (19ms)
+195ms ║║Executed [Door-back-light].setLevel (20ms)
+198ms ║║Executed virtual command [Door-back-light].wait (0ms)
+199ms ║║Requesting a wake up for Fri, Dec 1 2017 @ 11:20:17 PM EST (in 5.0s)
+202ms ║╚Execution stage complete. (53ms)
+203ms ║Setting up scheduled job for Fri, Dec 1 2017 @ 11:20:17 PM EST (in 4.997s)
+317ms ╚Event processed successfully (317ms)
12/1/2017, 11:20:11 PM +163ms
+0ms ╔Received event [My Home].time = 1512188412769 with a delay of -1607ms
+203ms ║RunTime Analysis CS > 20ms > PS > 89ms > PE > 95ms > CE
+217ms ║Runtime (40888 bytes) successfully initialized in 89ms (v0.2.0ff.20171129) (214ms)
+218ms ║╔Execution stage started
+238ms ║║Skipped execution of physical command [Door-back-light].setLevel([40]) because it would make no change to the device. (5ms)
+239ms ║║Executed [Door-back-light].setLevel (6ms)
+242ms ║╚Execution stage complete. (24ms)
+251ms ╚Event processed successfully (250ms)
12/1/2017, 11:20:07 PM +602ms
+0ms ╔Received event [Door-back-light].level = 40 with a delay of 57ms
+114ms ║RunTime Analysis CS > 11ms > PS > 33ms > PE > 70ms > CE
+124ms ║Runtime (40883 bytes) successfully initialized in 33ms (v0.2.0ff.20171129) (123ms)
+124ms ║╔Execution stage started
+135ms ║║Comparison (enum) closed is (string) open = false (1ms)
+136ms ║║Condition #7 evaluated false (8ms)
+143ms ║║Comparison (enum) on is (string) on = true (1ms)
+144ms ║║Condition #8 evaluated true (7ms)
+145ms ║║Condition group #1 evaluated true (state did not change) (16ms)
+146ms ║║Cancelling statement #2’s schedules…
+163ms ║║Executed physical command [Door-back-light].setLevel([100]) (14ms)
+164ms ║║Executed [Door-back-light].setLevel (14ms)
+166ms ║║Executed virtual command [Door-back-light].wait (1ms)
+167ms ║║Requesting a wake up for Fri, Dec 1 2017 @ 11:20:12 PM EST (in 5.0s)
+170ms ║╚Execution stage complete. (46ms)
+171ms ║Setting up scheduled job for Fri, Dec 1 2017 @ 11:20:12 PM EST (in 4.996s)
+190ms ╚Event processed successfully (190ms)
12/1/2017, 11:20:03 PM +196ms
+1ms ╔Received event [My Home].time = 1512188404293 with a delay of -1098ms
+154ms ║RunTime Analysis CS > 16ms > PS > 42ms > PE > 96ms > CE
+172ms ║Runtime (40888 bytes) successfully initialized in 42ms (v0.2.0ff.20171129) (170ms)
+173ms ║╔Execution stage started
+204ms ║║Executed physical command [Door-back-light].setLevel([40]) (18ms)
+205ms ║║Executed [Door-back-light].setLevel (18ms)
+207ms ║╚Execution stage complete. (34ms)
+216ms ╚Event processed successfully (216ms)
12/1/2017, 11:19:59 PM +96ms
+1ms ╔Received event [Door-back-light].level = 100 with a delay of 79ms
+127ms ║RunTime Analysis CS > 17ms > PS > 38ms > PE > 73ms > CE
+138ms ║Runtime (40884 bytes) successfully initialized in 38ms (v0.2.0ff.20171129) (137ms)
+139ms ║╔Execution stage started
+149ms ║║Comparison (enum) closed is (string) open = false (1ms)
+151ms ║║Condition #7 evaluated false (8ms)
+171ms ║║Comparison (enum) on is (string) on = true (1ms)
+172ms ║║Condition #8 evaluated true (21ms)
+173ms ║║Condition group #1 evaluated true (state did not change) (30ms)
+175ms ║║Cancelling statement #2’s schedules…
+192ms ║║Executed physical command [Door-back-light].setLevel([100]) (14ms)
+193ms ║║Executed [Door-back-light].setLevel (16ms)
+195ms ║║Executed virtual command [Door-back-light].wait (0ms)
+196ms ║║Requesting a wake up for Fri, Dec 1 2017 @ 11:20:04 PM EST (in 5.0s)
+200ms ║╚Execution stage complete. (61ms)
+201ms ║Setting up scheduled job for Fri, Dec 1 2017 @ 11:20:04 PM EST (in 4.997s)
+221ms ╚Event processed successfully (221ms)
12/1/2017, 11:19:58 PM +60ms
+1ms ╔Received event [My Home].time = 1512188399908 with a delay of -1848ms
+130ms ║RunTime Analysis CS > 10ms > PS > 43ms > PE > 77ms > CE
+143ms ║Runtime (40888 bytes) successfully initialized in 43ms (v0.2.0ff.20171129) (141ms)
+144ms ║╔Execution stage started
+162ms ║║Skipped execution of physical command [Door-back-light].setLevel([40]) because it would make no change to the device. (6ms)
+162ms ║║Executed [Door-back-light].setLevel (7ms)
+164ms ║╚Execution stage complete. (21ms)
+173ms ╚Event processed successfully (173ms)
12/1/2017, 11:19:54 PM +678ms
+2ms ╔Received event [Door-back-light].level = 40 with a delay of 73ms
+164ms ║RunTime Analysis CS > 18ms > PS > 66ms > PE > 80ms > CE
+174ms ║Runtime (40883 bytes) successfully initialized in 66ms (v0.2.0ff.20171129) (172ms)
+175ms ║╔Execution stage started
+187ms ║║Comparison (enum) closed is (string) open = false (1ms)
+188ms ║║Condition #7 evaluated false (9ms)
+197ms ║║Comparison (enum) on is (string) on = true (1ms)
+198ms ║║Condition #8 evaluated true (8ms)
+198ms ║║Condition group #1 evaluated true (state did not change) (19ms)
+200ms ║║Cancelling statement #2’s schedules…
+224ms ║║Executed physical command [Door-back-light].setLevel([100]) (21ms)
+224ms ║║Executed [Door-back-light].setLevel (21ms)
+228ms ║║Executed virtual command [Door-back-light].wait (0ms)
+229ms ║║Requesting a wake up for Fri, Dec 1 2017 @ 11:19:59 PM EST (in 5.0s)
+233ms ║╚Execution stage complete. (59ms)
+234ms ║Setting up scheduled job for Fri, Dec 1 2017 @ 11:19:59 PM EST (in 4.997s)
+254ms ╚Event processed successfully (254ms)

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


#2

Your program keeps satisfying your first IF parameters:

Your light switch is ON, and it’s setting it to 40% (less than 100%) so it keeps triggering and repeating itself.

Let me know if you need a hand figuring it out beyond that!

Cheers!


#3

I think I have it now… Not 100% sure it is completely correct, but it seems to work.