Motion sensor piston not firing when in the process of dimming


#1

1) Give a description of the problem
Wife is ready to dumb-down our smart house; replacing wife not a real option. This piston turns on with motion, then if it doesn’t detect motion for 30 seconds, dims then turns off… issue is, if motion resumes during the dimming period, it doesn’t come back on.

2) What is the expected behaviour?
restart the piston and go back to full brightness if motion is detected

3) What is happening/not happening?
continues to turn off instead of turning back on

4) Post a Green Snapshot of the pistonimage

5) Attach logs after turning logging level to Full
working remote so don’t have a valid log of this - but happens all the time:( I didn’t have the task cancellation policies int here initially, but added them hoping they’d help. they didn’t help. is there something wrong with my logic?

REMOVE BELOW AFTER READING
If a solution is found for your question then please mark the post as the solution.


#2

First thing is to pull that second IF on line 27 out as its own statement and not the ELSE of the first IF. After that I would change the trigger for that second IF to “stays inactive for x time” since that is the specific state you want it to reference.


#3

thanks i’ll try the two tips… Look better? What about the task cancellation policies?


#4

instead of WAIT you can also use FADE OUT.

FAID OUT to level 0 in 10 seconds


#5

I’ve tried that - this particular kitchen dimmer doesn’t like fadeout…


#6

I see…yeah sometimes they do that:)

is it working properly right now? because @SergL’s feedback was good.


#7

I just got home and did a quick test… so far so good.

I think in the past when I had it this way I had the opposite issue, where the light never turned off… but we’ll see…

Can I get some feedback on the task cancellation policies? Should that be set the way it is? My thinking is, if it’s in the middle of diming and motion is detected again, it should cancel out and start over / turn the lights on… or is that understood and not needed?

Thanks!


#8

Not even sure what policies you have messed with there, but I’d stick to the defaults. The TEP and TSP should be left alone and the TCP default should do what you want.

I like the look of this better. I prefer the ‘stays’ timed trigger on the top level where I just about understand it. Whether it will work is another matter, and definitely one to test rather than think about. The timed trigger is more complex than it might seem.


#9

for lights turning OFF i’d never use WAIT
but everyone’s needs are different.


#10

Normally, if you want to be able to cancel out of something, you want TCP set to default.


Personally, I would use a method like this, without any special settings or TCP.

With this method, any activity will cancel the wait, and go back to full brightness.
(lines 46+ should never run, but I added it as a safety net backup)


#11

