SOLVED - Greenhouse Rules For Fans and Shutters

Define val constants at the top of the rule file, this way you only have to change them there instead of scrolling down and looking for them whenever there is a need to change them

val SHUTTER1_TEMP = 76
val SHUTTER2_TEMP = 78
val LOWFAN_TEMP = 79
val SINGLESPEEDFAN_TEMP = 85

rule "temperature"
when
    Item Indoor_Temperature changed
then
    logInfo("Temp Rule",Indoor_Temperature.state.toString)
    if (Indoor_Temperature.state >= SHUTTER1_TEMP) {
        Shutter1.sendCommand(ON)
    } else  { 
        Shutter1.sendCommand(OFF)
    }

    if (Indoor_Temperature.state >= SHUTTER2_TEMP) {
        Shutter2.sendCommand(ON)
    } else { 
        Shutter2.sendCommand(OFF)
    }

    if (Indoor_Temperature.state >= LOWFAN_TEMP) {
        LowFan.sendCommand(ON)
    } else { 
        LowFan.sendCommand(OFF)
    }

    if (Indoor_Temperature.state >= SINGLESPEEDFAN_TEMP) {
        SingleSpeedFan.sendCommand(ON)
    } else { 
        SingleSpeedFan.sendCommand(OFF)
    }    
end

ohhh, coding can be a beautiful thing! thats awesome! i will get that put in.

a question along those lines, I think I saw where you could put controls into the sitemap that you can change these values as well. I have not had a chance to get back and actually look through that. but that would be even better somewhere down the line here. i am hoping once i get these in that i dont have to change them very often.

i am also reading through the posts on how to override the rule time. right now it checks every 3 minutes so even if you want to have the fan on below the temperature then you have to keep turning it on every three minutes. lots of interesting posts on that one too.

right now, just thrilled that its all just cranking along!

thanks!