Piston schedule days and time not firing as expected


#1

1) Give a description of the problem
I have a piston set to turn on an outlet M-F at 07:00 and Sa-Su at 08:30
In addition, the outlet is on for 4 hours, turn off the outlet

2) What is the expected behavior?
The piston fires and turns on the outlet M-F at 07:00 and Sa-Su at 08:30 and if the outlet is on for 4 hours, turn off the outlet

3) What is happening/not happening?
The piston is turning on the outlet at 07:00 and turning it off at 08:30

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

5) Attach any logs (From ST IDE and by turning logging level to Full)

 10/5/2017, 8:30:00 AM +31ms

+2ms â•”Received event [Switch 2].switch = off with a delay of 969ms
+140ms â•‘RunTime Analysis CS > 24ms > PS > 30ms > PE > 85ms > CE
+157ms â•‘Runtime (38275 bytes) successfully initialized in 30ms (v0.2.0ec.20170927) (153ms)
+159ms â•‘â•”Execution stage started
+175ms â•‘â•‘Comparison (time) 30600202 happens_daily_at (time) 25200000 = false (1ms)
+178ms â•‘â•‘Condition #4 evaluated false (7ms)
+181ms ║║Cancelling statement #4’s schedules…
+186ms â•‘â•‘Requesting time schedule wake up at Fri, Oct 6 2017 @ 7:00:00 AM EDT
+192ms â•‘â•‘Condition group #1 evaluated false (state did not change) (21ms)
+204ms â•‘â•‘Comparison (time) 30600230 happens_daily_at (time) 30600000 = false (1ms)
+209ms â•‘â•‘Condition #8 evaluated false (10ms)
+212ms ║║Cancelling statement #8’s schedules…
+220ms â•‘â•‘Requesting time schedule wake up at Fri, Oct 6 2017 @ 8:30:00 AM EDT
+226ms â•‘â•‘Condition group #5 evaluated false (state did not change) (28ms)
+243ms â•‘â•‘Comparison (enum) off stays (string) on = false (3ms)
+247ms â•‘â•‘Cancelling any timed trigger schedules for condition 12
+249ms ║║Cancelling statement #12’s schedules…
+251ms â•‘â•‘Condition #12 evaluated false (19ms)
+254ms â•‘â•‘Condition group #9 evaluated false (state did not change) (22ms)
+262ms ║╚Execution stage complete. (103ms)
+266ms â•‘Setting up scheduled job for Fri, Oct 6 2017 @ 7:00:00 AM EDT (in 80999.704s), with 1 more job pending
+461ms ╚Event processed successfully (460ms)
10/5/2017, 8:29:59 AM +204ms
+2ms â•”Received event [Rob].time = 1507206600000 with a delay of -798ms
+209ms â•‘RunTime Analysis CS > 38ms > PS > 86ms > PE > 86ms > CE
+226ms â•‘Runtime (38273 bytes) successfully initialized in 86ms (v0.2.0ec.20170927) (220ms)
+230ms â•‘â•”Execution stage started
+270ms â•‘â•‘Comparison (time) 30599458 happens_daily_at (time) 25200000 = false (9ms)
+275ms â•‘â•‘Condition #4 evaluated false (21ms)
+298ms ║║Cancelling statement #4’s schedules…
+311ms â•‘â•‘Requesting time schedule wake up at Fri, Oct 6 2017 @ 7:00:00 AM EDT
+322ms â•‘â•‘Condition group #1 evaluated false (state did not change) (69ms)
+339ms â•‘â•‘Comparison (time) 30599537 happens_daily_at (time) 30600000 = true (1ms)
+343ms â•‘â•‘Time restriction check failed
+348ms â•‘â•‘Condition #8 evaluated false (15ms)
+352ms ║║Cancelling statement #8’s schedules…
+360ms â•‘â•‘Requesting time schedule wake up at Fri, Oct 6 2017 @ 8:30:00 AM EDT
+370ms â•‘â•‘Condition group #5 evaluated false (state did not change) (39ms)
+421ms â•‘â•‘Comparison (enum) on stays (string) on = true (6ms)
+426ms ║║Cancelling condition #12’s schedules…
+429ms â•‘â•‘Condition #12 evaluated true (48ms)
+432ms ║║Cancelling condition #9’s schedules…
+434ms â•‘â•‘Condition group #9 evaluated true (state changed) (55ms)
+442ms ║║Cancelling statement #10’s schedules…
+480ms â•‘â•‘Executed physical command [Switch 2].off() (28ms)
+483ms â•‘â•‘Executed [Switch 2].off (33ms)
+497ms ║╚Execution stage complete. (269ms)
+502ms â•‘Setting up scheduled job for Thu, Oct 5 2017 @ 11:00:00 AM EDT (in 9000.321s), with 2 more jobs pending
+638ms ╚Event processed successfully (637ms)
10/5/2017, 6:59:59 AM +807ms
+1ms â•”Received event [Switch 2].switch = on with a delay of 467ms
+118ms â•‘RunTime Analysis CS > 23ms > PS > 28ms > PE > 67ms > CE
+133ms â•‘Runtime (38273 bytes) successfully initialized in 28ms (v0.2.0ec.20170927) (130ms)
+135ms â•‘â•”Execution stage started
+151ms â•‘â•‘Comparison (time) 25199954 happens_daily_at (time) 25200000 = false (0ms)
+154ms ║║Cancelling condition #4’s schedules…
+155ms â•‘â•‘Condition #4 evaluated false (9ms)
+158ms ║║Cancelling statement #4’s schedules…
+162ms â•‘â•‘Requesting time schedule wake up at Fri, Oct 6 2017 @ 7:00:00 AM EDT
+167ms ║║Cancelling condition #1’s schedules…
+169ms â•‘â•‘Condition group #1 evaluated false (state changed) (23ms)
+179ms â•‘â•‘Comparison (time) 25199982 happens_daily_at (time) 30600000 = false (1ms)
+182ms â•‘â•‘Condition #8 evaluated false (7ms)
+184ms ║║Cancelling statement #8’s schedules…
+188ms â•‘â•‘Requesting time schedule wake up at Thu, Oct 5 2017 @ 8:30:00 AM EDT
+193ms â•‘â•‘Condition group #5 evaluated false (state did not change) (19ms)
+212ms â•‘â•‘Comparison (enum) on stays (string) on = true (4ms)
+218ms â•‘â•‘Adding a timed trigger schedule for condition 12
+223ms â•‘â•‘Condition #12 evaluated false (24ms)
+225ms â•‘â•‘Condition group #9 evaluated false (state did not change) (27ms)
+233ms ║╚Execution stage complete. (98ms)
+237ms â•‘Setting up scheduled job for Thu, Oct 5 2017 @ 8:30:00 AM EDT (in 5399.957s), with 2 more jobs pending
+267ms ╚Event processed successfully (267ms)
10/5/2017, 6:59:59 AM +268ms
+1ms â•”Received event [Rob].time = 1507201200000 with a delay of -733ms
+121ms â•‘RunTime Analysis CS > 21ms > PS > 61ms > PE > 39ms > CE
+132ms â•‘Runtime (38274 bytes) successfully initialized in 61ms (v0.2.0ec.20170927) (130ms)
+134ms â•‘â•”Execution stage started
+157ms â•‘â•‘Comparison (time) 25199415 happens_daily_at (time) 25200000 = true (7ms)
+160ms â•‘â•‘Time restriction check passed
+162ms ║║Cancelling condition #4’s schedules…
+163ms â•‘â•‘Condition #4 evaluated true (17ms)
+165ms ║║Cancelling statement #4’s schedules…
+170ms â•‘â•‘Requesting time schedule wake up at Fri, Oct 6 2017 @ 7:00:00 AM EDT
+186ms â•‘â•‘Comparison (enum) off is (string) off = true (3ms)
+188ms â•‘â•‘Condition #13 evaluated true (13ms)
+189ms ║║Cancelling condition #1’s schedules…
+191ms â•‘â•‘Condition group #1 evaluated true (state changed) (44ms)
+195ms ║║Cancelling statement #2’s schedules…
+231ms â•‘â•‘Executed physical command [Switch 2].on() (33ms)
+233ms â•‘â•‘Executed [Switch 2].on (35ms)
+243ms â•‘â•‘Comparison (time) 25199507 happens_daily_at (time) 30600000 = false (1ms)
+245ms â•‘â•‘Condition #8 evaluated false (6ms)
+247ms ║║Cancelling statement #8’s schedules…
+251ms â•‘â•‘Requesting time schedule wake up at Thu, Oct 5 2017 @ 8:30:00 AM EDT
+255ms â•‘â•‘Condition group #5 evaluated false (state did not change) (17ms)
+272ms â•‘â•‘Comparison (enum) off stays (string) on = false (3ms)
+274ms â•‘â•‘Condition #12 evaluated false (14ms)
+276ms â•‘â•‘Condition group #9 evaluated false (state did not change) (16ms)
+281ms ║╚Execution stage complete. (148ms)
+284ms â•‘Setting up scheduled job for Thu, Oct 5 2017 @ 8:30:00 AM EDT (in 5400.449s), with 1 more job pending
+300ms ╚Event processed successfully (300ms)


