Newbie writing pistons in webCoRE automating a ceiling fan with a temp sensor questions

So I am trying to figure out how to automate my ceiling fans speed dependent upon temp. So let’s say at 69-69 low, 70-71 medium, 72-73, medium high, and 74 up high. I have a couple of questions…

How do I shut the fan off at 67 deg F or below?

How to I have it bypass the rule entirely if I am running it on the Comfort Breeze setting?

You can use the case statement to determine the temperature range

Case 77-999 set fan speed to high
Case 74-76 set fan speed to medium
Case 68-73 set fan speed to low
Case 0-67 turn fan off

Then you can add additional qualifiers such as thermostat operating state is on off and have the cases adjust accordingly. I.e. if the thermostat turns on a/c you can adjust the fan speed above to lower speed or turn off depending on what you prefer.

You can also add lots of additional things like:
How to turn off when you want (when you don’t want them to automatically turn on again)
Manage multiple fans
Different parts of the day
Perhaps only some months of the year depending on where you live.
And account for home/away if you want them to turn off when you are away.

I have a working 3 fan speed pistons. I’ve been trying to convert my “if/then” pistons to “Case”, but haven’t been able to figure it out. I can’t get the temp range to work with what you have above.

Import code: ijmkz

1 Like

Thanks! That helped me realize that sometime you have to click on the drop down and select the correct case type. lol

How would case work?

I have my pistons working using if then else statements. And it seems to function the way I expect however I’m looking to elaborate on the art as it were so for example if we the humans are going to be out of the house for longer periods I want to bump the temperature up a couple of degrees for each fan speed I do want to keep the pets comfortable shile we are there and of course I don’t want to keep them running full tilt during the Winter.

You may want to post an image of your piston on the webcore forum and ask folks for assistance. The folks over there enjoy helping others build their pistons.

My very simple pistion

You have range 71-74 duplicated

1 Like

Good catch, the second case should be 65 through 70