Help me fix this please!


#1

1) Give a description of the problem
Piston does not run whatsoever.

2) What is the expected behavior?
I’d like for my porch light dimmer to be ramped up to 100% from 30% when the doorbell is pressed or senses motion between 7pm and 12:01am. Then revert back to 30% after 5 minutes of inactivity.

3) What is happening/not happening?
Absolutely nothing!

4) Post a Green Snapshot of the pistonimage


#2

Most likely, it is the combination of:

button #1 gets pushed
and
motion sensor 1 changes to active

I bet the motion sensor has already detected motion long before the button is pushed. perhaps try motion sensor is active.

Also, you can use time is between 7pm and 12:01am and simplify those two lines to one.

try clicking trace and it will give you a clearer picture of where your piston is failing. :slight_smile:


#3

Ok with this everything works except the porch light doesn’t return to 30% it just turns off


#4

Was it off before? You’re restoring the switch setting from whatever it was when the piston ran initially.


#5

No it was set at 30% before I went and rang the doorbell. It then ramped up to 100%, waited one minute, then turned off?


#6

Can you set logging to full, re-run your experiment, then post the logs here? Can figure out what’s happening then.


#7

12/30/2017, 9:39:44 PM +275ms
+2ms ╔Received event [Doorbell].motion = inactive with a delay of 75ms
+10120ms ║RunTime Analysis CS > 27ms > PS > 10067ms > PE > 26ms > CE
+10121ms ║Piston waited at a semaphore for 10026ms
+10123ms ║Runtime (38173 bytes) successfully initialized in 10067ms (v0.2.101.20171227) (10120ms)
+10124ms ║╔Execution stage started
+10135ms ║║Comparison (time) 77994403 is_between (time) 68400000 … (time) 60000 = true (5ms)
+10136ms ║║Time restriction check passed
+10138ms ║║Condition #7 evaluated true (10ms)
+10146ms ║║Condition #9 evaluated false (7ms)
+10149ms ║║Comparison (enum) inactive changes_to (string) active = false (0ms)
+10151ms ║║Condition #10 evaluated false (3ms)
+10151ms ║║Condition group #8 evaluated false (state did not change) (12ms)
+10152ms ║║Condition group #1 evaluated false (state did not change) (24ms)
+10154ms ║╚Execution stage complete. (31ms)
+10155ms ╚Event processed successfully (10155ms)
12/30/2017, 9:39:44 PM +256ms
+1ms ╔Received event [Doorbell].button = Ready with a delay of 72ms
+95ms ║RunTime Analysis CS > 27ms > PS > 44ms > PE > 25ms > CE
+97ms ║Runtime (38084 bytes) successfully initialized in 44ms (v0.2.101.20171227) (95ms)
+98ms ║╔Execution stage started
+112ms ║║Comparison (time) 77984359 is_between (time) 68400000 … (time) 60000 = true (6ms)
+113ms ║║Time restriction check passed
+114ms ║║Condition #7 evaluated true (11ms)
+118ms ║║Comparison (enum) Ready gets (string) pushed = false (0ms)
+120ms ║║Cancelling condition #9’s schedules…
+120ms ║║Condition #9 evaluated false (5ms)
+128ms ║║Condition #10 evaluated false (7ms)
+129ms ║║Cancelling condition #8’s schedules…
+130ms ║║Condition group #8 evaluated false (state changed) (15ms)
+131ms ║║Cancelling condition #1’s schedules…
+132ms ║║Condition group #1 evaluated false (state changed) (28ms)
+134ms ║╚Execution stage complete. (36ms)
+135ms ╚Event processed successfully (135ms)
12/30/2017, 9:39:14 PM +243ms
+2ms ╔Received event [Doorbell].button = pushed with a delay of 69ms
+78ms ║RunTime Analysis CS > 16ms > PS > 41ms > PE > 21ms > CE
+80ms ║Runtime (38090 bytes) successfully initialized in 41ms (v0.2.101.20171227) (78ms)
+81ms ║╔Execution stage started
+93ms ║║Comparison (time) 77954329 is_between (time) 68400000 … (time) 60000 = true (5ms)
+94ms ║║Time restriction check passed
+96ms ║║Condition #7 evaluated true (10ms)
+103ms ║║Comparison (enum) pushed gets (string) pushed = true (3ms)
+104ms ║║Cancelling condition #9’s schedules…
+105ms ║║Condition #9 evaluated true (7ms)
+105ms ║║Cancelling condition #8’s schedules…
+106ms ║║Condition group #8 evaluated true (state changed) (9ms)
+107ms ║║Cancelling condition #1’s schedules…
+108ms ║║Condition group #1 evaluated true (state changed) (22ms)
+110ms ║║Cancelling statement #2’s schedules…
+120ms ║║Executed virtual command [Porch Light].saveStateLocally (6ms)
+179ms ║║Executed physical command [Porch Light].setLevel([100]) (56ms)
+180ms ║║Executed [Porch Light].setLevel (57ms)
+183ms ║║Executed virtual command [Porch Light].wait (0ms)
+184ms ║║Requesting a wake up for Sat, Dec 30 2017 @ 9:40:14 PM EST (in 60.0s)
+188ms ║╚Execution stage complete. (107ms)
+189ms ║Setting up scheduled job for Sat, Dec 30 2017 @ 9:40:14 PM EST (in 59.996s)
+194ms ╚Event processed successfully (194ms)
Clear Full


#8

I don’t see where the piston fired a minute after it stored the switch and levels… returning the lights to their original state. Did it execute that step?

If not, I have a feeling the subsequent piston runs are cancelling pending tasks and there’s a simple way to fix that.


#9

Sorry I’m a complete noob to this and I’m lost :cold_sweat:


#10

No problem! Let’s start with figuring out if the piston run completed. You rang the doorbell at 9:39:14 and triggered the piston. If it completed, after 1 minute it should have woke up and restored the values.

In the log, is there an action from 9:40:14 or anywhere near it? It should show that it was triggered by [Home].time


#11

12/30/2017, 9:40:13 PM +312ms
+1ms ╔Received event [The McElroy Home].time = 1514688014428 with a delay of -1116ms


#12

Ok, perfect… so it did complete. What is the rest of that section of the log? It should show what it returned the switches and values to for the light(s).


#13
+1ms ╔Received event [The McElroy Home].time = 1514688014428 with a delay of -1116ms
+230ms ║RunTime Analysis CS > 49ms > PS > 26ms > PE > 154ms > CE
+233ms ║Runtime (38108 bytes) successfully initialized in 26ms (v0.2.101.20171227) (231ms)
+234ms ║╔Execution stage started
+235ms ║╚Execution stage complete. (1ms)
+237ms ╚Event processed successfully (237ms)

#14

Interesting, so it didn’t restore anything. I think we can fix this by changing the task cancellation policy.

Edit your piston and click on the WITH statement, then click on the gear cog to expand the settings section. In this screen, look for Task Cancellation Policy and change it to “Never Cancel Tasks”. Then try your experiment again:


#15

Sorry the kiddos were ready for bed last night so had to leave! But thank you for your help that finally got it working the way I was intending!


#16

No worries, I know the kiddos run the household! Glad you were able to get it working!