[Resolved] Lighting auto turn off not working


#1

1) Give a description of the problem
The light never turns off

2) What is the expected behavior?
The light turns on when a presence changes to present, and then waits X minutes and turns off…

3) What is happening/not happening?
The light never turns off. I have tried with the variable, without, and added the never

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

Logs from WebCore

+1ms ╔Received event [Lauren].presence = present with a delay of 138ms
+196ms ║RunTime Analysis CS > 33ms > PS > 83ms > PE > 80ms > CE
+198ms ║Runtime (43594 bytes) successfully initialized in 83ms (v0.3.000.20180224) (196ms)
+199ms ║╔Execution stage started
+268ms ║║Comparison (time) 64590806 is_between (time) 1520207160000 … (time) 1520166240000 = true (8ms)
+269ms ║║Time restriction check passed
+271ms ║║Condition #1 evaluated true (68ms)
+272ms ║║Condition group #null evaluated true (state did not change) (69ms)
+319ms ║║Comparison (enum) present changes_to (string) present = true (0ms)
+322ms ║║Cancelling condition #6’s schedules…
+323ms ║║Condition #6 evaluated true (49ms)
+332ms ║║Comparison (enum) on is (string) off = false (1ms)
+333ms ║║Cancelling condition #7’s schedules…
+334ms ║║Condition #7 evaluated false (11ms)
+335ms ║║Condition group #2 evaluated false (state did not change) (60ms)
+343ms ║║Cancelling condition #13’s schedules…
+344ms ║║Condition #13 evaluated false (7ms)
+345ms ║║Condition group #8 evaluated false (state did not change) (8ms)
+353ms ║║Condition #18 evaluated false (5ms)
+354ms ║║Condition group #15 evaluated false (state did not change) (5ms)
+356ms ║╚Execution stage complete. (157ms)
+357ms ╚Event processed successfully (357ms)

#2

According to your logs, switch 17 was on when presence changed, so your piston never executed beyond line 26.


#3

Here is a longer log with the presence, the On, and the Off but it never actually turned off.

