Bathroom Fan & Humidity sensor automation—help needed

Hi,

Fairly new to smartthings.

I have set up a fairly simple automation in that once humidity equals to or is above 75% then the extract fan turns on. This is being done via sonoff sensor and miniswitch. I also have another routine set up for the opposite to turn off the fan at 74% or below.

Now first issue im having is it is currently 78% in the bathroom and it doesn’t automatically turn on unless I turn the fan on through the app. The other routine does work then.

Secondly can I set up a manual switch override as the sonoff miniswitch ZBMINIR2 has switch input, but currently with routine activate it overrides the manual switch i have in place.

Finally can have the routines not running between a certain, overnight, so the fan remains off unless manually switched on?

Any ideas? Pretty sure its a simple solution! Screenshot below:

Thanks

Smartthings only trigger events when there is a change. If the humidity is stable anda new value is not reported by the device it will not be triggered.

for this you can use a time based pre condition:

3 Likes

Thank you that’s interesting to know.

Is there a work around? Ive installed the edge drivers but this only works with temperature.

Thanks

Workaround for what?

Are you saying that the humidity are not changing?

Because if its 78% and the device reports a change to 77% or 79%, for example, it should trigger the routine and turn on the fan. You just need to wait.

Or you can manually start the fan in the first time to bring down humidity, device will stop when bellow the target and turn on again when equal or above.

You can try to turn off the fan a little bit bellow the turn on value. For example, turn on with 75% and turn off with 70%. This is because when the fan turn off, humidity tends to grow up a little bit. If the targets are the same you can have a situation where the fan stays turning on and off frequently or, maybe, fan turn off and humidity grow up the target so fast that the turn on event is missed.

Or,

2 Likes

It was more that when I turned on the routine, I was expecting the fan to come on as it was within the parameter I set. But I you said it needed to change before starting and I working well now.

Next I want to look at a manual override when the fan is not on but say I want to turn on via the the wall switch for smells for example. I am using the Sonoff zbminir2 which seems to have switch input but unable to program in smartthings.

Thanks

My understanding of your installation is that you have a single zbminir2 that you used in conjunction with a humidity sensor to automate the bathroom fan, right?The zbminir2 has terminals to attach a physical “dumb” wall switch, then you can operate it without a routine or app, but you still can turn on/off through the app. In that case i don’t understand what you mean with “unable to program in smartthings “

Now, if for some reason, you have one zbminir2 in the ceiling controlling the fan and another in the wall to turn into smart a dumb switch (or even have a smart switch in the wall), then you have a situation similar to use a smart switch to control a smart bulb. You don’t need to wire this second module/switch to the load. You can use 4 automations to “sync” the states of the two zbminir2.

1 Like

Yes first assumption is correct but when I use the switch the routine overrides it as the humidity condition isn’t met

I thought I had wired in detached mode but when I turned it on, the off routine kept turning it off.

I’ll have to double check the sonoff instructions, albeit they are not the best!

Ok so further reading appears detached relay mode can only be done through ewelink? Is this correct?

Forget detached mode. Its used for when you have the zbmini in the wall switch with the load attached to a smart bulb, so you can use the manual switch to trigger routines to on/off the bulb, without operating the relay. In this situation, if you do not use detached mode when you turn off the switch, you will cut the power to the bulb.

There are no way to differentiate if the zbminir2 turned on/off through the manual switch, routine or app.

So you probably can use an extra motion sensor and run the routine to turn off only if there are no movement for some time.

or

Use another switch module (can be a zbminir2 or another inexpensive tuya device). You can put one switch module in the fan , always hard wired (lets call it switch1). And the other (could be the zbminir2 in detached mode) in the wall to make the dumb switch smart (switch2).

The logic is something like this.

For the automation:

  1. If switch2 = off and humidity >= X turn switch1 on

  2. If switch2 = off and humidity < X turn switch1 off

For the manual override:

  1. If switch2 = on turn switch1 on

  2. If switch2 = off turn switch1 off

Ps.: you dont need routine 4 if you want the automation assumes control immediately after manual off. This way, if you turn off manually and the humidity is lower than target the fan will be turned off by routine 2, but will stay on if the humidity is above target.

Occurred to me that you also can do something with just a a virtual switch (let’s call it vswitch):

Automation routines:

  1. If humidity >= X then “turn zbswitchr2 ON”; “turn vswitch ON”;

  2. If “vswitch == ON (precondition)” AND humidity < X then “turn zbswitchr2 OFF”; “turn vswitch OFF”;

this way, the routine to turn off the fan will only run if the fan was turned on by the routine to turn on; if you turned on the fan through the manual switch, the off routine will not be triggered.

3 Likes

Yes, virtual switches make great variables for keeping track of some binary state.

2 Likes

Apologies I completely missed this response, and it is a great response.

I will look into the switch option, currently the switch cuts power to the zbrmini in the wall but I will rewire as an override then look into switch option.

Will keep you posted!

1 Like