#2

I’m not sure why it’s doing what you say, could have something to do with the structuring of the piston or the stays on for 4 hours condition?

Are you wanting the outlet to turn off if it’s been left on for 4 hours regardless of if it was turned on by that piston or via any other means?

Or are you only wanting it to turn off after 4 hours if it was turned on ONLY by that piston?

I’ll upload a differently structured version for you to try once I know how you want it to function, if that helps?


#3

Thought I would upload both versions for you anyway.

This one “should” Switch off the outlet after 4 hours no matter how it was switched on.

This one “should” switch off the outlet Only if it was switched on by this piston.


#4

Thank you for the examples. I was looking for OR and couldn’t find it.
I’ll mark as answered but I’ll try it out.

Kind regards,
-Rob


#5

Quick note on this. When I imported the Piston, the logs still show it will wake tomorrow at 08:30 which I wouldn’t expect to see.
I’ll try it out though. Looks much better than my Piston did :slight_smile:

Regards,
-Rob

10/5/2017, 1:33:04 PM +51ms
+1ms ╔Starting piston… (v0.2.0ec.20170927)
+250ms ║╔Subscribing to devices…
+265ms ║║Subscribing to Switch 2.switch…
+323ms ║╚Finished subscribing (76ms)
+352ms â•‘Comparison (time) 48784397 happens_daily_at (time) 25200000 = false (3ms)
+355ms ║Cancelling statement #8’s schedules…
+359ms â•‘Requesting time schedule wake up at Fri, Oct 6 2017 @ 7:00:00 AM EDT
+368ms â•‘Comparison (time) 48784415 happens_daily_at (time) 30600000 = false (2ms)
+372ms ║Cancelling statement #9’s schedules…
+376ms â•‘Requesting time schedule wake up at Fri, Oct 6 2017 @ 8:30:00 AM EDT
+397ms â•‘Comparison (enum) off is (string) on = false (2ms)
+409ms â•‘Setting up scheduled job for Fri, Oct 6 2017 @ 7:00:00 AM EDT (in 62815.542s), with 1 more job pending
+433ms ╚Piston successfully started (433ms)


#6

You have it set to turn on the outlet at 07:00 & 08:30
That will cause the piston to fire at both times but because there is a day restriction it will only execute the then command if the day is correct. So the logs should still show it scheduling an event for 08:30 but it should evaluate as false because it’s not Saturday or Sunday.


#7

And is the default but if you click on the word “and” in the piston editor you can change it. :grinning:


#8

@Baz2473 - Quick follow-up, everything is working great. I’ve also recreated some of my existing pistons based on the examples you provided.

Thank you so much for the quick and accurate replies!
-Rob