New to WebCoRE playing around with a few ideas that I thought would be straight-forward.
I have a few ArloPro cameras around the house that are registered and working in ST fine, I have dimmable switches/bulbs that work in ST just fine … so I figured let me see if I can get something working (just fine)
I created the following piston to turn on the front porch light if any of 3 cameras detect motion, wait 5m and turn light off:
This fires perfectly, motion detected by any of the cameras turns on my front porch light. The problem I have is that I wait 5m assuming the light would turn off after the “Wait” statement, but I must be misunderstanding the logic…
Here are the relevant logs (in case the issue simply doesnt jump right out at you and make you /facepalm).
(New User - can only post 1 image so C&P logs)
Piston Initializing
9/11/2017, 6:58:07 PM +852ms
+2ms ╔Starting piston… (v0.2.0e7.20170906)
+409ms ║╔Subscribing to devices…
+424ms ║║Subscribing to Arlo Cam - Driveway Back.motion…
+437ms ║║Subscribing to Arlo Cam - Front Driveway.motion…
+448ms ║║Subscribing to Arlo Cam - Front of house.motion…
+526ms ║║Subscribing to Front Porch…
+528ms ║╚Finished subscribing (120ms)
+658ms ║Comparison (time) 68288448 is_between (datetime) 1505171880000 … (datetime) 1505126280000 = true (11ms)
+661ms ║Time restriction check passed
+665ms ║Cancelling condition #5’s schedules…
+704ms ╚Piston successfully started (703ms)
Piston Fires - as i walk up driveway
9/11/2017, 7:01:13 PM +293ms
+22ms ╔Received event [Arlo Cam - Driveway Back].motion = active with a delay of 170ms
+152ms ║RunTime Analysis CS > 46ms > PS > 42ms > PE > 63ms > CE
+160ms ║Runtime (36047 bytes) successfully initialized in 42ms (v0.2.0e7.20170906) (136ms)
+162ms ║╔Execution stage started
+201ms ║║Comparison (enum) active changes_to (string) active = true (1ms)
+205ms ║║Cancelling condition #4’s schedules…
+207ms ║║Condition #4 evaluated true (33ms)
+282ms ║║Comparison (time) 68473502 is_between (datetime) 1505171880000 … (datetime) 1505126280000 = true (16ms)
+284ms ║║Time restriction check passed
+288ms ║║Condition #5 evaluated true (79ms)
+289ms ║║Cancelling condition #1’s schedules…
+290ms ║║Condition group #1 evaluated true (state changed) (118ms)
+295ms ║║Cancelling statement #2’s schedules…
+353ms ║║Executed physical command [Front Porch].on() (54ms)
+355ms ║║Executed [Front Porch].on (56ms)
+364ms ║║Executed virtual command [Front Porch].wait (1ms)
+366ms ║║Requesting a wake up for Mon, Sep 11 2017 @ 7:06:13 PM EDT (in 300.0s)
+380ms ║╚Execution stage complete. (219ms)
+383ms ║Setting up scheduled job for Mon, Sep 11 2017 @ 7:06:13 PM EDT (in 299.986s)
+399ms ╚Event processed successfully (398ms)
After motion ends this is in the logs
9/11/2017, 7:01:43 PM +296ms
+1ms ╔Received event [Arlo Cam - Driveway Back].motion = inactive with a delay of 69ms
+135ms ║RunTime Analysis CS > 22ms > PS > 43ms > PE > 70ms > CE
+182ms ║Runtime (36040 bytes) successfully initialized in 43ms (v0.2.0e7.20170906) (179ms)
+184ms ║╔Execution stage started
+220ms ║║Comparison (enum) inactive changes_to (string) active = false (1ms)
+224ms ║║Cancelling condition #4’s schedules…
+225ms ║║Condition #4 evaluated false (28ms)
+227ms ║║Cancelling condition #1’s schedules…
+228ms ║║Condition group #1 evaluated false (state changed) (31ms)
+233ms ║╚Execution stage complete. (50ms)
+241ms ╚Event processed successfully (242ms)
wait 10m to see if light turns off … nope … and no log entry
There must be something I am missing (other than another single malt (Balvenie 16 Triple Cask tonight)
EDIT 20:12 EDT
Hmmm after re-reading What is the optimal design for this simple goal I think I figured out my issue (or at least it works for some reason) Setting “Task Cancellation Policy” to Never Cancel works in my limited testing tonight … so it begs the question - is this the ‘correct’ way to do this?