Automated exhaust fan with manual run


#1

1) Give a description of the problem
Trying to automate an exhaust fan based on temperature sensor that in turn will not interfere with manual trigger of the same fan when temperature is below threshold. I’ve tried a few different versions of pistons on forum with different levels of success however all still turn the fan off after some time when it has been manually triggered.

2) What is the expected behaviour?
FAN is ON only when temp => 82
Piston doesn’t turn off FAN when manually enabled

3) What is happening/not happening?
Sometimes the FAN isn’t getting turned off when temperature has dropped below 82 and fan is always turned off after some amount of time when manually turned on, even though temp never went above 70’s while running

4) Post a Green Snapshot of the pistonimage

5) Attach logs after turning logging level to Full
3/29/2020, 3:49:03 PM +514ms
+1ms ╔Received event [Sensor - Temperature].temperature = 81.8 with a delay of 103ms
+82ms ║RunTime Analysis CS > 16ms > PS > 53ms > PE > 13ms > CE
+84ms ║Runtime (38435 bytes) successfully initialized in 53ms (v0.3.110.20191009) (82ms)
+85ms ║╔Execution stage started
+92ms ║║Comparison (decimal) 81.8 is_greater_than_or_equal_to (integer) 82 = false (1ms)
+94ms ║║Condition #4 evaluated false (4ms)
+95ms ║║Condition group #3 evaluated false (state did not change) (5ms)
+95ms ║║Condition group #1 evaluated false (state did not change) (7ms)
+97ms ║╚Execution stage complete. (13ms)
+98ms ╚Event processed successfully (98ms)
3/29/2020, 3:49:03 PM +58ms
+0ms ╔Received event [Home].time/recovery = 1585514943057 with a delay of 1ms
+141ms ║RunTime Analysis CS > 23ms > PS > 96ms > PE > 22ms > CE
+145ms ║Runtime (38429 bytes) successfully initialized in 96ms (v0.3.110.20191009) (143ms)
+146ms ║╔Execution stage started
+147ms ║╚Execution stage complete. (1ms)
+149ms ╚Event processed successfully (149ms)
3/29/2020, 3:48:53 PM +156ms
+1ms ╔Received event [Home].time/recovery = 1585514933155 with a delay of 0ms
+95ms ║RunTime Analysis CS > 21ms > PS > 63ms > PE > 11ms > CE
+97ms ║Runtime (38428 bytes) successfully initialized in 63ms (v0.3.110.20191009) (95ms)
+98ms ║╔Execution stage started
+99ms ║╚Execution stage complete. (1ms)
+100ms ╚Event processed successfully (100ms)
3/29/2020, 3:48:42 PM +140ms
+0ms ╔Received event [Home].time/recovery = 1585514922137 with a delay of 2ms
+8537ms ║RunTime Analysis CS > 62ms > PS > 8465ms > PE > 11ms > CE
+8539ms ║Piston waited at a semaphore for 8361ms
+8541ms ║Runtime (38503 bytes) successfully initialized in 8465ms (v0.3.110.20191009) (8538ms)
+8542ms ║╔Execution stage started
+8542ms ║╚Execution stage complete. (1ms)
+8543ms ╚Event processed successfully (8544ms)
3/29/2020, 3:48:32 PM +85ms
+0ms ╔Received event [Home].time/recovery = 1585514912084 with a delay of 1ms
+8355ms ║RunTime Analysis CS > 22ms > PS > 8318ms > PE > 15ms > CE
+8356ms ║Piston waited at a semaphore for 8193ms
+8358ms ║Runtime (38503 bytes) successfully initialized in 8318ms (v0.3.110.20191009) (8357ms)
+8359ms ║╔Execution stage started
+8360ms ║╚Execution stage complete. (1ms)
+8361ms ╚Event processed successfully (8361ms)


#2

Apart from the repeat loop needing a ‘wait’ in it to calm it down, you really don’t need it. I’d suggest starting with something like the following (in pseudo code) and refining it from there …

If
  Temperature rises above 82F
Then
  Turn on fan
Endif
If
  Temperature falls below 82F
Then
  Turn off fan
Endif

#3

You beat me to it! :slight_smile:

Also, this piston does not have any triggers so all the conditions turn into triggers. The simplified solution @orangebucket provided is your best bet.


#4

That works perfectly except for it shuts the fan off after random periods of time when its been turned on manually. Any thoughts?

