Help with bathroom button

Hi.
I admit im not good at programming. Im stuck with a program.
In addition to smarter humdity fan i need manual control too.
Its a button that switches the fan and the light on off.
Unfortunatelly my family members unable to asses how humid the bathroom is.
So for the batroom button to switch i need two conditions.
One, that after they turned it on manually it waits for 5 minutes and if the humidity is lower than 80% and there is no motion it turns off.
The second option (this is where i got stuck) that there should NOT be able to turn it off if the humidity is still above 80%. maybe i should take it apart to two separate rules.
thanks in advance

Unless the manufacturer of the switch allows isolation between the switch presses and the relay within (Inovelli and Zooz do) then you can't exactly do what you need. A regular smart switch is in direct control of the internal relay. Someone clicks/taps/presses Off, then the fan goes off. Your Hub can fight back and turn it back on, but that will be noticable. :slight_smile:

i have a light switch like this on some smart lights.

you can still sense the turn off for instance. and then run your rule and if humidity is still too high turn it BACK on in the rule. just like you said above.. annoying but it works..

in my kitchen bar light rule.. if the switch is turned off.. it waits one minute then turns it back on,, then turns the smart bulbs back off.

you could wait a minute like me, so that if someone turns it off.. they will leave the bathroom before you turn it back on so as not to annoy them lol

Assuming your first rule to wait 5 minutes works, I would just do a 2nd rule:

Use Required Expression:
Switch is off

Trigger:
Humidity above 80%

Actions:
Turn on light/fan
Wait for condition: Humidity below 60%
Turn off light/fan

The “Required Expression” will avoid the rule running and turning off the light if it has been turned on manually.

1 Like

Here's what I have done for this with my bathrooms..

I have a Nest thermostat that reads my internal humidity and I use that as a reference. Any time that value is changed, a Hub Variable called nestHumidity is updated with the current value.

In my bathrooms, I have small ZigBee temp/humidity sensors. In rule Machine, I have a rule that creates a local variable called currentHumidity that updates whenever the humidity in the bathroom changes, and then some Rule Machine logic that compares the two values. If the difference from the reference (nestHumidity) is greater than 20, the fan will turn on and stay running until the difference is <15 for 5 minutes.

1 Like