I have setup a piston to control the lights in the kitchen, activated by a motion sensor with a lux restriction (Hue), but it is not quite right. It turns on properly but the 30 second timer activates as soon as motion stops and doesn’t reset to zero if i move again. So for example, if i don’t move for a few seconds, the 30 second timer begins. If i move 10 seconds later, the timer continues to count down from 30, it doesn’t zero the timer and consequently, the lights turn off and back on again, most immediately but sometimes with a delay of a few minutes.
I want the lights to turn off after a prolonged period of time - 30 seconds of no movement e.g. when i have left the room, rather than 30 seconds from the first time i didn’t move fore a few seconds.
Rather than the 30 seconds of no movement, it is counting down 30 seconds from when i stopped moving, regardless of whether i move a few seconds later.
06/09/2018, 20:05:47 +917ms
+1ms ╔Received event [Home].time = 1536260748244 with a delay of -328ms
+241ms ║RunTime Analysis CS > 19ms > PS > 50ms > PE > 172ms > CE
+244ms ║Runtime (38286 bytes) successfully initialized in 50ms (v0.3.107.20180806) (242ms)
+246ms ║╔Execution stage started
+306ms ║║Executed physical command [Kitchen - Back Hue color spot 1].off() (20ms)
+307ms ║║Executed [Kitchen - Back Hue color spot 1].off (23ms)
+330ms ║║Executed physical command [Kitchen - Back Hue color spot 2].off() (19ms)
+331ms ║║Executed [Kitchen - Back Hue color spot 2].off (21ms)
+352ms ║║Executed physical command [Kitchen - Back Hue color spot 3].off() (19ms)
+353ms ║║Executed [Kitchen - Back Hue color spot 3].off (21ms)
+373ms ║║Executed physical command [Kitchen - Forward Hue color spot 1].off() (16ms)
+374ms ║║Executed [Kitchen - Forward Hue color spot 1].off (19ms)
+397ms ║║Executed physical command [Kitchen - Forward Hue color spot 1].off() (20ms)
+398ms ║║Executed [Kitchen - Forward Hue color spot 1].off (22ms)
+424ms ║║Executed physical command [Kitchen - Forward Hue color spot 2].off() (22ms)
+425ms ║║Executed [Kitchen - Forward Hue color spot 2].off (25ms)
+446ms ║║Executed physical command [Kitchen - Under cabinet lights].off() (17ms)
+447ms ║║Executed [Kitchen - Under cabinet lights].off (19ms)
+450ms ║╚Execution stage complete. (205ms)
+452ms ╚Event processed successfully (452ms)
06/09/2018, 20:05:18 +54ms
+2ms ╔Received event [Hue Motion Sensor - Kitchen].motion = inactive with a delay of 75ms
+166ms ║RunTime Analysis CS > 19ms > PS > 38ms > PE > 109ms > CE
+168ms ║Runtime (38297 bytes) successfully initialized in 38ms (v0.3.107.20180806) (165ms)
+169ms ║╔Execution stage started
+177ms ║║Comparison (enum) inactive is (string) active = false (1ms)
+178ms ║║Cancelling condition #8’s schedules…
+179ms ║║Condition #8 evaluated false (6ms)
+180ms ║║Cancelling condition #1’s schedules…
+181ms ║║Condition group #1 evaluated false (state changed) (7ms)
+183ms ║║Cancelling statement #11’s schedules…
+189ms ║║Executed virtual command [Kitchen - Back Hue color spot 1, Kitchen - Back Hue color spot 2, Kitchen - Back Hue color spot 3, Kitchen - Forward Hue color spot 1, Kitchen - Forward Hue color spot 1, Kitchen - Forward Hue color spot 2, Kitchen - Under cabinet lights].wait (0ms)
+190ms ║║Requesting a wake up for Thu, Sep 6 2018 @ 8:05:48 PM BST (in 30.0s)
+194ms ║╚Execution stage complete. (25ms)
+195ms ║Setting up scheduled job for Thu, Sep 6 2018 @ 8:05:48 PM BST (in 29.996s)
+205ms ╚Event processed successfully (204ms)
06/09/2018, 20:04:48 +63ms
+1ms ╔Received event [Hue Motion Sensor - Kitchen].motion = active with a delay of 72ms
+140ms ║RunTime Analysis CS > 11ms > PS > 26ms > PE > 103ms > CE
+143ms ║Runtime (38302 bytes) successfully initialized in 26ms (v0.3.107.20180806) (140ms)
+144ms ║╔Execution stage started
+153ms ║║Comparison (enum) active is (string) active = true (2ms)
+154ms ║║Cancelling condition #8’s schedules…
+155ms ║║Condition #8 evaluated true (6ms)
+156ms ║║Cancelling condition #1’s schedules…
+157ms ║║Condition group #1 evaluated true (state changed) (8ms)
+167ms ║║Comparison (integer) 0 is_less_than_or_equal_to (integer) 15 = true (2ms)
+168ms ║║Condition #10 evaluated true (9ms)
+169ms ║║Condition group #6 evaluated true (state did not change) (10ms)
+170ms ║║Cancelling statement #6’s schedules…
+186ms ║║Executed physical command [Kitchen - Back Hue color spot 1].on() (12ms)
+187ms ║║Executed [Kitchen - Back Hue color spot 1].on (13ms)
+203ms ║║Executed physical command [Kitchen - Back Hue color spot 2].on() (14ms)
+204ms ║║Executed [Kitchen - Back Hue color spot 2].on (16ms)
+217ms ║║Executed physical command [Kitchen - Back Hue color spot 3].on() (11ms)
+217ms ║║Executed [Kitchen - Back Hue color spot 3].on (12ms)
+230ms ║║Executed physical command [Kitchen - Forward Hue color spot 1].on() (11ms)
+231ms ║║Executed [Kitchen - Forward Hue color spot 1].on (12ms)
+244ms ║║Executed physical command [Kitchen - Forward Hue color spot 1].on() (11ms)
+245ms ║║Executed [Kitchen - Forward Hue color spot 1].on (11ms)
+257ms ║║Executed physical command [Kitchen - Forward Hue color spot 2].on() (11ms)
+258ms ║║Executed [Kitchen - Forward Hue color spot 2].on (12ms)
+273ms ║║Executed physical command [Kitchen - Under cabinet lights].on() (13ms)
+274ms ║║Executed [Kitchen - Under cabinet lights].on (14ms)
+276ms ║╚Execution stage complete. (133ms)
+277ms ╚Event processed successfully (277ms)
06/09/2018, 20:02:59 +115ms
+1ms ╔Received event [Home].time = 1536260580977 with a delay of -1862ms
+168ms ║RunTime Analysis CS > 17ms > PS > 30ms > PE > 121ms > CE
+171ms ║Runtime (38287 bytes) successfully initialized in 30ms (v0.3.107.20180806) (169ms)
+172ms ║╔Execution stage started
+206ms ║║Executed physical command [Kitchen - Back Hue color spot 1].off() (13ms)
+207ms ║║Executed [Kitchen - Back Hue color spot 1].off (14ms)
+221ms ║║Executed physical command [Kitchen - Back Hue color spot 2].off() (12ms)
+222ms ║║Executed [Kitchen - Back Hue color spot 2].off (13ms)
+237ms ║║Executed physical command [Kitchen - Back Hue color spot 3].off() (12ms)
+237ms ║║Executed [Kitchen - Back Hue color spot 3].off (13ms)
+250ms ║║Executed physical command [Kitchen - Forward Hue color spot 1].off() (11ms)
+251ms ║║Executed [Kitchen - Forward Hue color spot 1].off (12ms)
+264ms ║║Executed physical command [Kitchen - Forward Hue color spot 1].off() (12ms)
+265ms ║║Executed [Kitchen - Forward Hue color spot 1].off (13ms)
+280ms ║║Executed physical command [Kitchen - Forward Hue color spot 2].off() (13ms)
+281ms ║║Executed [Kitchen - Forward Hue color spot 2].off (14ms)
+294ms ║║Executed physical command [Kitchen - Under cabinet lights].off() (12ms)
+295ms ║║Executed [Kitchen - Under cabinet lights].off (13ms)
+298ms ║╚Execution stage complete. (126ms)
+299ms ╚Event processed successfully (299ms)
06/09/2018, 20:02:30 +839ms
+1ms ╔Received event [Hue Motion Sensor - Kitchen].motion = inactive with a delay of 64ms
+102ms ║RunTime Analysis CS > 17ms > PS > 36ms > PE > 49ms > CE
+105ms ║Runtime (38296 bytes) successfully initialized in 36ms (v0.3.107.20180806) (102ms)
+106ms ║╔Execution stage started
+118ms ║║Comparison (enum) inactive is (string) active = false (2ms)
+120ms ║║Cancelling condition #8’s schedules…
+121ms ║║Condition #8 evaluated false (9ms)
+123ms ║║Cancelling condition #1’s schedules…
+124ms ║║Condition group #1 evaluated false (state changed) (11ms)
+127ms ║║Cancelling statement #11’s schedules…
+136ms ║║Executed virtual command [Kitchen - Back Hue color spot 1, Kitchen - Back Hue color spot 2, Kitchen - Back Hue color spot 3, Kitchen - Forward Hue color spot 1, Kitchen - Forward Hue color spot 1, Kitchen - Forward Hue color spot 2, Kitchen - Under cabinet lights].wait (1ms)
+137ms ║║Requesting a wake up for Thu, Sep 6 2018 @ 8:03:00 PM BST (in 30.0s)
+143ms ║╚Execution stage complete. (38ms)
+145ms ║Setting up scheduled job for Thu, Sep 6 2018 @ 8:03:00 PM BST (in 29.994s)
+154ms ╚Event processed successfully (154ms)
If a solution is found for your question then please mark the post as the solution.