Hi my rule is kinda working my problem is when the humidity value is not 90% or above or 80% and lower, if the humidity is above 90% or under 80% it works, but when it is between the 80% and 90% it doesnt send the on command to High85.
rule "Room humidity 90% loop"
when
Item FHum90 changed to ON
then if (Room_Humidity.state >=90) {
createTimer(now.plusSeconds(3)) [
High90.sendCommand(ON)]}
else if (Room_Humidity.state <=80) {
createTimer(now.plusSeconds(3)) [
Low90.sendCommand(ON)]}
else if (Room_Humidity.state >=81) {
createTimer(now.plusSeconds(3)) [
High85.sendCommand(ON)]}
end
Ok but i dont think that is the problem, my rule is first checking if the value is 90 or above, and then if the value is 80 or lower, so if my value is 85 it shouldnt trigger any of the rules and go to the last one that is checking if the value is 81 or above, and 85 is higher than 81 so it should work.
Perhaps it’s possible that the humidity is not a whole number. For example a humidity of 80.1 would fall through without sending any command. Are the Low90 and High85 items in the correct place in the rule? The way it is coded if the humidity is <=80 Low90 is set ON and if the humidity is between 81 and 90 High85 is turned on.
I believe this should work:
rule "Room humidity 90% loop"
when
Item FHum90 changed to ON
then if (Room_Humidity.state >=90) {
createTimer(now.plusSeconds(3)) [
High90.sendCommand(ON)]}
else if (Room_Humidity.state >=81) {
createTimer(now.plusSeconds(3)) [
Low90.sendCommand(ON)]}
else {createTimer(now.plusSeconds(3)) [
High85.sendCommand(ON)]}
end
I’m assuming the items are being turned off somewhere else.
I tried but it doesnt work i really dont understand what the problem is, the humidity is at 88% and it didnt send any command.
rule "Room humidity 90% loop"
when
Item FHum90 changed to ON
then if (Room_Humidity.state >=87) {
createTimer(now.plusSeconds(3)) [
High90.sendCommand(ON)]}
else if (Room_Humidity.state <87) {
createTimer(now.plusSeconds(3)) [
Low90.sendCommand(ON)]}
Now if i have it like this it works no problem other than i dont have the hability to turn High85 on but i can manage not having it.
The way the rule is set now the humidity is always between 87% to 92% and with the way i wanted it to work it would go between 78% and 92% but as is doesnt detect anything when the value is between 80% and 90% the loop stops.
And yes the items are being turned off by other rules this one just decides where to go according to the humidity levels.
The sensor doesnt measure as %
: tele/room/SENSOR = {“Time”:“2021-05-08T00:37:05”,“SI7021”:{“Temperature”:16.9,“Humidity”:85.7,“DewPoint”:14.5},“TempUnit”:“C”}
omits the usual | character after the [.
I’d always thought it was mandatory, but copy-paste of your code did not produce any complaints from code validator about it. And as you can see, the same omission works in my version, giving the delay.
This “closure” stuff with [ ] is weird