🚿 Bathroom Humidity Exhaust Fan

@Blacky

Thanks for your help. It works now. However, I have a problem with the whole mechanism, how do I select the remaining options?

Use The Trigger Sensor Bypass Option (Optional) : 2 - Enable the bypass - Turn the fan, lights & automation link OFF
Bypass Switch : my windows sensor (reversed)
Bypass - Extra Option : checked or not? (When you turn the bypass off - Turn the fan, lights & automation link OFF and do not run the automation.)
Use The Bypass Auto OFF Option (Optional) : enabled or disabled?

  1. Use The Trigger Sensor Bypass Option (Optional) : 2 - Enable the bypass - Turn the fan, lights & automation link OFF… correct.
  2. Bypass Switch : my windows sensor (reversed)… Yes the one you created.
  3. Bypass - Extra Option : checked or not? (When you turn the bypass off - Turn the fan, lights & automation link OFF and do not run the automation.)… not checked as when the window opens your sensor (bypass) should go OFF and you would like to run the automation if your trigger is active.
  4. Use The Bypass Auto OFF Option (Optional) : enabled or disabled?.. disabled as when the window is closed and your sensor is ON you don’t want it to go OFF.

Blacky :smiley:

@Blacky Thank You

The system works but not completely correctly.

Humidity increases - window closed - fan does not turn on - this is ok
window opens - fan turns on - this is ok
window closes - fan turns off - this is ok
window opens - fan does not turn on (but should) - this is not ok

Any ideas?

Questions

  1. Humidity increases - window closed - fan does not turn on - this is ok
  2. window opens - fan turns on - this is ok
  3. window closes - fan turns off - this is ok
  4. window opens - fan does not turn on (but should) - this is not ok

Answers

  1. I thought you only would like it to run when the window is open, so if the window is closed it will not run.
  2. Yes it should only run if the window is open, as I think your requested
  3. I think this is what you asked for.
  4. Depending on your settings.

Blacky :smiley:

@Blacky

Yes, the fan should be ONLY on when the window is open. but it may happen that someone closes the window while it is working… then the fan turns off - that’s ok but in a moment someone opens the window again and the fan should turn on again but it doesn’t start anymore.

What I mean is that it should be:
fan on when window open
I close the window - fan turns off
I open the window - fan turns on
I close the window - fan turns off
I open the window - fan turns on
etc.

and it is:
I close the window - fan turns off
I open the window - fan doesn’t turn on again
I close the window - no change
I open the window - fan doesn’t turn on again

This is because the trigger is not ON. If the Trigger - Humidity Derivative Sensor is above your setpoint then it will come ON. What you may have to do is use the Manual Triggeroption 2 with an auto off time delay. That way if you close the window and you would like it to run again you can trigger it manually.

Blacky :smiley:

well, the point is that the derivative sensor had high humidity all the time (the switch-on condition was met)

@Starfirepl

If the Trigger - Humidity Derivative Sensor was above your Rising Humidity Derivative the fan will come ON when you turn the bypass OFF. You are probably referring to the Bathroom Humidity Sensor being above your Maximum Humidity. I don’t think I have added that to the code and will need to look at it. I will put it on my list to do.

Just because you have high humidity doesn’t mean your Derivative Sensor is above it’s trigger setting.

Blacky :smiley:

@Blacky Your blueprint is amazing—my exhaust fan is working flawlessly now! I’m upgrading my current humidity and PIR sensors to the M5 ENVIII and M5 PIR for more accurate readings.

I have a quick question about powering the ENV-III and other M5 sensors. Since you’re using the I2C Hub 1-to-6 Expansion Unit, how long are your HY2.0-4pin cables? I’ve only been able to find cables up to 20 cm in length. Or, do you use the ATOM Lite ESP32 IoT Development Kit for powering all your sensors?

Thanks in advance for your help!

@Blacky

Newish to HA, Thanks for the blueprint, it appears to be working fine but I get the following error in the logs, is this a bug or something I need to fix or ignore?

  • Error evaluating condition in ‘Bathroom Fan On/Off’: In ‘condition’ (item 1 of 2): In ‘or’ (item 3 of 18): In ‘and’ (item 1 of 2): In ‘template’ condition: UndefinedError: ‘dict object’ has no attribute ‘entity_id’

