# Want to run if/then actions based upon MQTT humidity level sensor

**URL:** <https://discourse.nodered.org/t/want-to-run-if-then-actions-based-upon-mqtt-humidity-level-sensor/50299>\
**Category:** General\
**Created:** [27 August 2021 20:58 UTC](https://discourse.nodered.org/t/want-to-run-if-then-actions-based-upon-mqtt-humidity-level-sensor/50299 "2021-08-27T20:58:37Z")\
**Posts on this page:** 10\
**Page:** 2

<div class="post-metadata">

**Author:** ![Gunner](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gunner/32/43582_2.png) [@Gunner](https://discourse.nodered.org/u/Gunner)\
**Post date:** [28 August 2021 04:01 UTC](https://discourse.nodered.org/t/want-to-run-if-then-actions-based-upon-mqtt-humidity-level-sensor/50299/21 "2021-08-28T04:01:52Z")

</div>

> [@reverendalc](#):
>
> the ventilation in the bathrooms are used for two reasons:
> 
> 1. when we bathe, to control the humidity
> 2. when we poop, it frequently smells terrible

I couldn't resist... 😇

 ![A poo has been detected.PNG](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/a/baf683215787db98a66147584242715d79b3d83b.jpeg)

Inspiration from this video's 20 second intro - [https://www.youtube.com/watch?v=W5wwnKwDuTg](https://www.youtube.com/watch?v=W5wwnKwDuTg)

---

<div class="post-metadata">

**Author:** ![reverendalc](https://avatars.discourse-cdn.com/v4/letter/r/258eb7/32.png) [@reverendalc](https://discourse.nodered.org/u/reverendalc)\
**Post date:** [28 August 2021 04:05 UTC](https://discourse.nodered.org/t/want-to-run-if-then-actions-based-upon-mqtt-humidity-level-sensor/50299/22 "2021-08-28T04:05:53Z")

</div>

Haha. Smart home ideas? If you want to look like you’re pooping into the ark of the covenant!

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/b/1b19fb712a1b302c22f53f1a3a8c3db226300581.jpeg)

---

<div class="post-metadata">

**Author:** ![Gunner](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gunner/32/43582_2.png) [@Gunner](https://discourse.nodered.org/u/Gunner)\
**Post date:** [28 August 2021 04:05 UTC](https://discourse.nodered.org/t/want-to-run-if-then-actions-based-upon-mqtt-humidity-level-sensor/50299/23 "2021-08-28T04:05:55Z")

</div>

BTW, I would have the fan turn on manually (as would normally be done anyhow), and turn off when either humidity has dropped to a set level, or after a set time, whichever happens last. This way it should work for either smell or after shower purposes.

---

<div class="post-metadata">

**Author:** ![reverendalc](https://avatars.discourse-cdn.com/v4/letter/r/258eb7/32.png) [@reverendalc](https://discourse.nodered.org/u/reverendalc)\
**Post date:** [28 August 2021 04:12 UTC](https://discourse.nodered.org/t/want-to-run-if-then-actions-based-upon-mqtt-humidity-level-sensor/50299/24 "2021-08-28T04:12:53Z")

</div>

@gunner this is exactly my intention;

Fan is turned on manually.  
Fan runs for 10min  
After 10min, begins querying humidity  
If humidity is \< 50% fan turns off immediately  
Else, recheck every couple min until set point is reached.

This way, only one touch is necessary, and the fan runs correctly depending upon the occasion, with no unnecessary run time.

I’ll probably add some over-run timing after it’s fine tuned, and I’m not sure that 50% is the final number, but the goal is clear.

I currently have the fan on a 45min timer, but this sounds far more useful to me

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [28 August 2021 10:40 UTC](https://discourse.nodered.org/t/want-to-run-if-then-actions-based-upon-mqtt-humidity-level-sensor/50299/25 "2021-08-28T10:40:17Z")

</div>

Have you thought about what happens when the outside humidity is above 50%?

---

<div class="post-metadata">

**Author:** ![reverendalc](https://avatars.discourse-cdn.com/v4/letter/r/258eb7/32.png) [@reverendalc](https://discourse.nodered.org/u/reverendalc)\
**Post date:** [28 August 2021 14:58 UTC](https://discourse.nodered.org/t/want-to-run-if-then-actions-based-upon-mqtt-humidity-level-sensor/50299/26 "2021-08-28T14:58:14Z")

</div>

Outside humidity is frequently well over 50% here. Well before I decided to automate my bathroom ventilation, I automated my climate control, including heat/ac/humidity.

---

<div class="post-metadata">

**Author:** ![reverendalc](https://avatars.discourse-cdn.com/v4/letter/r/258eb7/32.png) [@reverendalc](https://discourse.nodered.org/u/reverendalc)\
**Post date:** [29 August 2021 15:55 UTC](https://discourse.nodered.org/t/want-to-run-if-then-actions-based-upon-mqtt-humidity-level-sensor/50299/27 "2021-08-29T15:55:21Z")

</div>

@jbudd

Your flow held the key to my solution, thank you!

I was unaware of flow. values until now

Cheers

---

<div class="post-metadata">

**Author:** ![fugit185](https://avatars.discourse-cdn.com/v4/letter/f/a87d85/32.png) [@fugit185](https://discourse.nodered.org/u/fugit185)\
**Post date:** [4 September 2021 16:33 UTC](https://discourse.nodered.org/t/want-to-run-if-then-actions-based-upon-mqtt-humidity-level-sensor/50299/28 "2021-09-04T16:33:31Z")

</div>

I haven implemented yet but I tested cheap sonar which gives 0/1 if water is there or not. So put that outside of your toilet water tank and when you flush, water level lowers and sonar gives 0. This then triggers fan. You can also detect is it poo or pee because flsuhing first one use more water (at least here in Finland) so water level goes lower then.

---

<div class="post-metadata">

**Author:** ![reverendalc](https://avatars.discourse-cdn.com/v4/letter/r/258eb7/32.png) [@reverendalc](https://discourse.nodered.org/u/reverendalc)\
**Post date:** [4 September 2021 19:47 UTC](https://discourse.nodered.org/t/want-to-run-if-then-actions-based-upon-mqtt-humidity-level-sensor/50299/29 "2021-09-04T19:47:44Z")

</div>

This is a neat idea. Those flushers aren’t required where I am, but I have access to them.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [3 November 2021 19:47 UTC](https://discourse.nodered.org/t/want-to-run-if-then-actions-based-upon-mqtt-humidity-level-sensor/50299/30 "2021-11-03T19:47:46Z")

</div>

Closed on 3 November 2021 19:47 UTC

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.

[Previous page](https://discourse.nodered.org/t/want-to-run-if-then-actions-based-upon-mqtt-humidity-level-sensor/50299.md?page=1)
