Need help, part of piston not firing


#1

1) Give a description of the problem
Part of the piston isn’t firing. The blocks not running are #1 and #22
Only blocks #37, #47 and #53 are running.
I’ve also noticed that I have the lightning bolt next to blocks #37, #47 and #53

Block #1 should run between 30 minutes before sunset and 10 pm. If motion is detected on either 2 motion sensors, set the level of the 3 lights to 100% and turn them on.

Block #22 runs between 10 pm and 5:30 am, but only on Sun, Mon, Tue, Wed or Thurs. If motion is detected on either 2 motion sensors, set the level of the 3 lights to 30% and turn them on. If no motion is detected on either 2 motion sensors, wait 3 minutes and turn them off

Block #37 turns the lights off at 10 pm, but only on Sun, Mon, Tues, Wed or Thur.
Block #47 will flash the lights at 10 pm only on Fri or Sat, for 5 seconds, change the level to 15%.
Block #53 will flash the lights at 8:30 pm only on Sun, Mon, Tues, Wed or Thur

I’ve tried creating a test piston with only blocks #1 and #22. In the test, they work fine.

2) What is the expected behavior?
Expect lights to turn on/off based on time and days of the week, along with the other blocks that are functioning.

3) What is happening/not happening?
Blocks #1 and #22 are not running at all, even when the time should trigger them.

**4) Post a Green Snapshot of the piston![image|45x37]

**
(UPLOAD YOUR IMAGE HERE)

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

+0ms ╔Received event [Home].test = 1537457968924 with a delay of 0ms
+182ms ║RunTime Analysis CS > 23ms > PS > 114ms > PE > 45ms > CE
+185ms ║Runtime (45114 bytes) successfully initialized in 114ms (v0.3.108.20180906) (184ms)
+187ms ║╔Execution stage started
+236ms ║║Comparison (time) 38369120 is_between (time) 1537488960000 … (time) 79200000 = false (17ms)
+239ms ║║Condition #19 evaluated false (43ms)
+240ms ║║Condition group #1 evaluated false (state did not change) (46ms)
+264ms ║║Comparison (time) 38369171 is_between (time) 79200000 … (time) 19800000 = false (14ms)
+266ms ║║Condition #57 evaluated false (21ms)
+268ms ║║Condition group #22 evaluated false (state did not change) (23ms)
+276ms ║║Comparison (time) 38369198 happens_daily_at (time) 79200000 = false (1ms)
+279ms ║║Condition #38 evaluated false (7ms)
+289ms ║║Cancelling statement #38’s schedules…
+294ms ║║Requesting time schedule wake up at Thu, Sep 20 2018 @ 10:00:00 PM CDT
+306ms ║║Condition group #37 evaluated false (state did not change) (33ms)
+315ms ║║Comparison (time) 38369236 happens_daily_at (time) 79200000 = false (1ms)
+318ms ║║Condition #48 evaluated false (7ms)
+323ms ║║Cancelling statement #48’s schedules…
+329ms ║║Requesting time schedule wake up at Thu, Sep 20 2018 @ 10:00:00 PM CDT
+333ms ║║Condition group #47 evaluated false (state did not change) (23ms)
+342ms ║║Comparison (time) 38369263 happens_daily_at (time) 73800000 = false (1ms)
+344ms ║║Condition #54 evaluated false (6ms)
+346ms ║║Cancelling statement #54’s schedules…
+351ms ║║Requesting time schedule wake up at Thu, Sep 20 2018 @ 8:30:00 PM CDT
+355ms ║║Condition group #53 evaluated false (state did not change) (17ms)
+394ms ║╚Execution stage complete. (207ms)
+405ms ║Setting up scheduled job for Thu, Sep 20 2018 @ 8:30:00 PM CDT (in 35430.672s), with 2 more jobs pending
+417ms ╚Event processed successfully (416ms)

#2

The numbers you mentioned are not in your attached picture, but I think I see what is going on here.

temp

I usually put the motion detect at the top level (far left with no indenting), and use time as a condition. This will create the lightning bolt next to the motion detect, and will only run that block of code if the time matches.


Like this:
temp

(also note I changed it to say if motion CHANGES TO active)


#3

I would change the first if (line 17) to a “only when”. this will run the 2nd if (line 20) in the first statement ‘only when’ the time falls between your range.

I would also do this for your second statement, starting on line 31.

if there is no lightning bolt next to the if statement, then it will not be triggered.


#4

That got it. Thanks for the help!