Why is fan not shutting off?


#1

1) Give a description of the problem
I’m using a Monoprice multi-sensor for the humidity sensor in this piston. I have it configured to report humidity changes of 1% or greater. It seems to report changes no more than once every 3 minutes. Sometimes the fan is not turned off.

2) What is the expected behavior?
Fan should turn off when humidity does not drop by at least Humidity_Change_Threshold within Humidity_Delay_Fan_Off minutes. When this happens it appears to be cancelling the scheduled timer but the timer event still occurs but nothing happens.

3) What is happening/not happening?
If the last humidity change is less than the threshold so it doesn’t trigger the “drops to or below” condition then when the wait timer expires the fan is not turned off.

4) Post a Green Snapshot of the piston

5) Attach any logs (From ST IDE and by turning logging level to Full)
ST IDE logs aren’t really relevant here. Webcore logs show the issue.

‎ 12‎/‎25‎/‎2017‎ ‎10‎:‎32‎:‎26‎ ‎AM +328ms
+0ms
╔Received event [Home].time = 1514219547714 with a delay of -1387ms
+147ms
║RunTime Analysis CS > 13ms > PS > 40ms > PE > 95ms > CE
+150ms
║Runtime (43199 bytes) successfully initialized in 40ms (v0.2.100.20171211) (149ms)
+152ms
║╔Execution stage started
+153ms
║╚Execution stage complete. (2ms)
+154ms
╚Event processed successfully (154ms)
‎12‎/‎25‎/‎2017‎ ‎10‎:‎28‎:‎28‎ ‎AM +431ms
+1ms
╔Received event [MBath Multi-Sensor].humidity = 39 with a delay of 133ms
+142ms
║RunTime Analysis CS > 12ms > PS > 37ms > PE > 94ms > CE
+145ms
║Runtime (43204 bytes) successfully initialized in 37ms (v0.2.100.20171211) (143ms)
+145ms
║╔Execution stage started
+157ms
║║Condition #5 evaluated false (7ms)
+158ms
║║Condition group #1 evaluated false (state did not change) (8ms)
+167ms
║║Comparison (integer) 39 rises = false (4ms)
+168ms
║║Condition #9 evaluated false (7ms)
+169ms
║║Condition group #6 evaluated false (state did not change) (9ms)
+177ms
║║Calculating (integer) 42 - (integer) 4 >> (integer) 38
+180ms
║║Comparison (integer) 39 drops_to_or_below (integer) 38 = false (1ms)
+181ms
║║Condition #22 evaluated false (10ms)
+182ms
║║Condition group #14 evaluated false (state did not change) (11ms)
+187ms
║║Comparison (integer) 39 changes = true (0ms)
+188ms
║║Condition #27 evaluated true (4ms)
+189ms
║║Condition group #24 evaluated true (state did not change) (5ms)
+191ms
║║Cancelling statement #25’s schedules…
+206ms
║║Executed virtual command writeToFuelStream (8ms)
+208ms
║╚Execution stage complete. (63ms)
+209ms
╚Event processed successfully (209ms)
‎12‎/‎25‎/‎2017‎ ‎10‎:‎25‎:‎29‎ ‎AM +253ms
+1ms
╔Received event [MBath Multi-Sensor].humidity = 41 with a delay of 146ms
+137ms
║RunTime Analysis CS > 14ms > PS > 30ms > PE > 93ms > CE
+140ms
║Runtime (43204 bytes) successfully initialized in 30ms (v0.2.100.20171211) (138ms)
+141ms
║╔Execution stage started
+153ms
║║Condition #5 evaluated false (8ms)
+154ms
║║Condition group #1 evaluated false (state did not change) (9ms)
+160ms
║║Comparison (integer) 41 rises = false (1ms)
+161ms
║║Condition #9 evaluated false (5ms)
+162ms
║║Condition group #6 evaluated false (state did not change) (5ms)
+170ms
║║Calculating (integer) 42 - (integer) 4 >> (integer) 38
+173ms
║║Comparison (integer) 41 drops_to_or_below (integer) 38 = false (0ms)
+174ms
║║Cancelling condition #22’s schedules…
+174ms
║║Condition #22 evaluated false (10ms)
+175ms
║║Cancelling condition #14’s schedules…
+176ms
║║Condition group #14 evaluated false (state changed) (12ms)
+181ms
║║Comparison (integer) 41 changes = true (0ms)
+182ms
║║Cancelling condition #27’s schedules…
+183ms
║║Condition #27 evaluated true (5ms)
+184ms
║║Cancelling condition #24’s schedules…
+185ms
║║Condition group #24 evaluated true (state changed) (7ms)
+187ms
║║Cancelling statement #25’s schedules…
+201ms
║║Executed virtual command writeToFuelStream (6ms)
+203ms
║╚Execution stage complete. (63ms)
+204ms
╚Event processed successfully (204ms)
‎12‎/‎25‎/‎2017‎ ‎10‎:‎22‎:‎27‎ ‎AM +511ms
+1ms
╔Received event [MBath Multi-Sensor].humidity = 42 with a delay of 190ms
+151ms
║RunTime Analysis CS > 17ms > PS > 40ms > PE > 95ms > CE
+153ms
║Runtime (43209 bytes) successfully initialized in 40ms (v0.2.100.20171211) (151ms)
+154ms
║╔Execution stage started
+164ms
║║Condition #5 evaluated false (6ms)
+165ms
║║Condition group #1 evaluated false (state did not change) (8ms)
+172ms
║║Comparison (integer) 42 rises = false (2ms)
+172ms
║║Condition #9 evaluated false (5ms)
+173ms
║║Condition group #6 evaluated false (state did not change) (6ms)
+179ms
║║Calculating (integer) 51 - (integer) 4 >> (integer) 47
+183ms
║║Comparison (integer) 42 drops_to_or_below (integer) 47 = true (2ms)
+184ms
║║Cancelling condition #22’s schedules…
+185ms
║║Condition #22 evaluated true (10ms)
+188ms
║║Comparison (boolean) true is (boolean) true = true (0ms)
+189ms
║║Condition #23 evaluated true (3ms)
+189ms
║║Cancelling condition #14’s schedules…
+190ms
║║Condition group #14 evaluated true (state changed) (15ms)
+191ms
║║Cancelling statement #15’s schedules…
+196ms
║║Executed virtual command setVariable (2ms)
+198ms
║║Cancelling statement #28’s schedules…
+202ms
║║Executed virtual command [MBath Shower Fan, MBath Toilet Fan].wait (0ms)
+203ms
║║Requesting a wake up for Mon, Dec 25 2017 @ 10:32:27 AM CST (in 600.0s)
+206ms
║╚Execution stage complete. (52ms)
+207ms
║Setting up scheduled job for Mon, Dec 25 2017 @ 10:32:27 AM CST (in 599.996s)
+240ms
╚Event processed successfully (241ms)


#2

Try changing the Task Cancellation Policy (TCP) to Never in line 54 so that succeeding humidity events do not cancel the Wait timer. Click the With and then the cog icon.


#3

Will that keep the timer from being reset when the humidity does drop below the threshold?


#4

It should let the timer go on the full 10 minutes even if the humidity continues to drop.


#5

The intent is for the 10 minute timer to be reset if the humidity drops below the threshold.