Re HY2.0-4pin cable lengths-- I’ve been able to buy Grove cables of the following lengths (in cm): 5 / 10 / 20 / 50 / 100 / 200. (Yes, actually: 2 meter).

I found them via:
-M5Stack web site
-Select Store - Accessories
-Find the item for “Unbuckled Grove Cable 1m/2m/50cm…”
-Select the desired length in the pull-down on right side (“5cm-10pcs”).
-When you select the desired length, the SKU at top right will change (e.g., to “SKU: A034-E” for the 2m version.
-Copy down that SKU #.

I typically order M5Stack gear thru Digi-Key rather than direct from M5, due to shipping times (Minnesota vs. China). So:
-DigiKey web site
-Type SKU# (e.g., ‘A034-E’ into search bar at top (“Enter keyword or part #”) & hit Enter
-And order from there

@saurabhshetty316

Thanks for your kind words and welcome to the community.

What I do is use the cable that comes with the sensor then I cut it in half so you can extend the cable and have the GROVE connection on each end. My ESP32 and my HUB is is an easy location to access (all in one central location) with wires extended to where is needed. The humidity cable is around 4 meters long, my light sensor and motion sensor is about 7 meters long, my switch wire is about 10 meter long and I do have another motion sensor off this ESP32 that is about 10 meters long. So this little ESP32 is doing a lot never missing a beat. Tip: One thing is the humidity sensor. I clean it every 6 months, disconnect it (unplug it from the groove connection), pull it apart and clean it with compressed air and put it back. The location I have it gets a lot of dust/lint/fluff on it so moisture, dust and electronics :thinking:. I ordered spare humidity sensors so I am ready if one goes to god. One did because I didn’t clean it and the next one 1 1/2 years in still working.

The cable I use to extend the wires is a security cable 6 core (but you only need 4 core) 14/0.20mm and it came in 100 meter roll. If you google “Security cable 14/0.20mm” you should find it. I chose 14/0.20mm as the thickness, I wouldn’t go less but you could go more.

To join the cable I put heat shrink over each of the cables, then joined the wires soldering them together (make sure you put the heat shrink over the cable before you solder them together :rofl:), slide the heat shrink over your joins using heat to shrink the heat shrink and then I put another heat shrink over the whole cable where the join is. If you look closely in my setup photos you will see the joint and the heat shrink over the cables. Some is black and one is white heat shrink. I used Black to hide the cable in my exhaust grille.

Hope this helps you… let us know how you go once your up and running.

Blacky :smiley:

@abarr20142011

Could you please provide us your YAML of the automation? This YAML code are the settings you have selected in the automation so I can help. To do this go into your automation, top right 3 dots, Edit in YAML, copy all the code, come back to the forum and in your reply at the top tool bar click on “</>” and paste code in there.

Blacky :smiley:

Sure, here is what I have

alias: Bathroom Fan On/Off
description: ""
use_blueprint:
  path: Blackshome/bathroom-humidity-exhaust-fan.yaml
  input:
    trigger: sensor.bathroom_humidity_derivative
    fan_switch:
      device_id: 75942886d53d11089dc656247bdca2cf

@abarr20142011

Thanks that makes it easy.

Your Fan Switch needs to be set as an entity, not a device. Currently, it’s set as a device (blue), but it should be an entity (green). To change this, click the <> icon next to the X on the device you selected for the Fan Switch. This will show a list of entities associated with that device. From this list, select only the fan entity.

Blacky :smiley:

Awesome, thanks a lot!

1 Like

Have been testing this. If i create my own automation, a basic one that turns tree fan on and off based on the state of the light in the room it works fine, but when i use this automation I still get issues that the fan turns straight back on after it turns off.

@melewis1975

Could you please provide us your YAML of the automation? This YAML code are the settings you have selected in the automation so I can help. To do this go into your automation, top right 3 dots, Edit in YAML, copy all the code, come back to the forum and in your reply at the top tool bar click on “</>” and paste code in there.

Blacky :smiley: