I just installed a smart switch for the bathroom exhaust fan, as well as have a zigbee temp/humidity sensor in the bathroom, so as far as hardware, I’m ready to go. I am not sure how to do the automation, though. I know I could easily do on/off setpoints for humidity, but the humidity in the house varies a little bit depending on the weather or the season.
I think what I’d like to happen is when we manually turn on the fan, it stores the current humidity in a variable, and then the fan runs until it returns to the value when it started. Is this something that can be done in Home Assistant, though? Are there any other better ways to automate an exhaust fan
Is there really a need to include this into your smart-home setup?
What I did, I purchased switches with built-in humidity sensor. They do kick in whenever there is too much humidity in the bathroom. Simple, not too smart, and self-contained… unless you want to track how often it kicks in, the humidity at any given time, and the like.
Here is the one I got, and it comes in two versions: humidity/fan only or with light. There is a setting also to adjust sensitivity, though I simply set mine in the mid-range.
This is the point: Humidity measures are relative.
If you simply measure a threshold value from the sensor, you will have false senses. Depending on the weather, it will start your fan and never stop until the natural humidity outside is below the threshold.
To overcome this, you can use 2 sensors instead; one outside the bathroom that mesures the base humidity and one that measures the actual humidity in the bathroom: calculate the delta between them and switch on when is is above a range. Switch it off when a target offset is reached or a timeout has passed.
Alternative, you can create a variable using this a variable component and store the humidity value every minute unless the delta threshold is meet. Use that as the refence value. calculate the delta between the reference and the actual sensor and switch on when is is above a range. Switch it off when a target offset is reached or a timeout has passed.