Trouble Converting to 4.0 Rule

I'm trying to convert this to a 4.0 rule:

I figure I need a conditional action where it's an IF Humidity > 90, but then how do I make it trigger what used to go in the false section when it drops below 90?

Not exactly the same, but this is what I do with mine.

What about something like this? I don't have a humidity sensor and my bathroom fan is connected to the light and is not automated, so I used a motion sensor and switch for my example.

Perfect! I hadn't thought of a wait event. That's exactly what I needed!

1 Like

You realize that this will turn on the switch every time the temp is recorded from the sensor and it is above that temp in the rule, right? It's not like a threshold where it only turns it on once when it crossed the threshold value. It performs the IF action every time the value is over the value you set and it performs the Else action every time it isn't. If you want to have it treated like a threshold you have to do some fun stuff with Private Boolean or a local variable.

If you are addressing my example, it is very much like the one I use to arm and disarm the HSM based on presence. I see your point though. Presence is either there or not.

Presence has two states. Temp has an infinite number. Every time the value is above 85, the switch will turn on. So, if the temp is 86 and the switch turns on, then you turn it off manually. Then the temp is recorded and it's 86 again, nothing will happen. But the next time it changes to 87, now the switch will turn on again. You turn it off by hand and then the temp changes to 86, the switch will turn on again.

The point is, the rule will fire every time the temp is received from the device and it will either turn it on or off every time (if the value is different than what was recorded previously. and it looks like you're reporting out to 1 decimal place so assume that it will NEVER be constant)

1 Like

Thanks for the explanation. I saw the other rule from bjcowles after I had posted my example. His is definitely the better rule for controlling humidity.

If you have more than one device that measures humidity, it is better, and much more accurate, to do it using 2 readings...This is an RM 3.0 rule, but you get the idea:

Or here is an RM 4.0 version:

im trying to time my bathroom fan on the basis of movement and humidity.
this rule is a new approach compared to the ones i saw so far, with the wait for condition command. and it seem to work. the only problem is that i dont understand fully. how it works? how the cancel wait works at the second line ? why the 2 second delay? and why 2 ?

Thank you