Trigger fan when temperature changes


#1

**1) Give a description
Im trying to write a piston that turns on and off a fan when a temperature rises or falls below a certain temp

2) What is the expected behaviour?
Fan should turn on when temp rises and fan should turn off when temp drops

3) What is happening/not happening?
The fan doesnt turn on or off when temp hits thredhold

**4) Post a Green Snapshot of the piston

5) Attach logs after turning logging level to Full
I apologize in advance but this is beyond my capability


#2

Is your GE HVAC Dimmer #2 your fan? If so, I don’t see any code to turn it on. Also, there are several examples in the webCoRE community here that discuss this. I think some also provide piston examples. Have you searched there?


#3

Since Im a novice I was planning to take the easy route to create 2 seperate pistons, 1 for fan on and the other for fan off. I only include a screenshot for the off function. To test I made sure the fan was on when the temperature dropped below the threshold. The dimmer switch is controlling the fan.


#4

I often find that approach to be the easiest to understand. Once you have the pistons working, then you can combine them if you like.
On line 20, your trigger, you are comparing the same value. MasterTemp is equal to SO Temp & Humidity Sensor #1. So it will not “drops below”.

If you have a “Master Temp” set somewhere, and then compare it to SO Temp & Humidity Sensor #1, then the “drops below” trigger will fire when SO Temp & Humidity Sensor #1 drops below your “Master Temp.”


#5

So you will need to assign a value to MasterTemp, but not in the define statement the way you have it now. THEN you can compare those two values as you do in line 20. Does that make sense?


#6

You could define your MasterTemp with a value, possibly from your “MasterTemp” device, such as the one in your master bedroom

define
      integer MasterTemp = Master_Bedroom_Temperature's temperature;
end define

Then, your trigger would look like....

If SO Temp & Humidity Sensor #1's temperature drops below {MasterTemp}
  Then
    with
      GE VHAC Dimmer #2 (Guest)
    do
      Turn Off
    end with;

And include your “cooling” condition in the IF statement as you have already.


#7

Thank you for pointing out my error Pantheon.


#8

Now I just need to figure out how to set ghis thread to Resolved


#9

I don’t consider it an error…just something that you overlooked, like everyone else here has done at some point. Glad I could help.