@roadiemoose
Here are my pistons and a simple smart lighting rule to control bathroom humidity. The pistons are from the original CoRE program.
Lighting for me is simple. Sense motion, turn on light. If door is closed, light won’t turn off. By using the door sensor, I removed the problem of the light turning off while showering (not seeing any motion or using multiple motion sensors) or if your sitting quietly in the bathroom for awhile. I also used it for updating the global humidity variable. I’m sure I could have written logic to work without the door sensor but, I had the sensor and it made sense to use it.
First, I’m using an Aeon gen 5 multsensor to monitor motion and humidity. I’m ignoring lux and temp. I have the humidity set to update every 4 minutes and motion to 1 minute. Because of these settings, I only get 2-3 months out of a set of batteries. I would think any Multisensor would work as long as you can adjust the update schedule. I.e. If it’s only reporting humidity every 16 minutes it’s not going to do you much good. I know from experience. I played with different humidity update times and 4 minutes seems to work the best for me.
For the bathroom door, I’m using a simple go control window/door sensor. Nothing fancy.
Above is my simple smart lighting rule that shuts the bath fan off after 60 minutes regardless of conditions. You can set this to whatever time you want. My wife will take approximately 60 minute baths and without the fan running, the room will get too warm. Yes, the humidity rises just about as fast during a bath as a shower. I was surprised by this, though this is a small room in our home.
Above is my piston that captures the humidity level of the bathroom each time it changes as long as the bathroom door is open. I use this value as a reference and I don’t want it to update when the door is closed (possibly showering).
In this piston we are storing the humidity in a global variable called @BathroomHumidity. The “@” sign makes the variable global so it can be used in other pistons. As long as the door is open and our virtual switch called “Humidity Bathroom Exhaust Latch Switch” is off, we update the global variable. I use the virtual switch to keep track if the fan is on because of rising humidity.
The above piston sets a virtual latch switch (manual bath exhaust latch switch) if the fan is turned on manually. My bride will use cleaners and will often turn the fan on to vent the bathroom. We don’t want the fan shutting off during this manual turn on state. This piston also resets both virtual latch switches when the fan finally turns off for any reason. Either by manually turning it off, dropping humidity level or timing out from our simple smart lighting rule that sets a 60 minute max run time.
The piston above is the piston that controls the fan based on humidity. The first IF/THEN checks that the door is closed, the humidity has risen 5% above our stored value and also makes sure we are not in a manual latched turn on state. If all of this is true, we turn on the humidity latch virtual switch and then turn on the fan. I believe I found I needed the short delay befire turning on the fan to get the virtual switches to set correctly. It’s been awhile but I know I needed the delay.
The ELSE/IF looks for two conditions. The first checks and makes sure that the fan is on because of humidity. If it is, it looks at an outlet that controls my house humidifier (humidifer outlet) to see if it’s on. If the outlet is on, the house needs the humidity so the fan will shut off as soon as the door opens to let the needed humidity escape into the house. If the house doesn’t need the humidity, the fan continues to run.
The second part just checks to see if the humidity is now low enough to turn the fan off. I used a value of within 1%. Here is why I had to use virtual switches. If the fan is on because of humidity and the door is open, we don’t want our global variable updating.
I live in Northern Michigan and indoor humidity level here in the winter has a lot to do with the outdoor temps. The lower the temp outside, the lower the ideal humidity inside or your windows and walls will sweat. This is why I tied the bath humidity to the house humidity. I can also use a much smaller humidifier by using the bathroom to help humidify the house. I found a smart app that looks at outside temp and inside humidity to decide if the humidifier should be turned on or not and control my humidifier outlet with that app. Since setting this up, I rarely get sweaty windows and my wife’s sensitivity to the winter dryness has gone away.
I know there is a lot here. Any questions ask. I try to get on daily but sometimes it’s every couple days especially during the weekend.
Best of Luck
Steve J