3/29/2020, 4:14:08 PM +323ms
+1ms	╔Received event [Sensor - Temperature].temperature = 80.7 with a delay of 119ms
+128ms	║Runtime (37424 bytes) successfully initialized in 92ms (v0.3.110.20191009) (125ms)
+129ms	║╔Execution stage started
+151ms	║║Executed [HVAC FAN].off (5ms)
+153ms	║╚Execution stage complete. (25ms)
+154ms	╚Event processed successfully (155ms)
3/29/2020, 4:13:48 PM +13ms
+2ms	╔Received event [Sensor - Temperature].temperature = 80.3 with a delay of 121ms
+132ms	║Runtime (37424 bytes) successfully initialized in 97ms (v0.3.110.20191009) (129ms)
+133ms	║╔Execution stage started
+153ms	║║Executed [HVAC FAN].off (3ms)
+155ms	║╚Execution stage complete. (22ms)
+156ms	╚Event processed successfully (156ms)
3/29/2020, 4:12:57 PM +450ms
+2ms	╔Received event [Sensor - Temperature].temperature = 80.5 with a delay of 132ms
+133ms	║Runtime (37425 bytes) successfully initialized in 101ms (v0.3.110.20191009) (131ms)
+134ms	║╔Execution stage started
+255ms	║║Executed [HVAC FAN].off (103ms)
+257ms	║╚Execution stage complete. (123ms)
+258ms	╚Event processed successfully (258ms)
3/29/2020, 4:12:27 PM +120ms
+1ms	╔Received event [Sensor - Temperature].temperature = 80.1 with a delay of 128ms
+200ms	║Runtime (37428 bytes) successfully initialized in 124ms (v0.3.110.20191009) (197ms)
+201ms	║╔Execution stage started
+304ms	║║Executed [HVAC FAN].off (84ms)
+307ms	║╚Execution stage complete. (107ms)
+308ms	╚Event processed successfully (308ms)
3/29/2020, 4:12:16 PM +827ms
+2ms	╔Received event [Sensor - Temperature].temperature = 83.5 with a delay of 98ms
+131ms	║Runtime (37426 bytes) successfully initialized in 98ms (v0.3.110.20191009) (129ms)
+132ms	║╔Execution stage started
+147ms	║║Executed [HVAC FAN].on (3ms)
+155ms	║╚Execution stage complete. (23ms)
+156ms	╚Event processed successfully (156ms)

#5

This looks like a log from your original posted piston. The solution provided above will only turn off once when the temperature drops below your threshold and only turn on once when the temperature rises above. There is no time involved so if the temperature is turning off after manually being turned on, something else is doing it. Your original piston will always turn off at random times after it is turned on if the temperature is below the threshold because the piston is being triggered every time the temperature reading changes.


#6

Its not from the first one, I just built a new one with the 2 simple IF/THEN statements. It shuts the fan off when its running and the temp is less than 82.


#7

That looks to me like you are still using ‘is’ for comparisons. The piston will fire whenever the temperature changes so you don’t want that. It is OK to use ‘is greater than or equal’ to make sure the fan is on whenever the temperature is above 82F, but you just want the trigger ‘falls below 82F’ to turn it off.

Ah, I was right. It was.


#8

I see what your saying, testing now.


#9

I don’t have the “falls below” trigger option. Rises above was there.


#10

drops below… I’m on fire today guys.


#11

‘Drops below’ is the one. I tend to say ‘falls’ rather than ‘drops’ and forgot webCoRE doesn’t.


#12

using triggers vs checking variables. This “language” is fun :wink:

Thanks for the quick assist! I’m going to go read up more!


#13

Triggers and conditions. Yes, the “language” is unique to WebCoRE. You can read up on triggers vs condition here:


#14

Sorry to jump in, but I would highly recommend at least 1 degree difference between the two triggers. They are currently bumped up next to each other, so there will be times where your fan turns on and off many times in a short period of time (as the temperature straddles that number). If you leave a degree or two between triggers, it ensures that the fan stays on (or off) for at least few minutes during any cycle.

Just my two cents.


Pro Tip for others finding this later:

This concept applies for many other types of triggers, but often with different scales… For example, when monitoring humidity, I may recommend at least 5% space between triggers… Or when measuring lux, I may separate as much as 40, or even more.

In a nutshell, that unused “gap” can prevent the strobe-light effect.

  • Too many changes? Spread them out a bit.
  • Too few changes? Bring them closer together (without touching)