3/5/2018, 7:53:46 PM +223ms
+1ms ╔Received event [Porch Lights].switch = off with a delay of 130ms
+166ms ║RunTime Analysis CS > 26ms > PS > 58ms > PE > 81ms > CE
+169ms ║Runtime (43594 bytes) successfully initialized in 58ms (v0.3.000.20180224) (166ms)
+170ms ║╔Execution stage started
+218ms ║║Comparison (time) 71626398 is_between (time) 1520293680000 … (time) 1520252520000 = true (9ms)
+219ms ║║Time restriction check passed
+221ms ║║Condition #1 evaluated true (46ms)
+222ms ║║Condition group #null evaluated true (state did not change) (47ms)
+268ms ║║Condition #6 evaluated false (44ms)
+269ms ║║Condition group #2 evaluated false (state did not change) (45ms)
+276ms ║║Comparison (enum) off changes_to (string) on = false (1ms)
+278ms ║║Cancelling condition #13’s schedules…
+278ms ║║Condition #13 evaluated false (6ms)
+279ms ║║Condition group #8 evaluated false (state did not change) (7ms)
+286ms ║║Comparison (enum) off changes_to (string) off = true (1ms)
+288ms ║║Cancelling condition #18’s schedules…
+289ms ║║Condition #18 evaluated true (6ms)
+290ms ║║Cancelling condition #15’s schedules…
+291ms ║║Condition group #15 evaluated true (state changed) (8ms)
+293ms ║║Cancelling statement #16’s schedules…
+299ms ║║Executed virtual command [Porch Lights].setVariable (1ms)
+302ms ║╚Execution stage complete. (133ms)
+303ms ╚Event processed successfully (303ms)
3/5/2018, 7:39:43 PM +110ms
+2ms ╔Received event [Porch Lights].switch = on with a delay of 386ms
+210ms ║RunTime Analysis CS > 33ms > PS > 91ms > PE > 86ms > CE
+212ms ║Runtime (43593 bytes) successfully initialized in 91ms (v0.3.000.20180224) (209ms)
+214ms ║╔Execution stage started
+270ms ║║Comparison (time) 70783329 is_between (time) 1520293680000 … (time) 1520252520000 = true (9ms)
+271ms ║║Time restriction check passed
+273ms ║║Condition #1 evaluated true (54ms)
+274ms ║║Condition group #null evaluated true (state did not change) (55ms)
+591ms ║║Cancelling condition #6’s schedules…
+592ms ║║Condition #6 evaluated false (315ms)
+593ms ║║Cancelling condition #2’s schedules…
+594ms ║║Condition group #2 evaluated false (state changed) (317ms)
+600ms ║║Comparison (enum) on changes_to (string) on = true (1ms)
+602ms ║║Cancelling condition #13’s schedules…
+603ms ║║Condition #13 evaluated true (6ms)
+610ms ║║Comparison (boolean) false is (boolean) true = false (2ms)
+611ms ║║Condition #14 evaluated false (7ms)
+612ms ║║Condition group #8 evaluated false (state did not change) (16ms)
+619ms ║║Comparison (enum) on changes_to (string) off = false (0ms)
+621ms ║║Condition #18 evaluated false (6ms)
+622ms ║║Condition group #15 evaluated false (state did not change) (7ms)
+624ms ║╚Execution stage complete. (411ms)
+626ms ╚Event processed successfully (625ms)
3/5/2018, 7:39:41 PM +595ms
+2ms ╔Received event [Lauren].presence = present with a delay of 149ms
+193ms ║RunTime Analysis CS > 28ms > PS > 80ms > PE > 85ms > CE
+196ms ║Runtime (43600 bytes) successfully initialized in 80ms (v0.3.000.20180224) (193ms)
+197ms ║╔Execution stage started
+253ms ║║Comparison (time) 70781797 is_between (time) 1520293680000 … (time) 1520252520000 = true (9ms)
+255ms ║║Time restriction check passed
+256ms ║║Condition #1 evaluated true (55ms)
+257ms ║║Condition group #null evaluated true (state did not change) (56ms)
+305ms ║║Comparison (enum) present changes_to (string) present = true (0ms)
+309ms ║║Cancelling condition #6’s schedules…
+309ms ║║Condition #6 evaluated true (49ms)
+318ms ║║Comparison (enum) off is (string) off = true (2ms)
+320ms ║║Condition #7 evaluated true (10ms)
+321ms ║║Cancelling condition #2’s schedules…
+322ms ║║Condition group #2 evaluated true (state changed) (62ms)
+324ms ║║Cancelling statement #3’s schedules…
+329ms ║║Executed virtual command [Porch Lights].setVariable (1ms)
+364ms ║║Executed physical command [Porch Lights].on() (33ms)
+365ms ║║Executed [Porch Lights].on (34ms)
+375ms ║║Condition #13 evaluated false (7ms)
+376ms ║║Condition group #8 evaluated false (state did not change) (8ms)
+385ms ║║Condition #18 evaluated false (6ms)
+386ms ║║Condition group #15 evaluated false (state did not change) (7ms)
+388ms ║╚Execution stage complete. (192ms)
+389ms ╚Event processed successfully (389ms)


#4

You have set the variable value to False in the define section at the top of the piston, so every time the piston fires the variable resets to false (and the condition on line 38 will therefore never be true).

Change the ‘initial value’ of the variable to ‘nothing selected’, and your piston should work fine.


#5

When I try to do that, it automatically goes back to “False”. It only leaves it blank I create a new one piston???


#6

Don’t worry about that… it will say what it last was, but by not defining it at the top it wont automatically revert to false on every run.


#7

The light is turning off, but not from the variable… The motion is not setting the variable to true, any thoughts?


#8

I was able to fix with adding the “Never Cancel Task” on the first then statement line 27