Sanity Check

I'm trying to write some automation in RM to manage the lights/fans in some bathrooms. I'm using the Bathroom Humidity Fan app to control a virtual switch
(Humidity Up) based on a humidity sensor above each shower. There's a motion sensor mounted above the door in each bathroom. I have a simple condition setup to turn on/off the fan along with the virtual switch.

I'm just hoping someone can sanity check me in case there's a simpler way to do this and to see if I missed anything.

The idea:

  1. If motion between 8 am - 11 PM; turn on the lights and cancel delayed actions.
  2. If motion goes inactive, the fan is off, and the virtual switch is off; set a short delay to turn off the lights and fan.
    Goal: Short delay for turning off the lights after a #1.
  3. If motion goes inactive, the fan is on, but the virtual is off; set a long delay timer to turn everything off
    Goal: Keep the lights and fan running during #2. Delay enough to vent the fumes after finishing.
  4. If motion inactive, fan is on, and virtual is on; cancel all delayed actions.
    Goal: Keep everything turned on for showers.


Can the fan be turned off while the virtual switch remains on?

Yes.

Instead of doing it all in RM, I am doing most of the work in the new RL app (formerly was doing it in the ML app). I have two identical setups, except the Master Bath has a slightly more complex RM to fade the light in at certain times. I honestly could do this all in RL if I setup my modes better, its on the to-do list.

Using this to control the fan based on humidity: [APP] Smarter Humidity Fan *FORK for Testing*

Here is my RL app:

Light comes on at 10% (RM adjusts it further)
Light can turn on via switch or Motion.
If the light is already on, do not activate (in case switch was turned on and level adjusted BEFORE motion is triggered).

For turning off, Motion inactive for 8 minutes, OR when the fan turns off, + 2 minutes delay (shown at bottom).
Do not turn off if Fan is on (someone in shower), or motion active (someone in bathroom).
This combo allows the motion to turn off, unless the fan is on, if the motion goes inactive and the fan is still on, and the fan later turns off, then the light will turn off in 2 minutes.

Here is the RM to adjust the level

1 Like

Does your SHF update break synchronization between the fan and virtual switch? I stopped using BHF to control the fan, because it was dual synchronized. When the fan was manually turned on, it would also turn on the virtual switch, which didn't work for what I'm trying to do.

I actually added a feature to remove/not create the virtual switch because I do not use it, I just check the status of the fan switch itself. Looking at the code for that which I have not touched in my forked version, the virtual switch, if used, would ONLY turn on when "Smart Mode" is engaged by the app. If the fan was turned on manually the virtual switch should not turn on until the the smart mode is engaged by the settings in the app. If the fan is turned OFF, smart mode is canceled, it could resume again at the next humidity event depending on various conditions in the settings.

The virtual switch did the trick. With the updated SHF, I was able to get rid of the separate RM for turning the fan on with the humidity check. Since they aren't sync'd, I'm able to turn the fan on without turning the humidity check virtual.

Awesome, let me know in the thread for the app if you find any issues with it. I have been using it for a few weeks now and it is working good in my application,