OK, it looks like it might be my own code that is turning off the light and triggering the event, but if so it is doing it without logging it and setting a variable. But the logs say the device itself was the source of the off event (see end of post)
In the code below, I’m turning the light off on line 141, but lines 136 and 137 don’t seem to be executing when that happens, if indeed I did turn it off.
Here is a log showing that the “manual override” was triggered because my piston thinks it didn’t turn off the light in the last 10 seconds:
4/15/2018, 12:02:23 AM +828ms
+2ms ╔Received event [Office Lights].switch = off with a delay of 106ms
+9910ms ║Piston waited at a semaphore for 9686ms
+9968ms ║manual override enabled, next is last_on_off_action
+9976ms ║Sat, Apr 14 2018 @ 11:53:55 PM EDT
+9980ms ║Setting up scheduled job for Sun, Apr 15 2018 @ 12:02:54 AM EDT (in 20.513s)
+10032ms ╚Event processed successfully (10031ms)
4/15/2018, 12:02:23 AM +373ms
+0ms ╔Received event [Home].time = 1523764944320 with a delay of -948ms
+459ms ║Setting up scheduled job for Sun, Apr 15 2018 @ 12:02:54 AM EDT (in 30.489s)
+483ms ╚Event processed successfully (483ms)
4/15/2018, 12:01:53 AM +347ms
+1ms ╔Received event [Home].time = 1523764914320 with a delay of -973ms
+1489ms ║Setting up scheduled job for Sun, Apr 15 2018 @ 12:02:24 AM EDT (in 29.485s)
+1510ms ╚Event processed successfully (1510ms)
Here is the event log from the device. Note how it is decreasing by 10% increments and then it is turned off. But the dim events show they were from webCoRE while the device off doesn’t.
2018-04-15 12:02:23.732 AM EDT
moments ago DEVICE level 0 Office Lights level is 0%
2018-04-15 12:02:23.722 AM EDT
moments ago DEVICE switch off Office Lights switch is off
2018-04-15 12:02:23.710 AM EDT
moments ago APP_COMMAND setLevel Motion-Controlled Lighting (BETA) sent setLevel command to Office Lights
2018-04-15 12:01:53.887 AM EDT
moments ago DEVICE level 10 Office Lights level is 10%
2018-04-15 12:01:53.711 AM EDT
moments ago APP_COMMAND setLevel Motion-Controlled Lighting (BETA) sent setLevel command to Office Lights
2018-04-15 12:01:24.850 AM EDT
moments ago DEVICE level 20 Office Lights level is 20%
2018-04-15 12:01:24.832 AM EDT
moments ago APP_COMMAND setLevel Motion-Controlled Lighting (BETA) sent setLevel command to Office Lights
2018-04-15 12:00:55.090 AM EDT
moments ago DEVICE level 30 Office Lights level is 30%
2018-04-15 12:00:54.945 AM EDT
moments ago APP_COMMAND setLevel Motion-Controlled Lighting (BETA) sent setLevel command to Office Lights
2018-04-15 12:00:23.935 AM EDT
moments ago DEVICE level 40 Office Lights level is 40%
For the actual “device off” command at the top, it says the source was the device itself:
|archivable|true|
|---|---|
|date|2018-04-15 12:02:23.722 AM EDT (2018-04-15T04:02:23.722Z)|
|description|Office Lights switch is off|
|deviceId|8fc2bdc4-dc20-441c-9d47-766f6e4962c6|
|deviceTypeId|daf68621-7eb5-4b53-b623-8e9b928ad2e8|
|displayed|true|
|eventSource|DEVICE|
|groupId|0f320ae6-c7e5-47f8-9bcb-37c13d33f493|
|hubId|9bda3e82-2df2-4fd2-b9c9-cb07ce0b4c37|
|id|cd6c1ca0-4061-11e8-ae5e-0afffbc54be2|
|isStateChange|true|
|isVirtualHub|false|
|linkText|Office Lights|
|locationId|019ca1dc-4c6d-4893-acb8-9dbd940fa6f6|
|name|switch|
|rawDescription||
|translatable|false|
|unixTime|1523764943722|
|value|off|
|viewed|false|