Adding Time Element To A Piston


#1

1) Give a description of the problem
Light still comes on outside of time variable

2) What is the expected behavior?
Light not to turn on until 6 PM

3) What is happening/not happening?
Light comes on regardless of time as long as potion is detected

Received event [Playroom Motion].motion = inactive with a delay of 999ms
+36ms ║RunTime Analysis CS > 10ms > PS > 13ms > PE > 13ms > CE
+38ms ║Runtime (37045 bytes) successfully initialized in 13ms (v0.2.102.20180116) (36ms)
+38ms ║╔Execution stage started
+46ms ║║Comparison (enum) inactive changes_to (string) active = false (1ms)
+47ms ║║Cancelling condition #4’s schedules…
+48ms ║║Condition #4 evaluated false (5ms)
+49ms ║║Condition group #1 evaluated false (state did not change) (6ms)
+54ms ║║Comparison (enum) inactive changes_to (string) inactive = true (0ms)
+56ms ║║Cancelling condition #9’s schedules…
+56ms ║║Condition #9 evaluated true (5ms)
+57ms ║║Cancelling condition #5’s schedules…
+58ms ║║Condition group #5 evaluated true (state changed) (7ms)
+60ms ║║Cancelling statement #6’s schedules…
+64ms ║║Executed virtual command [Playroom Lamp].wait (1ms)
+65ms ║║Requesting a wake up for Sat, Feb 3 2018 @ 4:46:52 PM CST (in 1800.0s)
+69ms ║╚Execution stage complete. (31ms)
+71ms ║Setting up scheduled job for Sat, Feb 3 2018 @ 4:46:52 PM CST (in 1799.995s)
+78ms ╚Event processed successfully (79ms)
2/3/2018, 4:16:29 PM +25ms
+1ms ╔Received event [Playroom Motion].motion = active with a delay of 1039ms
+74ms ║RunTime Analysis CS > 28ms > PS > 25ms > PE > 22ms > CE
+76ms ║Runtime (37021 bytes) successfully initialized in 25ms (v0.2.102.20180116) (74ms)
+77ms ║╔Execution stage started
+85ms ║║Comparison (enum) active changes_to (string) active = true (1ms)
+86ms ║║Cancelling condition #4’s schedules…
+87ms ║║Condition #4 evaluated true (5ms)
+93ms ║║Comparison (time) 58589113 is_after (time) 64800000 = false (4ms)
+94ms ║║Condition #10 evaluated false (6ms)
+95ms ║║Condition group #1 evaluated false (state did not change) (13ms)
+100ms ║║Comparison (enum) active changes_to (string) inactive = false (0ms)
+102ms ║║Condition #9 evaluated false (3ms)
+102ms ║║Condition group #5 evaluated false (state did not change) (5ms)
+104ms ║╚Execution stage complete. (27ms)
+105ms ╚Event processed successfully (105ms)


#2

Can you post a green snapshot instead of a screenshot… also, turn logging to full and trigger some motion and post that as well.


#3

Done. I hope I added the log info in the correct manner.


#4

Is there a time window when you want the lights to turn on. Say 6pm to 11pm or 4am maybe.
If so I would suggest you change the time to a window.
So instead of Time is after 6pm.
Use Time is between 6pm and 4am.


#5

That’s a good suggestion and I’ve added that, but the light still comes on outside those hours as the piston is written.


#6

Can you type $time24 into an expression window and confirm your hub is setup for the correct time.

Green snapshot (green camera button on the piston overview page) would help.


#7

It may be a clash between conditions and triggers.

Try changing you piston to:

IF
motion IS active
AND
time IS between x and y
THEN
turn on
ELSE
wait 30 seconds
turn off


#8

Expression shows correct current time.

I tried your change and the lamp still turns on when I walk in the room and it’s not 6PM local yet.

2/3/2018, 4:51:34 PM +625ms
+1ms ╔Received event [Playroom Motion].motion = inactive with a delay of 459ms
+66ms ║RunTime Analysis CS > 18ms > PS > 27ms > PE > 22ms > CE
+68ms ║Runtime (37186 bytes) successfully initialized in 27ms (v0.2.102.20180116) (66ms)
+70ms ║╔Execution stage started
+80ms ║║Comparison (enum) inactive is (string) active = false (2ms)
+81ms ║║Cancelling condition #4’s schedules…
+82ms ║║Condition #4 evaluated false (6ms)
+83ms ║║Condition group #1 evaluated false (state did not change) (8ms)
+90ms ║║Comparison (enum) inactive changes_to (string) inactive = true (1ms)
+92ms ║║Cancelling condition #9’s schedules…
+92ms ║║Condition #9 evaluated true (5ms)
+94ms ║║Cancelling condition #5’s schedules…
+94ms ║║Condition group #5 evaluated true (state changed) (8ms)
+97ms ║║Cancelling statement #6’s schedules…
+103ms ║║Executed virtual command [Playroom Lamp].wait (0ms)
+104ms ║║Requesting a wake up for Sat, Feb 3 2018 @ 5:21:34 PM CST (in 1800.0s)
+109ms ║╚Execution stage complete. (40ms)
+111ms ║Setting up scheduled job for Sat, Feb 3 2018 @ 5:21:34 PM CST (in 1799.995s)
+121ms ╚Event processed successfully (120ms)
2/3/2018, 4:51:15 PM +209ms
+1ms ╔Received event [Playroom Motion].motion = active with a delay of 467ms
+61ms ║RunTime Analysis CS > 17ms > PS > 26ms > PE > 18ms > CE
+63ms ║Runtime (37182 bytes) successfully initialized in 26ms (v0.2.102.20180116) (61ms)
+64ms ║╔Execution stage started
+71ms ║║Comparison (enum) active is (string) active = true (1ms)
+73ms ║║Cancelling condition #4’s schedules…
+74ms ║║Condition #4 evaluated true (5ms)
+81ms ║║Comparison (time) 60675283 is_between (time) 64800000 … (time) 84600000 = false (5ms)
+83ms ║║Condition #10 evaluated false (8ms)
+83ms ║║Condition group #1 evaluated false (state did not change) (15ms)
+88ms ║║Comparison (enum) active changes_to (string) inactive = false (0ms)
+90ms ║║Cancelling condition #9’s schedules…
+90ms ║║Condition #9 evaluated false (4ms)
+91ms ║║Cancelling condition #5’s schedules…
+92ms ║║Condition group #5 evaluated false (state changed) (7ms)
+94ms ║╚Execution stage complete. (31ms)
+95ms ╚Event processed successfully (95ms)


#9

Your logs clearly show the piston being cancelled as time condition is not being met, no turn on command is being sent.

Are you sure it’s this piston sending the command? Check the recently tab for the device in the ST app to see what is turning it on… maybe you have an older piston or another automation still running.


#10

Good catch. I forget about another automation.


#11

Lol