Lights not turning off after motion sensor inactivity period


#1
  1. Give a description of the problem**
    The lights are not turning off after the motion sensor goes inactive for 10 seconds.

  2. What is the expected behaviour?**
    After the office motion sensor goes inactive all of the office lights should turn off.

  3. What is happening/not happening?**
    The lights are not turning off after the motion sensor goes inactive for 10 seconds.

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

  5. Attach logs after turning logging level to Full**

    1/3/2022, 4:46:52 PM +842ms
    +2ms ╔Received event [Motion - Office].motion = inactive with a delay of 35ms, canQueue: true, calledMyself: false
    +30ms ║RunTime initialize > 29 LockT > 1ms > rtDT > 1ms > pistonT > 0ms (first state access 27 3 26)
    +32ms ║Runtime (9061 bytes) successfully initialized in 1ms (v0.3.113.20211120_HE)
    +33ms ║╔Execution stage started
    +97ms ║║Device missing from piston. Loading all from parent (60ms)
    +101ms ║║Comparison (enum) inactive changes_to (string) active = false (1ms)
    +103ms ║║Cancelling condition #2’s schedules…
    +104ms ║║Condition #2 evaluated false (68ms)
    +106ms ║║Cancelling condition #1’s schedules…
    +107ms ║║Condition group #1 evaluated false (state changed) (71ms)
    +112ms ║║Condition #6 evaluated false (3ms)
    +114ms ║║Condition group #5 evaluated false (state did not change) (4ms)
    +120ms ║║Comparison (enum) present is (string) present = true (2ms)
    +122ms ║║Condition #8 evaluated true (5ms)
    +127ms ║║Comparison (enum) inactive is (string) active = false (1ms)
    +128ms ║║Cancelling condition #10’s schedules…
    +130ms ║║Condition #10 evaluated false (7ms)
    +134ms ║║Comparison (enum) present is (string) present = true (2ms)
    +136ms ║║Condition #11 evaluated true (5ms)
    +137ms ║║Condition group #9 evaluated true (state did not change) (14ms)
    +138ms ║║Condition group #7 evaluated true (state did not change) (22ms)
    +149ms ║║Comparison (time) 60412000 is_between (time) 24720000 … (time) 82800000 = true (8ms)
    +150ms ║║Time restriction check passed
    +152ms ║║Condition #13 evaluated true (12ms)
    +153ms ║║Condition group #12 evaluated true (state did not change) (13ms)
    +154ms ║║Cancelling statement #14’s schedules…
    +159ms ║║Skipped execution of physical command [Light - Office Recessed].on([]) because it would make no change to the device. (1ms)
    +159ms ║║Executed [Light - Office Recessed].on (3ms)
    +165ms ║║Skipped execution of physical command [Light - Office Recessed].setLevel([30]) because it would make no change to the device. (1ms)
    +166ms ║║Executed [Light - Office Recessed].setLevel (2ms)
    +167ms ║║Cancelling statement #17’s schedules…
    +175ms ║║Skipped execution of physical command [Light - BenQ Desk Light].on([]) because it would make no change to the device. (4ms)
    +176ms ║║Executed [Light - BenQ Desk Light].on (6ms)
    +178ms ║║Cancelling statement #19’s schedules…
    +184ms ║║Skipped execution of physical command [Light - Office Floor Lamp].setLevel([70]) because it would make no change to the device. (1ms)
    +185ms ║║Executed [Light - Office Floor Lamp].setLevel (2ms)
    +208ms ║║Executed physical command [Light - Office Floor Lamp].setColorTemperature(2800) (18ms)
    +209ms ║║Executed [Light - Office Floor Lamp].setColorTemperature (19ms)
    +218ms ║║Comparison (string) false is (boolean) true = false (1ms)
    +219ms ║║Cancelling condition #23’s schedules…
    +220ms ║║Condition #23 evaluated false (8ms)
    +221ms ║║Condition group #22 evaluated false (state did not change) (9ms)
    +225ms ║╚Execution stage complete. (192ms)
    +227ms ╚Event processed successfully (226ms)
    1/3/2022, 4:46:22 PM +936ms
    +2ms ╔Received event [Motion - Office].motion = active with a delay of 37ms, canQueue: true, calledMyself: false
    +121ms ║Device missing from piston. Loading all from parent (49ms)
    +127ms ║RunTime initialize > 126 LockT > 1ms > rtDT > 102ms > pistonT > 101ms (first state access 23 3 123)
    +130ms ║Runtime (12854 bytes) successfully initialized in 102ms (v0.3.113.20211120_HE)
    +131ms ║╔Execution stage started
    +136ms ║║Comparison (enum) active changes_to (string) active = true (1ms)
    +138ms ║║Cancelling condition #2’s schedules…
    +139ms ║║Condition #2 evaluated true (5ms)
    +140ms ║║Cancelling condition #1’s schedules…
    +141ms ║║Condition group #1 evaluated true (state changed) (8ms)
    +143ms ║║Cancelling statement #3’s schedules…
    +147ms ║║Executed virtual command setVariable (1ms)
    +151ms ║║Condition #6 evaluated false (2ms)
    +152ms ║║Condition group #5 evaluated false (state did not change) (3ms)
    +157ms ║║Comparison (enum) present is (string) present = true (1ms)
    +159ms ║║Condition #8 evaluated true (4ms)
    +163ms ║║Comparison (enum) active is (string) active = true (0ms)
    +164ms ║║Cancelling condition #10’s schedules…
    +165ms ║║Condition #10 evaluated true (6ms)
    +167ms ║║Condition group #9 evaluated true (state did not change) (7ms)
    +168ms ║║Condition group #7 evaluated true (state did not change) (14ms)
    +179ms ║║Comparison (time) 60383000 is_between (time) 24720000 … (time) 82800000 = true (8ms)
    +180ms ║║Time restriction check passed
    +182ms ║║Condition #13 evaluated true (12ms)
    +183ms ║║Condition group #12 evaluated true (state did not change) (14ms)
    +184ms ║║Cancelling statement #14’s schedules…
    +201ms ║║Executed physical command [Light - Office Recessed].on() (13ms)
    +202ms ║║Executed [Light - Office Recessed].on (15ms)
    +217ms ║║Executed physical command [Light - Office Recessed].setLevel(30) (10ms)
    +218ms ║║Executed [Light - Office Recessed].setLevel (12ms)
    +220ms ║║Cancelling statement #17’s schedules…
    +235ms ║║Executed physical command [Light - BenQ Desk Light].on() (11ms)
    +236ms ║║Executed [Light - BenQ Desk Light].on (13ms)
    +238ms ║║Cancelling statement #19’s schedules…
    +262ms ║║Executed physical command [Light - Office Floor Lamp].setLevel(70) (20ms)
    +263ms ║║Executed [Light - Office Floor Lamp].setLevel (21ms)
    +288ms ║║Executed physical command [Light - Office Floor Lamp].setColorTemperature(2800) (18ms)
    +289ms ║║Executed [Light - Office Floor Lamp].setColorTemperature (20ms)
    +298ms ║║Comparison (string) true is (boolean) true = true (2ms)
    +299ms ║║Cancelling condition #23’s schedules…
    +300ms ║║Condition #23 evaluated true (7ms)
    +305ms ║║Comparison (enum) active is (string) inactive = false (2ms)
    +307ms ║║Cancelling condition #24’s schedules…
    +309ms ║║Condition #24 evaluated false (7ms)
    +310ms ║║Condition group #22 evaluated false (state did not change) (17ms)
    +316ms ║╚Execution stage complete. (185ms)
    +319ms ╚Event processed successfully (318ms)

    Clear

    Full


#2

Try it like this… (untested)


#3

Thanks, I tried something similar (without a variable) and here’s the problem I had (and have with your example): The lights do go on with motion, and turn off with inactivity. However, if I immediately re-trigger motion then it’s very hit and miss if the first async lights (ceiling lights) turn back on. The second and third set of lights always come on when re-triggered. If I wait about 5 seconds to re-trigger after they turn off, all lights DO come on. Ideas?


#4

Try disabling command optimization for the piston under the piston settings.


#5

Ah ha! I think that solved it…did several cycles and the ALL lights came right back on. THANK YOU!