Rule
rule “dehumidifier”
when
Item GF_House_humidity changed
then
if Item (GF_House_humidity >= (Humidity_SP+1)){
dehumidifier.sendCommand(OFF)
} else {
if (GF_House_humidity < (Humidity_SP-1))
dehumidifier.sendCommand(OFF)
}
end
Error log
[WARN ] [el.core.internal.ModelRepositoryImpl] - Configuration model 'humidifier.rules' has errors, therefore ignoring it: [5,7]: extraneous input 'Item' expecting '('
It’s almost Christmas. @stuart22 Try this rule and see if it works the way you like. I’m not sure about the dehumidifier sendCommand OFF in both if and else if statements but you can adjust to fit your needs.
rule "dehumidifier"
when
Item GF_House_humidity changed
then
var Number house_hum = GF_House_humidity.state as Number
var Number hum_setpoint = Humidity_SP.state as Number
val Number offset = 1
if(house_hum >= (hum_setpoint + offset)){
dehumidifier.sendCommand(OFF)
}
else if(house_hum < (hum_setpoint - offset)){
dehumidifier.sendCommand(OFF)
}
end
Thank you so much i have been trying to get that working for a few days i was reading all the rules i could my mistake turning both off one should have been ON changed it and it works great
couldn’t see any examples of this but can use for turning heating on and off the same way
is there a page with some simple rule examples apart from https://www.openhab.org/docs/configuration/rules-dsl.html as this goes a bit to in depth for the beginners