Need some expert help! This seems simple enough, but the illuminance can vary from the garage sensor every time it is polled (every 5 minutes or so) - which then resets the trigger.
Garage lights left on (illuminance)? Let me know. HELP!
What is your aim for this piston. Currently all the time the illuminance is 5lux or above it will send you a notification every 9 minutes. Is that not what you want it to do?
change the while to a if like this and delete the wait.
if motion sensor's illumination stays greater than or equal to 51lux for 9 minutes
That is what I want Baz2473. But as the illumination varies slightly (from say 66 to 69) it keeps re-triggering and resetting.
no it wont. sorry didnt realize you were looking for a repeat notification.
check this piston. similar concept but not the same. if you change contact sensor contact to motion sensor illumination, instead of compare to open check greater than 51lux and minutesOpen % 5 to minutesOpen % 9 it should do what you are looking for.
also delete lines 28, 38 and 44 - 48.
Thanks, I’ll give it a try. (I’m still confused about the WHILE statement getting re-triggered every time the luminance has a different value from last time.)
Couldn’t he just enable allow multiple on the task scheduling policy seeing as it’s only restarting the countdown with every restart of the true piston?
Getting above my pay grade, but I’m trying to understand…
“Allow multiple” will stack up the tasks when in “Synchronous”? Wouldn’t that result in more frequent messages than the every 9 minutes, as the task stack empties?
Gonna try it - easy to flip to “Allow multiple”.
there is a way to use TSP allow multiple to do this, but that would also need TCP set to never which would mean some of the notifications would show up after the garage door is closed.
actually that example piston wont work with the changes i suggested. it needs a little more tweaking … let me see if i can get you a proper example.
sorry.
How about only executing task on piston state change? Surely every time the lux Level Changes slightly and is still in the conditions then the piston state hasn’t changed so should carry on with the original 9 minute countdown?
Edit it and put the allow multiple back to override. And try selecting task execution policy and changing it to execute only on piston state change.
Getting into stuff that’s beyond me. Sorry. How would I go about executing on the piston state change?
Edit the piston. Click on location and select the top option.
Task execution policy.
Change it to execute only on piston state change.
Remember to put the previous setting of allow multiple back to override.
+1ms â•”Received event [Home].test = 1507593110565 with a delay of 8ms
+364ms â•‘RunTime Analysis CS > 15ms > PS > 72ms > PE > 276ms > CE
+427ms â•‘Runtime (37789 bytes) successfully initialized in 72ms (v0.2.0ec.20170927) (424ms)
+428ms â•‘â•”Execution stage started
+441ms ║║Comparison (integer) 73 is_inside_of_range (integer) 5 … (integer) 1001 = true (2ms)
+443ms â•‘â•‘Condition #16 evaluated true (10ms)
+444ms â•‘â•‘Condition group #10 evaluated true (state did not change) (11ms)
+445ms â•‘â•‘Skipping execution for statement #12 because piston state did not change
+447ms ║╚Execution stage complete. (20ms)
+575ms ╚Event processed successfully (575ms)
Piston doesn’t seem to change state. Is the Piston State just the logical current state as the Piston runs? Do I need to force an initial state?
It would need to be false before it’s true. So the lux would need to be below 5 before it becomes greater than 5 for the first time. When you test it with the test button make sure it’s below 5lux first.
At 5:18 it was a 0lux. At 5:26 it went to 64lux. But no piston state change?
10/9/2017, 5:26:43 PM +926ms
+2ms â•”Received event [Garage (up) Sensor].illuminance = 64 with a delay of 103ms
+202ms â•‘RunTime Analysis CS > 15ms > PS > 79ms > PE > 107ms > CE
+224ms â•‘Runtime (37799 bytes) successfully initialized in 79ms (v0.2.0ec.20170927) (222ms)
+226ms â•‘â•”Execution stage started
+238ms â•‘â•‘Comparison (integer) 64 is_greater_than (integer) 5 = true (2ms)
+239ms ║║Cancelling condition #16’s schedules…
+240ms â•‘â•‘Condition #16 evaluated true (8ms)
+241ms ║║Cancelling condition #10’s schedules…
+242ms â•‘â•‘Condition group #10 evaluated true (state changed) (10ms)
+243ms â•‘â•‘Skipping execution for statement #12 because piston state did not change
+245ms ║╚Execution stage complete. (20ms)
+275ms ╚Event processed successfully (274ms)
10/9/2017, 5:18:06 PM +66ms
+0ms â•”Received event [Home].test = 1507594686057 with a delay of 8ms
+197ms â•‘RunTime Analysis CS > 20ms > PS > 72ms > PE > 105ms > CE
+273ms â•‘Runtime (37787 bytes) successfully initialized in 72ms (v0.2.0ec.20170927) (272ms)
+274ms â•‘â•”Execution stage started
+289ms â•‘â•‘Comparison (integer) 0 is_greater_than (integer) 5 = false (5ms)
+290ms â•‘â•‘Condition #16 evaluated false (12ms)
+291ms â•‘â•‘Condition group #10 evaluated false (state did not change) (13ms)
+294ms ║╚Execution stage complete. (21ms)
+306ms ╚Event processed successfully (306ms)