I have only an Explanation for Problems with the “=”, this one is for assigning a value, for comparing use"==".
Other then that, we would need the code and the reported errors in order to help.
Here is the code, sorry stil no acces to the error log.
I am running openhabian on a raspberry pi 2, the release version not the beta.
val maxHumidity = 50
val minHumidity= 48
rule "Turn on fan"
when
Item esp_douche_hum changed
then
if(esp_douche_hum.state as Number > maxHumidity) {
if(Douche.state != ON) Douche.sendCommand(ON)
}
else if(esp_douche_hum.state as Number < minHumidity) {
Douche.sendCommand(OFF)
}
end
At last at home and time to check some things out.
still having error’s but the rule seems to work, what could cause the error ?
2018-01-11 17:50:20.757 [INFO ] [el.core.internal.ModelRepositoryImpl] - Refreshing model 'fan.rules'
2018-01-11 17:50:20.777 [WARN ] [el.core.internal.ModelRepositoryImpl] - Configuration model 'fan.rules' is either empty or cannot be parsed correctly!
2018-01-11 17:50:21.969 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'fan.rules'
and these are the rules
val maxHumidity = 50
val minHumidity= 48
rule "Turn on fan"
when
Item esp_douche_hum changed
then
if(esp_douche_hum.state > maxHumidity) {
if(Douche.state != ON) Douche.sendCommand(ON)
}
else if(esp_douche_hum.state < minHumidity) {
Douche.sendCommand(OFF)
}
end
and the error which i had the first time in my given example
2018-01-11 17:55:44.923 [INFO ] [el.core.internal.ModelRepositoryImpl] - Refreshing model 'fan.rules'
2018-01-11 17:55:44.984 [WARN ] [el.core.internal.ModelRepositoryImpl] - Configuration model 'fan.rules' is either empty or cannot be parsed correctly!
2018-01-11 17:55:45.414 [WARN ] [el.core.internal.ModelRepositoryImpl] - Configuration model 'fan.rules' has errors, therefore ignoring it: [11,57]: missing '>' at ')'
You have no Errors only Warnings. The observed Warning is caused by opening the file in an editor. Only the last warning is a syntax problem, look at the line11 and column 57 to find the problem.