Controlling fan speed based on sensor temp. Ecobee + Bond


#1

I am very new to WebCoRE and I have no programming experience, simple “if this, then that”
with SmartThings and Alexa experience.

1) Give a description of the problem
I can’t get then fan to behave in the manner I would like.

2) What is the expected behaviour?
If temp is at or less than 73F, turn off fan
If temp is at or higher than 74F, set fan to low (33%)
If temp is at or higher than 76F, set fan to medium (66%)
If temp is at or higher than 77F, set fan to high (100%)

3) What is happening/not happening?
Fan may be only be setting itself to one speed and not changing as it gets cooler
or warmer. Honestly doesn’t look like it is changing anything. I also need to have the sensor
checked for status updates as it will only update every hour or more on its own.

4) Post a Green Snapshot of the pistonimage

5) Attach logs after turning logging level to Full
6/6/2020, 11:26:24 PM +863ms
+0ms ╔Starting piston… (v0.3.110.20191009)
+378ms ║╔Subscribing to devices…
+417ms ║║Subscribing to Master bedroom.temperature…
+496ms ║║Subscribing to Our Room Fan…
+497ms ║╚Finished subscribing (131ms)
+537ms ║Comparison (decimal) 75.0 is_less_than_or_equal_to (integer) 73 = false (1ms)
+549ms ║Comparison (decimal) 75.0 is_greater_than_or_equal_to (integer) 74 = true (2ms)
+559ms ║Comparison (decimal) 75.0 is_greater_than_or_equal_to (integer) 76 = false (1ms)
+569ms ║Comparison (decimal) 75.0 is_greater_than_or_equal_to (integer) 77 = false (2ms)
+582ms ║Setting up scheduled job for Sat, Jun 6 2020 @ 11:56:25 PM CDT (in 1799.939s)
+596ms ╚Piston successfully started (596ms)


#2

Instead of If temp IS greater than, try If temp CHANGES TO more than…


#3

I’ve edited it to “If temp RISES TO OR ABOVE…” I could find “CHANGES TO” not “changes to MORE THAN”. I can see how RISES TO… and CHANGES TO… could work better seeing how they are triggers instead of conditions. I also changed the off function to “DROPS TO OR BELOW”


#4

Now you’re getting the hang of it! Personally I wouldn’t use Else If’s, I’d just use separate IF blocks, but opinion may vary on the forum about that.


#5

Initial piston was being triggered by the timer every 30 mintues (The update to ‘rises above’ may not work; it is my understanding that both the trigger (rises above) and the timer would have to occur at the same moment to execute the piston.)

The initial log shows that the condition evaluated correctly but no action was taken.
According to the initial log:

I am not familiar with the setFanSpeed command but I am assumed you have tested that command outside of this piston and it works?

I do agree with @Alwas, Not a big fan of Else IFs, though i think nesting IFs here might do the trick. I’ve never gotten Else IFs to work as intended.

Below is an example of how I would do it. I don’t have a fan so I’m using a dimmer light and setting level to correspond to your low/medium/high.
*For testing, I substituted a variable for the sensor and increased frequency to 1 min. These are the logs of the test so you can see that the conditionals work.
6/8/2020, 11:04:54 AM +73ms
+120ms ║Temp is 77, setting to high (100%)
6/8/2020, 11:03:54 AM +156ms
+173ms ║Temp is 76.5, setting to med (66%)
6/8/2020, 11:02:54 AM +213ms
+118ms ║Temp is 80, setting to high (100%)
6/8/2020, 11:01:53 AM +80ms
+128ms ║Temp is 73, turning off
6/8/2020, 11:00:53 AM +90ms
+112ms ║Temp is 76, setting to med (66%)
6/8/2020, 10:59:53 AM +148ms
+113ms ║Temp is 74, setting to low (33%)
6/8/2020, 10:58:53 AM +87ms
+98ms ║Temp is 70, turning off

I assigned the devices to variables at the top so only one update would be needed and to make writing the logging expression easier. I wanted to log the fan speed after setting but I’m not sure about your specific device capabilities (fanSpeed, fanMode are most likely).


#6

I did the same thing but did it with CASE and works perfectly

Doesn’t rely on a timer, it just updates as the temperature changes. If my fan is off, the case will not execute. Set your speeds and temperature thresholds as you see fit.

edit : I appreciate I didn’t set my variables properly