Bathroom Fan Automation / Hot Water Temp Sensor & Display

by jimsngc in Circuits > Electronics

15 Views, 1 Favorites, 0 Comments

Bathroom Fan Automation / Hot Water Temp Sensor & Display

20251224_060905.jpg
20251224_060915.jpg
20251231_161241.jpg

A family of 4 with 2 young adults who have a tendency to forget to either turn on the bathroom fan while showering or switch it on and then never return to turn it off, causing it to run all night (admittedly better than forgetting to turn it on at all).

Very loud bathroom fans. I mean, these things are loud. They only need to run when actually needed.

My daughter enjoys a quiet shower and does not like the fan to come on. I will meet her in the middle and give her 7 minutes of "quiet time" to shower before I kick that fan on. We don't want mold building up in, what is quite a small bathroom.

The guest restroom also has the laundry connected and when the washing machine runs, the humidity in this room is noticeably high. Turning the extraction fan on is key but this either does not happen or runs way past when needed.

Additionally, we moved to an all-electric house with a smallish water heater (we had a natural gas monster with circulation pump at the last house, so everyone was used to hot water almost on demand). During the winter months, even with bumping the water heater thermostat up, if someone takes a bath or if multiple people shower and run the dishwasher and/or washing machine, the water can feel tepid for an hour after as it recovers. Need a way to check the water temp so we know to hold on taking a bath/shower if the water is still reheating.

Supplies

HotWaterSensor-Front.jpg
DS18B20 Temp Sensors.png
20251224_061235.jpg
20251224_061219.jpg
20251224_061252.jpg
WaterTempDisplay-Screen.png
WaterTempDisplayCase.png

3x Aquara Temperature Humidity Sensors - 1 for each bathroom.

2x Tapo Smart Switches (in-wall type). Will probably do the master bath at some point too.

1x Energy tracking smart switch for the washing machine (so I can tell when it is drawing power)

1x ESP8266 Dev Board & WWZMDiB DS18B20 Temperature Sensor Probe High-Accuracy Waterproof Equipped with 4.7K resistor. The water heater temp probe.

1x Waveshare ESP32-C6 1.47inch Display Development Board, 172×320, 262K Color, 160MHz Running Frequency Single-Core Processor, Supports Wi-Fi 6 & BLE, with Colorful RGB LED, ESP32 with Display. The "water temperature" display.

Sensors

F6FNWB8MJI5JNHK.jpg
20251224_061253.jpg
FOUVZNDMJI5JNGE.jpg
HotWaterSensor-Back.jpg
20251224_060900.jpg
FMIR3PYMJI5JNKN.jpg
20251224_061222.jpg

We already have Home Assistant (HASS) monitoring various aspects of our house so adding the humidity sensors to each bathroom was as simple as adding them to the Zigbee integration, labelling in HASS and sticking to the wall in each bathroom. I then wired in Tapo smart light switches to each extraction fan and also added these to HASS. I had an old TP-Link plug-in smart switch with power monitoring kicking about which I used on the washing machine to give me insight into if it was pulling current above a certain threshold, indicating it was in use.

To address the water temperature issue, I needed a way to monitor the temp at the source. As this unit had no "smart" features and I needed a way to monitor without taking the unit to pieces, I elected to use a DS18B20 Temperature Sensor Probe and externally monitoring the return flow valve temp. Precision not being as import as trend data here. After watching it for a few weeks of regular use, I defined "Hot", "Tepid" & "Cold" thresholds which I could then use for alerts, gauges and other displays. I used an ESP8266 for the Hot Water Sensor board. An ESP32 would have been overkill for this very basic task. I soldered the DS18B20 & 8266 to a Perfboard and 3D printed a simple case to mount to the wall.

The most excellent ESPHome Builder integration and a little Gemini-Fu made the ESP config a breeze.


Automation

HASS-BathroomOverview.png
HASS-WaterTemp.png
NodeRed-Control-Logic.png

With all the sensor and control integrations setup, it was simple enough to build some NodeRed flows to monitor the humidity and time-of-run for each bathroom fan. Basically, if the fan was turned on, let it run for 10 mins and then check the humidity. If the humidity is high, loop for 5 mins and recheck. There is also a periodic check that monitors for rising humidity and once it hits a predetermined level, run the fan for 5 mins and recheck. For my "quiet" child, I added a 7 minute delay to this bathroom. Some logic was also added in the guest restroom to factor in if the washing machine was running or not.

Automations have come a long way in HASS in the past few years but when I started (many moons ago) I found them limiting and spent a could deal of time frustrated. NodeRED is a visual flow programming language which just "clicks" with me and is very well integrated into HASS. This is my choice for most all automations.

Monitoring & Display

WaterTempDisplay.jpg
20251231_162413.jpg
20251231_161331.jpg
20251231_161320.jpg
20251231_104315.jpg
Waveshare Board Temp.png

Initially I built a simple HASS dashboard for my "Bathrooms" so I could monitor but as I am the only one who is really into Home Automation (and would care to look), I needed a simpler way to show the water temperature to the non-tech users in the house. I initially played around with an ESP32, RGB-LED and a simple OLED display, which worked well but was proving hard to make into something compact enough to display in the bathroom(s). I finally decided on a Waveshare ESP32-C6 1.47inch Display Development Board, which provided a color screen to replace the RGB-LED visual color indicator and the LCD screen could also display the temperature as well. At $20 each, they are almost as cheap as the individual components would be and come pre-assembled. I have a 3D printer so printed a case to mount this in. This proved to be much simpler than trying to squeeze & solder all the parts into a custom housing. As you can tell from the water temperature probe pic, soldering is not my strongest skill (and I had to re-solder everything after that pic was taken for it to actually work). I am guessing this Waveshare board is fairly new as I could not find a case for it that was a good fit so I designed a snug housing for it in SketchUp and printed this using PTEG to handle the board heat output. I was a little wary of the heat dissipation at first but 24 hours in and the board temp remains well within the safety range. The ESPHome integration allows you to report back any onboard sensors on an ESP, to HASS, so I dropped a simple gauge in to keep an eye on the board internal temp. If I see it getting too hot it, I can disable the screen until it cools back down and automate as needed.

A link to the case design here:

https://www.printables.com/model/1536375-case-for-esp32-c6-147inch-board

The YAML files used for programming the boards via ESPHome Builder can be found here:

https://github.com/jimsngc/HotWaterHeaterSensorDisplay

The Waveshare board is quite small but by changing the LCD backlight color you can get a very quick visual queue on overall water temp (Red=Good, Orange=Cooler, Blue=Brrrr). I put the actual water sensor reading (for what it is worth) on the screen and also added the outside temp (from my weather station) as well as the current time and last updated time. If the water hits the lowest threshold, I flash the screen blue for added attention grabbing.

Conclusion

For the most part the system has held up well for the first month or use. I had one early morning when my Zigbee integration failed and the automation was having a fit turning fans on and off. I have also noted that humidity levels trend higher based on the ambient weather outside and I had to nudge the threshold levels so the fans are not constantly cycling on and off. When the weather is mild and the forced-air HVAC is not running, the humidity levels do rise in the house. As soon as the air runs (hot or cold) they drop right back down. Now that I am aware of this, I might program in some logic to better manage humidity overall. 60% in a small room is mold-level high so awareness and mitigation options are appreciated. My wife has asked when I am going to make her a display for the master bathroom. In the world of husband-tech projects, this indicates a noticeable win :)

In closing, I have yet to hear screaming and cursing about cold showers since rolling this solution out and my bathrooms are managing the fans & humidity for me. Now if I could just get people to close the doors.....