So it just stayed dark for about a minute while we were moving around in that room:( log attached from past 5 minutes. I had taken out the TCP’s btw…

### Logs

2/20/2020, 7:48:16 PM +111ms
+0ms ╔Received event [Sunset Home].time = 1582256897976 with a delay of -1865ms
+161ms ║Runtime (38619 bytes) successfully initialized in 83ms (v0.3.110.20191009) (160ms)
+162ms ║╔Execution stage started
+163ms ║╚Execution stage complete. (1ms)
+164ms ╚Event processed successfully (164ms)
2/20/2020, 7:48:10 PM +253ms
+1ms ╔Received event [Kitchen Sensor].motion = active with a delay of 119ms
+131ms ║Runtime (38619 bytes) successfully initialized in 61ms (v0.3.110.20191009) (129ms)
+132ms ║╔Execution stage started
+158ms ║║Executed [Kitchen Dimmer].on (14ms)
+179ms ║║Executed [Kitchen Dimmer].setLevel (17ms)
+189ms ║╚Execution stage complete. (56ms)
+190ms ╚Event processed successfully (190ms)
2/20/2020, 7:47:57 PM +816ms
+1ms ╔Received event [Kitchen Sensor].motion = inactive with a delay of 117ms
+144ms ║Runtime (38616 bytes) successfully initialized in 63ms (v0.3.110.20191009) (141ms)
+145ms ║╔Execution stage started
+163ms ║╚Execution stage complete. (19ms)
+165ms ║Setting up scheduled job for Thu, Feb 20 2020 @ 7:48:17 PM PST (in 19.996s)
+176ms ╚Event processed successfully (176ms)
2/20/2020, 7:47:18 PM +101ms
+0ms ╔Received event [Sunset Home].time = 1582256839275 with a delay of -1175ms
+144ms ║Runtime (38618 bytes) successfully initialized in 67ms (v0.3.110.20191009) (142ms)
+145ms ║╔Execution stage started
+174ms ║║Executed [Kitchen Dimmer].off (14ms)
+177ms ║╚Execution stage complete. (32ms)
+179ms ╚Event processed successfully (179ms)
2/20/2020, 7:47:09 PM +80ms
+0ms ╔Received event [Sunset Home].time = 1582256830985 with a delay of -1905ms
+153ms ║Runtime (38623 bytes) successfully initialized in 67ms (v0.3.110.20191009) (152ms)
+154ms ║╔Execution stage started
+190ms ║║Executed [Kitchen Dimmer].setLevel (14ms)
+193ms ║║Executed virtual command [Kitchen Dimmer].wait (0ms)
+194ms ║║Requesting a wake up for Thu, Feb 20 2020 @ 7:47:19 PM PST (in 10.0s)
+198ms ║╚Execution stage complete. (44ms)
+200ms ║Setting up scheduled job for Thu, Feb 20 2020 @ 7:47:19 PM PST (in 9.996s)
+210ms ╚Event processed successfully (210ms)
2/20/2020, 7:47:08 PM +828ms
+1ms ╔Received event [Kitchen Sensor].motion = active with a delay of 114ms
+129ms ║Runtime (38619 bytes) successfully initialized in 61ms (v0.3.110.20191009) (127ms)
+130ms ║╔Execution stage started
+146ms ║║Executed [Kitchen Dimmer].on (5ms)
+154ms ║║Executed [Kitchen Dimmer].setLevel (6ms)
+163ms ║╚Execution stage complete. (33ms)
+164ms ╚Event processed successfully (164ms)
2/20/2020, 7:46:50 PM +833ms
+1ms ╔Received event [Kitchen Sensor].motion = inactive with a delay of 115ms
+137ms ║Runtime (38614 bytes) successfully initialized in 62ms (v0.3.110.20191009) (135ms)
+138ms ║╔Execution stage started
+155ms ║╚Execution stage complete. (17ms)
+157ms ║Setting up scheduled job for Thu, Feb 20 2020 @ 7:47:10 PM PST (in 19.996s)
+166ms ╚Event processed successfully (166ms)
2/20/2020, 7:46:33 PM +253ms
+1ms ╔Received event [Kitchen Sensor].motion = active with a delay of 105ms
+10144ms ║Piston waited at a semaphore for 10014ms
+10146ms ║Runtime (38689 bytes) successfully initialized in 10069ms (v0.3.110.20191009) (10144ms)
+10147ms ║╔Execution stage started
+10163ms ║║Executed [Kitchen Dimmer].on (4ms)
+10177ms ║║Executed [Kitchen Dimmer].setLevel (12ms)
+10187ms ║╚Execution stage complete. (40ms)
+10188ms ╚Event processed successfully (10189ms)
2/20/2020, 7:46:42 PM +96ms
+1ms ╔Received event [Sunset Home].time = 1582256803261 with a delay of -1165ms
+152ms ║Runtime (38618 bytes) successfully initialized in 75ms (v0.3.110.20191009) (150ms)
+153ms ║╔Execution stage started
+183ms ║║Executed [Kitchen Dimmer].off (15ms)
+185ms ║╚Execution stage complete. (32ms)
+186ms ╚Event processed successfully (186ms)
2/20/2020, 7:46:33 PM +73ms
+0ms ╔Received event [Sunset Home].time = 1582256794191 with a delay of -1119ms
+145ms ║Runtime (38623 bytes) successfully initialized in 67ms (v0.3.110.20191009) (144ms)
+146ms ║╔Execution stage started
+183ms ║║Executed [Kitchen Dimmer].setLevel (13ms)
+186ms ║║Executed virtual command [Kitchen Dimmer].wait (1ms)
+187ms ║║Requesting a wake up for Thu, Feb 20 2020 @ 7:46:43 PM PST (in 10.0s)
+192ms ║╚Execution stage complete. (45ms)
+193ms ║Setting up scheduled job for Thu, Feb 20 2020 @ 7:46:43 PM PST (in 9.996s)
+202ms ╚Event processed successfully (202ms)
2/20/2020, 7:46:14 PM +45ms
+1ms ╔Received event [Kitchen Sensor].motion = inactive with a delay of 117ms
+132ms ║Runtime (38617 bytes) successfully initialized in 66ms (v0.3.110.20191009) (130ms)
+133ms ║╔Execution stage started
+149ms ║╚Execution stage complete. (16ms)
+150ms ║Setting up scheduled job for Thu, Feb 20 2020 @ 7:46:34 PM PST (in 19.996s)
+160ms ╚Event processed successfully (160ms)
2/20/2020, 7:46:03 PM +344ms
+1ms ╔Received event [Kitchen Sensor].motion = active with a delay of 126ms
+151ms ║Runtime (38614 bytes) successfully initialized in 72ms (v0.3.110.20191009) (149ms)
+152ms ║╔Execution stage started
+179ms ║║Executed [Kitchen Dimmer].on (14ms)
+192ms ║║Executed [Kitchen Dimmer].setLevel (10ms)
+204ms ║╚Execution stage complete. (52ms)
+205ms ╚Event processed successfully (205ms)
2/20/2020, 7:41:09 PM +81ms
+1ms ╔Received event [Sunset Home].time = 1582256470419 with a delay of -1338ms
+136ms ║Runtime (38618 bytes) successfully initialized in 63ms (v0.3.110.20191009) (134ms)
+136ms ║╔Execution stage started
+165ms ║║Executed [Kitchen Dimmer].off (16ms)
+167ms ║╚Execution stage complete. (31ms)
+168ms ╚Event processed successfully (168ms)
2/20/2020, 7:41:00 PM +166ms
+1ms ╔Received event [Sunset Home].time = 1582256461114 with a delay of -949ms
+200ms ║Runtime (38622 bytes) successfully initialized in 88ms (v0.3.110.20191009) (197ms)
+202ms ║╔Execution stage started
+247ms ║║Executed [Kitchen Dimmer].setLevel (15ms)
+251ms ║║Executed virtual command [Kitchen Dimmer].wait (0ms)
+252ms ║║Requesting a wake up for Thu, Feb 20 2020 @ 7:41:10 PM PST (in 10.0s)
+258ms ║╚Execution stage complete. (56ms)
+260ms ║Setting up scheduled job for Thu, Feb 20 2020 @ 7:41:10 PM PST (in 9.994s)
+272ms ╚Event processed successfully (271ms)
2/20/2020, 7:40:40 PM +962ms
+1ms ╔Received event [Kitchen Sensor].motion = inactive with a delay of 124ms
+137ms ║Runtime (38617 bytes) successfully initialized in 65ms (v0.3.110.20191009) (135ms)
+138ms ║╔Execution stage started
+156ms ║╚Execution stage complete. (17ms)
+157ms ║Setting up scheduled job for Thu, Feb 20 2020 @ 7:41:01 PM PST (in 19.996s)
+169ms ╚Event processed successfully (169ms)
2/20/2020, 7:40:26 PM +441ms
+1ms ╔Received event [Kitchen Sensor].motion = active with a delay of 127ms
+130ms ║Runtime (38618 bytes) successfully initialized in 64ms (v0.3.110.20191009) (128ms)
+131ms ║╔Execution stage started
+155ms ║║Executed [Kitchen Dimmer].on (12ms)
+167ms ║║Executed [Kitchen Dimmer].setLevel (10ms)
+176ms ║╚Execution stage complete. (45ms)
+177ms ╚Event processed successfully (177ms)
2/20/2020, 7:28:18 PM +79ms
+0ms ╔Received event [Sunset Home].time = 1582255699275 with a delay of -1197ms
+134ms ║Runtime (38623 bytes) successfully initialized in 62ms (v0.3.110.20191009) (133ms)
+135ms ║╔Execution stage started
+153ms ║╚Execution stage complete. (18ms)
+154ms ╚Event processed successfully (154ms)
2/20/2020, 7:27:59 PM +114ms
+1ms ╔Received event [Kitchen Sensor].motion = inactive with a delay of 126ms
+146ms ║Runtime (38617 bytes) successfully initialized in 72ms (v0.3.110.20191009) (144ms)
+147ms ║╔Execution stage started
+164ms ║╚Execution stage complete. (17ms)
+165ms ║Setting up scheduled job for Thu, Feb 20 2020 @ 7:28:19 PM PST (in 19.996s)
+175ms ╚Event processed successfully (175ms)
2/20/2020, 7:26:47 PM +98ms
+1ms ╔Received event [Sunset Home].time = 1582255608241 with a delay of -1143ms
+185ms ║Runtime (38619 bytes) successfully initialized in 71ms (v0.3.110.20191009) (184ms)
+186ms ║╔Execution stage started
+188ms ║╚Execution stage complete. (2ms)
+190ms ╚Event processed successfully (189ms)
2/20/2020, 7:26:29 PM +260ms
+1ms ╔Received event [Kitchen Sensor].motion = active with a delay of 114ms
+132ms ║Runtime (38619 bytes) successfully initialized in 62ms (v0.3.110.20191009) (130ms)
+133ms ║╔Execution stage started
+148ms ║║Executed [Kitchen Dimmer].on (3ms)
+155ms ║║Executed [Kitchen Dimmer].setLevel (4ms)
+164ms ║╚Execution stage complete. (30ms)
+165ms ╚Event processed successfully (164ms)
2/20/2020, 7:26:28 PM +63ms
+1ms ╔Received event [Kitchen Sensor].motion = inactive with a delay of 118ms
+162ms ║Runtime (38617 bytes) successfully initialized in 80ms (v0.3.110.20191009) (160ms)
+163ms ║╔Execution stage started
+182ms ║╚Execution stage complete. (19ms)
+183ms ║Setting up scheduled job for Thu, Feb 20 2020 @ 7:26:48 PM PST (in 19.995s)
+193ms ╚Event processed successfully (192ms)
2/20/2020, 7:26:09 PM +392ms
+1ms ╔Received event [Kitchen Sensor].motion = active with a delay of 115ms
+132ms ║Runtime (38618 bytes) successfully initialized in 59ms (v0.3.110.20191009) (130ms)
+133ms ║╔Execution stage started
+148ms ║║Executed [Kitchen Dimmer].on (4ms)
+156ms ║║Executed [Kitchen Dimmer].setLevel (6ms)
+166ms ║╚Execution stage complete. (32ms)
+167ms ╚Event processed successfully (166ms)
2/20/2020, 7:25:56 PM +77ms
+1ms ╔Received event [Sunset Home].time = 1582255557700 with a delay of -1623ms
+159ms ║Runtime (38623 bytes) successfully initialized in 69ms (v0.3.110.20191009) (157ms)
+160ms ║╔Execution stage started
+184ms ║╚Execution stage complete. (24ms)
+185ms ╚Event processed successfully (185ms)
2/20/2020, 7:25:37 PM +538ms
+1ms ╔Received event [Kitchen Sensor].motion = inactive with a delay of 121ms
+144ms ║Runtime (38617 bytes) successfully initialized in 61ms (v0.3.110.20191009) (142ms)
+145ms ║╔Execution stage started
+165ms ║╚Execution stage complete. (20ms)
+166ms ║Setting up scheduled job for Thu, Feb 20 2020 @ 7:25:57 PM PST (in 19.996s)
+177ms ╚Event processed successfully (177ms)
2/20/2020, 7:25:13 PM +142ms
+2ms ╔Received event [Kitchen Sensor].motion = active with a delay of 115ms
+138ms ║Runtime (38618 bytes) successfully initialized in 61ms (v0.3.110.20191009) (135ms)
+138ms ║╔Execution stage started
+152ms ║║Executed [Kitchen Dimmer].on (3ms)
+159ms ║║Executed [Kitchen Dimmer].setLevel (4ms)
+169ms ║╚Execution stage complete. (30ms)
+170ms ╚Event processed successfully (169ms)
2/20/2020, 7:24:49 PM +112ms
+0ms ╔Received event [Sunset Home].time = 1582255490781 with a delay of -1670ms
+185ms ║Runtime (38623 bytes) successfully initialized in 82ms (v0.3.110.20191009) (183ms)
+186ms ║╔Execution stage started
+212ms ║╚Execution stage complete. (25ms)
+213ms ╚Event processed successfully (213ms)
2/20/2020, 7:24:30 PM +621ms
+1ms ╔Received event [Kitchen Sensor].motion = inactive with a delay of 123ms
+144ms ║Runtime (38617 bytes) successfully initialized in 67ms (v0.3.110.20191009) (142ms)
+145ms ║╔Execution stage started
+164ms ║╚Execution stage complete. (18ms)
+165ms ║Setting up scheduled job for Thu, Feb 20 2020 @ 7:24:50 PM PST (in 19.995s)
+174ms ╚Event processed successfully (174ms)
2/20/2020, 7:24:13 PM +81ms
+1ms ╔Received event [Sunset Home].time = 1582255454391 with a delay of -1310ms
+301ms ║Runtime (38619 bytes) successfully initialized in 79ms (v0.3.110.20191009) (300ms)
+302ms ║╔Execution stage started
+303ms ║╚Execution stage complete. (1ms)
+304ms ╚Event processed successfully (304ms)
2/20/2020, 7:24:02 PM +429ms
+2ms ╔Received event [Kitchen Sensor].motion = active with a delay of 166ms
+136ms ║Runtime (38619 bytes) successfully initialized in 63ms (v0.3.110.20191009) (133ms)
+137ms ║╔Execution stage started
+150ms ║║Executed [Kitchen Dimmer].on (2ms)
+157ms ║║Executed [Kitchen Dimmer].setLevel (4ms)
+167ms ║╚Execution stage complete. (31ms)
+168ms ╚Event processed successfully (168ms)
2/20/2020, 7:23:54 PM +238ms
+1ms ╔Received event [Kitchen Sensor].motion = inactive with a delay of 120ms
+139ms ║Runtime (38617 bytes) successfully initialized in 63ms (v0.3.110.20191009) (136ms)
+139ms ║╔Execution stage started
+156ms ║╚Execution stage complete. (17ms)
+157ms ║Setting up scheduled job for Thu, Feb 20 2020 @ 7:24:14 PM PST (in 19.996s)
+168ms ╚Event processed successfully (168ms)
2/20/2020, 7:23:36 PM +117ms
+1ms ╔Received event [Sunset Home].time = 1582255417724 with a delay of -1607ms
+241ms ║Runtime (38620 bytes) successfully initialized in 111ms (v0.3.110.20191009) (239ms)
+242ms ║╔Execution stage started
+243ms ║╚Execution stage complete. (1ms)
+245ms ╚Event processed successfully (244ms)
2/20/2020, 7:23:25 PM +93ms
+2ms ╔Received event [Kitchen Sensor].motion = active with a delay of 117ms
+145ms ║Runtime (38619 bytes) successfully initialized in 66ms (v0.3.110.20191009) (143ms)
+146ms ║╔Execution stage started
+161ms ║║Executed [Kitchen Dimmer].on (3ms)
+168ms ║║Executed [Kitchen Dimmer].setLevel (4ms)
+178ms ║╚Execution stage complete. (32ms)
+179ms ╚Event processed successfully (179ms)
2/20/2020, 7:23:17 PM +576ms
+2ms ╔Received event [Kitchen Sensor].motion = inactive with a delay of 850ms
+134ms ║Runtime (38617 bytes) successfully initialized in 64ms (v0.3.110.20191009) (132ms)
+135ms ║╔Execution stage started
+151ms ║╚Execution stage complete. (16ms)
+153ms ║Setting up scheduled job for Thu, Feb 20 2020 @ 7:23:37 PM PST (in 19.996s)
+161ms ╚Event processed successfully (161ms)
2/20/2020, 7:22:52 PM +121ms
+1ms ╔Received event [Sunset Home].time = 1582255373258 with a delay of -1137ms
+144ms ║Runtime (38619 bytes) successfully initialized in 70ms (v0.3.110.20191009) (142ms)
+145ms ║╔Execution stage started
+145ms ║╚Execution stage complete. (1ms)
+146ms ╚Event processed successfully (146ms)
2/20/2020, 7:22:48 PM +444ms
+1ms ╔Received event [Kitchen Sensor].motion = active with a delay of 117ms
+131ms ║Runtime (38619 bytes) successfully initialized in 58ms (v0.3.110.20191009) (128ms)
+132ms ║╔Execution stage started
+147ms ║║Executed [Kitchen Dimmer].on (3ms)
+153ms ║║Executed [Kitchen Dimmer].setLevel (4ms)
+163ms ║╚Execution stage complete. (32ms)
+165ms ╚Event processed successfully (164ms)
2/20/2020, 7:22:33 PM +94ms
+2ms ╔Received event [Kitchen Sensor].motion = inactive with a delay of 127ms
+146ms ║Runtime (38617 bytes) successfully initialized in 66ms (v0.3.110.20191009) (143ms)
+147ms ║╔Execution stage started
+167ms ║╚Execution stage complete. (20ms)
+169ms ║Setting up scheduled job for Thu, Feb 20 2020 @ 7:22:53 PM PST (in 19.996s)
+180ms ╚Event processed successfully (180ms)
2/20/2020, 7:21:46 PM +96ms
+0ms ╔Received event [Sunset Home].time = 1582255307567 with a delay of -1471ms
+153ms ║Runtime (38619 bytes) successfully initialized in 68ms (v0.3.110.20191009) (152ms)
+154ms ║╔Execution stage started
+155ms ║╚Execution stage complete. (1ms)
+156ms ╚Event processed successfully (156ms)
2/20/2020, 7:21:36 PM +539ms
+2ms ╔Received event [Kitchen Sensor].motion = active with a delay of 116ms
+134ms ║Runtime (38619 bytes) successfully initialized in 62ms (v0.3.110.20191009) (132ms)
+135ms ║╔Execution stage started
+149ms ║║Executed [Kitchen Dimmer].on (3ms)
+157ms ║║Executed [Kitchen Dimmer].setLevel (4ms)
+166ms ║╚Execution stage complete. (30ms)
+167ms ╚Event processed successfully (166ms)
2/20/2020, 7:21:27 PM +415ms
+2ms ╔Received event [Kitchen Sensor].motion = inactive with a delay of 131ms
+137ms ║Runtime (38617 bytes) successfully initialized in 62ms (v0.3.110.20191009) (134ms)
+138ms ║╔Execution stage started
+155ms ║╚Execution stage complete. (17ms)
+156ms ║Setting up scheduled job for Thu, Feb 20 2020 @ 7:21:47 PM PST (in 19.996s)
+165ms ╚Event processed successfully (165ms)
2/20/2020, 7:21:23 PM +104ms
+1ms ╔Received event [Sunset Home].time = 1582255284756 with a delay of -1652ms
+177ms ║Runtime (38619 bytes) successfully initialized in 89ms (v0.3.110.20191009) (175ms)
+179ms ║╔Execution stage started
+180ms ║╚Execution stage complete. (2ms)
+181ms ╚Event processed successfully (181ms)
2/20/2020, 7:21:15 PM +550ms
+2ms ╔Received event [Kitchen Sensor].motion = active with a delay of 115ms
+134ms ║Runtime (38619 bytes) successfully initialized in 59ms (v0.3.110.20191009) (131ms)
+135ms ║╔Execution stage started
+249ms ║║Executed [Kitchen Dimmer].on (102ms)
+258ms ║║Executed [Kitchen Dimmer].setLevel (6ms)
+268ms ║╚Execution stage complete. (132ms)
+269ms ╚Event processed successfully (270ms)
2/20/2020, 7:21:04 PM +587ms
+2ms ╔Received event [Kitchen Sensor].motion = inactive with a delay of 129ms
+154ms ║Runtime (38617 bytes) successfully initialized in 67ms (v0.3.110.20191009) (152ms)
+155ms ║╔Execution stage started
+172ms ║╚Execution stage complete. (17ms)
+174ms ║Setting up scheduled job for Thu, Feb 20 2020 @ 7:21:24 PM PST (in 19.996s)
+184ms ╚Event processed successfully (184ms)
2/20/2020, 7:17:01 PM +70ms
+1ms ╔Received event [Sunset Home].time = 1582255022128 with a delay of -1058ms
+175ms ║Runtime (38619 bytes) successfully initialized in 79ms (v0.3.110.20191009) (174ms)
+176ms ║╔Execution stage started
+177ms ║╚Execution stage complete. (1ms)
+178ms ╚Event processed successfully (178ms)
2/20/2020, 7:16:47 PM +473ms
+1ms ╔Received event [Kitchen Sensor].motion = active with a delay of 126ms
+140ms ║Runtime (38619 bytes) successfully initialized in 64ms (v0.3.110.20191009) (138ms)
+141ms ║╔Execution stage started
+156ms ║║Executed [Kitchen Dimmer].on (4ms)
+163ms ║║Executed [Kitchen Dimmer].setLevel (4ms)
+173ms ║╚Execution stage complete. (32ms)
+174ms ╚Event processed successfully (173ms)
2/20/2020, 7:16:41 PM +975ms
+1ms ╔Received event [Kitchen Sensor].motion = inactive with a delay of 117ms
+138ms ║Runtime (38617 bytes) successfully initialized in 62ms (v0.3.110.20191009) (135ms)
+139ms ║╔Execution stage started
+156ms ║╚Execution stage complete. (18ms)
+158ms ║Setting up scheduled job for Thu, Feb 20 2020 @ 7:17:02 PM PST (in 19.996s)
+167ms ╚Event processed successfully (167ms)
2/20/2020, 7:15:43 PM +203ms
+1ms ╔Received event [Kitchen Sensor].motion = active with a delay of 145ms
+141ms ║Runtime (38618 bytes) successfully initialized in 66ms (v0.3.110.20191009) (139ms)
+142ms ║╔Execution stage started
+161ms ║║Executed [Kitchen Dimmer].on (3ms)
+172ms ║║Executed [Kitchen Dimmer].setLevel (9ms)
+184ms ║╚Execution stage complete. (42ms)
+186ms ╚Event processed successfully (186ms)
2/20/2020, 7:15:13 PM +87ms
+0ms ╔Received event [Sunset Home].time = 1582254914865 with a delay of -1778ms
+422ms ║Runtime (38623 bytes) successfully initialized in 64ms (v0.3.110.20191009) (421ms)
+423ms ║╔Execution stage started
+441ms ║╚Execution stage complete. (18ms)
+443ms ╚Event processed successfully (442ms)
2/20/2020, 7:14:54 PM +695ms
+2ms ╔Received event [Kitchen Sensor].motion = inactive with a delay of 119ms
+152ms ║Runtime (38617 bytes) successfully initialized in 69ms (v0.3.110.20191009) (149ms)
+154ms ║╔Execution stage started
+173ms ║╚Execution stage complete. (20ms)
+175ms ║Setting up scheduled job for Thu, Feb 20 2020 @ 7:15:14 PM PST (in 19.996s)
+184ms ╚Event processed successfully (183ms)
2/20/2020, 7:13:56 PM +356ms
+2ms ╔Received event [Kitchen Sensor].motion = active with a delay of 123ms
+139ms ║Runtime (38614 bytes) successfully initialized in 63ms (v0.3.110.20191009) (137ms)
+140ms ║╔Execution stage started
+164ms ║║Executed [Kitchen Dimmer].on (13ms)
+177ms ║║Executed [Kitchen Dimmer].setLevel (11ms)
+186ms ║╚Execution stage complete. (47ms)
+188ms ╚Event processed successfully (187ms)
2/20/2020, 7:07:55 PM +97ms
+1ms ╔Received event [Sunset Home].time = 1582254476107 with a delay of -1010ms
+172ms ║Runtime (38618 bytes) successfully initialized in 71ms (v0.3.110.20191009) (170ms)
+174ms ║╔Execution stage started
+202ms ║║Executed [Kitchen Dimmer].off (13ms)
+204ms ║╚Execution stage complete. (31ms)
+205ms ╚Event processed successfully (205ms)
2/20/2020, 7:07:45 PM +887ms
+0ms ╔Received event [Sunset Home].time = 1582254466763 with a delay of -877ms
+163ms ║Runtime (38622 bytes) successfully initialized in 69ms (v0.3.110.20191009) (160ms)
+164ms ║╔Execution stage started
+214ms ║║Executed [Kitchen Dimmer].setLevel (21ms)
+218ms ║║Executed virtual command [Kitchen Dimmer].wait (1ms)
+219ms ║║Requesting a wake up for Thu, Feb 20 2020 @ 7:07:56 PM PST (in 10.0s)
+225ms ║╚Execution stage complete. (60ms)
+227ms ║Setting up scheduled job for Thu, Feb 20 2020 @ 7:07:56 PM PST (in 9.994s)
+238ms ╚Event processed successfully (239ms)
2/20/2020, 7:07:26 PM +614ms
+2ms ╔Received event [Kitchen Sensor].motion = inactive with a delay of 121ms
+134ms ║Runtime (38617 bytes) successfully initialized in 62ms (v0.3.110.20191009) (131ms)
+135ms ║╔Execution stage started
+152ms ║╚Execution stage complete. (16ms)
+153ms ║Setting up scheduled job for Thu, Feb 20 2020 @ 7:07:46 PM PST (in 19.997s)
+163ms ╚Event processed successfully (163ms)
2/20/2020, 7:07:09 PM +105ms
+0ms ╔Received event [Sunset Home].time = 1582254430327 with a delay of -1223ms
+181ms ║Runtime (38619 bytes) successfully initialized in 99ms (v0.3.110.20191009) (179ms)
+182ms ║╔Execution stage started
+183ms ║╚Execution stage complete. (1ms)
+184ms ╚Event processed successfully (183ms)
2/20/2020, 7:07:07 PM +539ms
+1ms ╔Received event [Kitchen Sensor].motion = active with a delay of 133ms
+132ms ║Runtime (38614 bytes) successfully initialized in 62ms (v0.3.110.20191009) (130ms)
+133ms ║╔Execution stage started
+148ms ║║Executed [Kitchen Dimmer].on (4ms)
+165ms ║║Executed [Kitchen Dimmer].setLevel (14ms)
+175ms ║╚Execution stage complete. (41ms)
+176ms ╚Event processed successfully (175ms)
2/20/2020, 7:07:00 PM +123ms
+0ms ╔Received event [Sunset Home].time = 1582254421072 with a delay of -949ms
+160ms ║Runtime (38622 bytes) successfully initialized in 83ms (v0.3.110.20191009) (159ms)
+161ms ║╔Execution stage started
+198ms ║║Executed [Kitchen Dimmer].setLevel (14ms)
+202ms ║║Executed virtual command [Kitchen Dimmer].wait (1ms)
+203ms ║║Requesting a wake up for Thu, Feb 20 2020 @ 7:07:10 PM PST (in 10.0s)
+208ms ║╚Execution stage complete. (48ms)
+210ms ║Setting up scheduled job for Thu, Feb 20 2020 @ 7:07:10 PM PST (in 9.995s)
+219ms ╚Event processed successfully (219ms)
2/20/2020, 7:06:40 PM +880ms
+1ms ╔Received event [Kitchen Sensor].motion = inactive with a delay of 158ms
+167ms ║Runtime (38617 bytes) successfully initialized in 66ms (v0.3.110.20191009) (165ms)
+169ms ║╔Execution stage started
+197ms ║╚Execution stage complete. (28ms)
+199ms ║Setting up scheduled job for Thu, Feb 20 2020 @ 7:07:01 PM PST (in 19.994s)
+211ms ╚Event processed successfully (210ms)
2/20/2020, 7:06:14 PM +71ms
+0ms ╔Received event [Sunset Home].time = 1582254375331 with a delay of -1260ms
+265ms ║Runtime (38619 bytes) successfully initialized in 74ms (v0.3.110.20191009) (264ms)
+266ms ║╔Execution stage started
+267ms ║╚Execution stage complete. (1ms)
+268ms ╚Event processed successfully (268ms)
2/20/2020, 7:06:13 PM +134ms
+1ms ╔Received event [Kitchen Sensor].motion = active with a delay of 120ms
+153ms ║Runtime (38614 bytes) successfully initialized in 58ms (v0.3.110.20191009) (151ms)
+154ms ║╔Execution stage started
+171ms ║║Executed [Kitchen Dimmer].on (3ms)
+186ms ║║Executed [Kitchen Dimmer].setLevel (12ms)
+196ms ║╚Execution stage complete. (42ms)
+197ms ╚Event processed successfully (197ms)
2/20/2020, 7:06:05 PM +88ms
+1ms ╔Received event [Sunset Home].time = 1582254366858 with a delay of -1770ms
+205ms ║Runtime (38623 bytes) successfully initialized in 92ms (v0.3.110.20191009) (204ms)
+206ms ║╔Execution stage started
+238ms ║║Executed [Kitchen Dimmer].setLevel (11ms)
+241ms ║║Executed virtual command [Kitchen Dimmer].wait (0ms)
+242ms ║║Requesting a wake up for Thu, Feb 20 2020 @ 7:06:15 PM PST (in 10.0s)
+246ms ║╚Execution stage complete. (40ms)
+248ms ║Setting up scheduled job for Thu, Feb 20 2020 @ 7:06:15 PM PST (in 9.996s)
+256ms ╚Event processed successfully (256ms)
2/20/2020, 7:05:46 PM +714ms
+1ms ╔Received event [Kitchen Sensor].motion = inactive with a delay of 118ms
+129ms ║Runtime (38617 bytes) successfully initialized in 61ms (v0.3.110.20191009) (127ms)
+130ms ║╔Execution stage started
+147ms ║╚Execution stage complete. (17ms)
+148ms ║Setting up scheduled job for Thu, Feb 20 2020 @ 7:06:06 PM PST (in 19.996s)
+162ms ╚Event processed successfully (163ms)
2/20/2020, 7:05:27 PM +47ms
+1ms ╔Received event [Kitchen Sensor].motion = active with a delay of 123ms
+134ms ║Runtime (38618 bytes) successfully initialized in 61ms (v0.3.110.20191009) (132ms)
+135ms ║╔Execution stage started
+151ms ║║Executed [Kitchen Dimmer].on (4ms)
+159ms ║║Executed [Kitchen Dimmer].setLevel (5ms)
+169ms ║╚Execution stage complete. (33ms)
+170ms ╚Event processed successfully (169ms)
2/20/2020, 7:05:22 PM +68ms
+0ms ╔Received event [Sunset Home].time = 1582254323370 with a delay of -1303ms
+148ms ║Runtime (38623 bytes) successfully initialized in 67ms (v0.3.110.20191009) (147ms)
+149ms ║╔Execution stage started
+165ms ║╚Execution stage complete. (16ms)
+166ms ╚Event processed successfully (166ms)
2/20/2020, 7:05:03 PM +209ms
+2ms ╔Received event [Kitchen Sensor].motion = inactive with a delay of 122ms
+145ms ║Runtime (38617 bytes) successfully initialized in 68ms (v0.3.110.20191009) (141ms)
+146ms ║╔Execution stage started
+165ms ║╚Execution stage complete. (19ms)
+166ms ║Setting up scheduled job for Thu, Feb 20 2020 @ 7:05:23 PM PST (in 19.996s)
+177ms ╚Event processed successfully (177ms)
2/20/2020, 7:04:12 PM +306ms
+1ms ╔Received event [Kitchen Sensor].motion = active with a delay of 119ms
+131ms ║Runtime (38618 bytes) successfully initialized in 60ms (v0.3.110.20191009) (128ms)
+131ms ║╔Execution stage started
+146ms ║║Executed [Kitchen Dimmer].on (2ms)
+152ms ║║Executed [Kitchen Dimmer].setLevel (4ms)
+162ms ║╚Execution stage complete. (30ms)
+163ms ╚Event processed successfully (162ms)
2/20/2020, 7:04:06 PM +136ms
+0ms ╔Received event [Sunset Home].time = 1582254247945 with a delay of -1809ms
+234ms ║Runtime (38624 bytes) successfully initialized in 113ms (v0.3.110.20191009) (233ms)
+235ms ║╔Execution stage started
+254ms ║╚Execution stage complete. (19ms)
+255ms ╚Event processed successfully (255ms)
2/20/2020, 7:03:47 PM +794ms
+1ms ╔Received event [Kitchen Sensor].motion = inactive with a delay of 126ms
+136ms ║Runtime (38617 bytes) successfully initialized in 62ms (v0.3.110.20191009) (134ms)
+137ms ║╔Execution stage started
+154ms ║╚Execution stage complete. (16ms)
+155ms ║Setting up scheduled job for Thu, Feb 20 2020 @ 7:04:07 PM PST (in 19.997s)
+166ms ╚Event processed successfully (167ms)
2/20/2020, 7:02:27 PM +540ms
+2ms ╔Received event [Kitchen Sensor].motion = active with a delay of 123ms
+141ms ║Runtime (38618 bytes) successfully initialized in 67ms (v0.3.110.20191009) (139ms)
+142ms ║╔Execution stage started
+156ms ║║Executed [Kitchen Dimmer].on (3ms)
+164ms ║║Executed [Kitchen Dimmer].setLevel (4ms)
+172ms ║╚Execution stage complete. (30ms)
+173ms ╚Event processed successfully (173ms)
2/20/2020, 7:02:19 PM +242ms
+1ms ╔Received event [Sunset Home].time = 1582254140009 with a delay of -767ms
+158ms ║Runtime (38622 bytes) successfully initialized in 63ms (v0.3.110.20191009) (156ms)
+159ms ║╔Execution stage started
+180ms ║╚Execution stage complete. (21ms)
+181ms ╚Event processed successfully (181ms)
2/20/2020, 7:01:59 PM +857ms
+2ms ╔Received event [Kitchen Sensor].motion = inactive with a delay of 120ms
+136ms ║Runtime (38617 bytes) successfully initialized in 63ms (v0.3.110.20191009) (133ms)
+137ms ║╔Execution stage started
+155ms ║╚Execution stage complete. (18ms)
+157ms ║Setting up scheduled job for Thu, Feb 20 2020 @ 7:02:20 PM PST (in 19.996s)
+190ms ╚Event processed successfully (190ms)
2/20/2020, 7:01:41 PM +633ms
+1ms ╔Received event [Sunset Home].time = 1582254102120 with a delay of -487ms
+177ms ║Runtime (38618 bytes) successfully initialized in 84ms (v0.3.110.20191009) (176ms)
+179ms ║╔Execution stage started
+180ms ║╚Execution stage complete. (2ms)
+181ms ╚Event processed successfully (181ms)
2/20/2020, 7:01:24 PM +611ms
+1ms ╔Received event [Kitchen Sensor].motion = active with a delay of 124ms
+147ms ║Runtime (38619 bytes) successfully initialized in 62ms (v0.3.110.20191009) (145ms)
+148ms ║╔Execution stage started
+164ms ║║Executed [Kitchen Dimmer].on (4ms)
+172ms ║║Executed [Kitchen Dimmer].setLevel (5ms)
+182ms ║╚Execution stage complete. (33ms)
+183ms ╚Event processed successfully (182ms)
2/20/2020, 7:01:22 PM +106ms
+0ms ╔Received event [Sunset Home].time = 1582254083633 with a delay of -1527ms

#12

so a second safety check after the wait to make sure motion is still inactive… i’ll have to try that…


#13

Upon closer inspection of 840t, the WITH on line 31 might need TCP set to Never.
(since we do not want it to cancel until after checking for movement)


Edit

Ignore my previous two lines… I think TCP set to default in this case is still better. The top trigger on 840t should catch any activity and immediately turn the light to 100%.

(IE: If there is activity, it shouldn’t matter if lines 46 onwards executes properly, since the light should be at 100% already)


#14

I’m experimenting with synchronous vs asynchronous. (before it was set to async…) - seems to behave better w/ async, but it also takes much longer to turn off… (instead of 20 seconds, it’s more like 50 seconds; weird…)


#15

I would try pausing your current piston, and importing 840t.
I think you will get very quick response times.


#16

Side Note:

The code: “stays inactive for 30 seconds” actually starts when the device reports inactivity. Some devices do that quickly (I have seen as low as 3 sec after leaving the room), and some do it very slowly. (I think 3 minutes timeout was the slowest I have seen)

Thankfully, whatever device you have, with whatever timer it has, will usually be consistent. So, once you learn your device’s timeout, you can better tweak the extra delay here in webCoRE.

IE:

If your device takes 20 seconds to report inactivity to the hub, and you want a 30 second of inactivity trigger, then use:
stays inactive for 10 seconds


Pro Tip:

A quick way to test your particular device is to make a one block piston:

IF Sensor's motion stays inactive for 1 second
    Then Flash light
END IF
  • Get your stop watch ready
  • Walk in front of the motion sensor
  • Quickly leave the room and begin the stop watch
  • When the light flashes, stop the watch, and subtract 1 second.

This test tells you how long it takes for that particular device to timeout.


#17

So I see from the logs. The motion went active at 7:47:08.8. The ‘stays inactive’ timer woke up at 7:47:09.08. Could be a freak race condition I suppose, but there is something odd there. A semaphore wait should have stopped that happening. You haven’t enabled parallelism have you? Or otherwise done something asychronous? That’d possibly explain it.


#18

Hey WCMore - yes, in other pistons, I have different inactive periods based on how fast the motion detectors react… Some of my older motion detectors stay active for a minute post-activity;/

I’ve done this so far by monitoring status while walking around a motion detector and then standing still:) but the advice on the 1 second lights is great as well…

I’ll try 840t tonight. tnx.


#19

It was defaulting to asynchronous (I thought all pistons did?) - I changed it to synchronous yesterday and it stays on better - but now takes forever to turn off…


#20

The default ‘execution method’ for tasks is synchronous. Which basically means the piston waits for the task to complete before moving on to the next one. You can set tasks individually to asynchronous so the piston starts them going and moves on to the next one immediately. It isn’t going to make much difference unless the task contains a wait.

The default behaviour of pistons as a whole is to try and serialize execution. So if a piston fires a new instance while a previous one is still executing it will use a ‘semaphore wait’ to delay the new one for a while. You can ‘enable parallelism’ to just have the new instance start executing. It can be useful if your piston handles events that might happen near simultaneously but can be processed largely independently of each other, and/or semaphore waits can cause events to be handled out of order.