Gerade in Räumen in denen viel mit Wasser oder Wasserdampf „gearbeitet“ wird sollte man immer ausreichend lüften um Schäden und Gesundheitsgefahren durch entstehenden Schimmel zu vermeiden.
If you're one of those people who tend to forget things like this and happen to have a humidity sensor in the rooms in question, which also happens to be connected to your NodeRed installation, you can also be automatically reminded when the humidity is too high.
How to do this is described in the following article.
Safety instructions
I know the following notes are always kind of annoying and seem unnecessary. Unfortunately, many people who knew "better" have lost eyes, fingers or other things due to carelessness or injured themselves. Data loss is almost negligible in comparison, but even these can be really annoying. Therefore, please take five minutes to read the safety instructions. Because even the coolest project is not worth injury or other trouble.
https://www.nerdiy.de/sicherheitshinweise/
Affiliate links/advertising links
The links to online shops listed here are so-called affiliate links. If you click on such an affiliate link and make a purchase via this link, Nerdiy.de will receive a commission from the relevant online shop or provider. The price does not change for you. If you make your purchases via these links, you support Nerdiy.de in being able to offer other useful projects in the future. 🙂
Requirements
Helpful articles:
To be able to use this configuration, NodeRed should of course already be installed.
How to prepare a RaspberryPi and then install NodeRed on it is described in the following articles.
The following articles describe what has to be done to prepare the RaspberryPi so far:
RaspberryPi – setup for nerdiys!
RaspberryPi – The first configuration!
RaspberryPi – Control the RaspberryPi via SSH
NodeRed – Installing NodeRed on the RaspberryPi
NodeRed – Install new nodes
Required material:
-no-
Required material:
In the following list you will find all the parts you need to implement this article.
Log into the NodeRed configuration interface
Before you can edit your NodeRed configuration, you must - if activated - first log into the NodeRed configuration interface.

Need to install nodes
Für dieses Beispiel werden neben den Standard-Nodes außerdem die Nodes „node-red-node-pushbullet“ und „node-red-dashboard“ genutzt. Damit dieses beispiel bei Euch funktioniert, müsst Ihr diese Nodes installieren. Wie Ihr Nodes installiert ist im Artikel NodeRed – Install new nodes described.
Import node code
The core function of this example is to create a moving average from the most recent humidity values and then check whether this exceeds a certain value. In this context, moving average means that the average is always determined from the last (for example) ten measured values. This has the advantage that one-time peaks in the measured values do not cause an alarm. Only a permanent increase in humidity causes the value of the moving average to rise above the set limit and thus trigger an alarm.
To import this example into your NodeRed installation, you need to import the Node code below. You can find tips on this in the article NodeRed – Import and export node code.
After importing, remember to position the dashboard nodes on your dashboard. You can find tips on this in the article NodeRed - Create a user interface with dashboard nodes.
You may also need to provide an API key for the Pushbullet node. This is also in the article Register Pushbullet API Key described.


[{"id":"f73f8a41.7d9278","type":"mqtt in","z":"4131a41e.b9233c","name":"","topic":"bathroomTemp","qos": "2","broker":"ddb40b41.78ae38","x":780,"y":1340,"wires":[["93e1108d.ad9c7"]]},{"id":"93e1108d.ad9c7 ","type":"smooth","z":"4131a41e.b9233c","name":"","property":"payload","action":"mean","count":"10" ,"round":"","mult":"single","x":960,"y":1340,"wires":[["d7851151.0479b","8465689.bf4d298"]]},{ "id":"8465689.bf4d298","type":"debug","z":"4131a41e.b9233c","name":"","active":false,"tosidebar":true,"console" :false,"tostatus":false,"complete":"false","x":1150,"y":1280,"wires":[]},{"id":"589714bd.e93cec","type ":"pushbullet","z":"4131a41e.b9233c","config":"1788f4a5.0c63bb","pushtype":"note","title":"SmartHome","chan":""," name":"SmartHome","x":1470,"y":1340,"wires":[]},{"id":"d7851151.0479b","type":"function","z": "4131a41e.b9233c","name":"check","func":"msg.payload=msg.payload>context.global.maxHumiBath; return msg; ","outputs":1,"noerr":0, "x":1110,"y":1340,"wires":[["6a9e9862.05e698"]]},{"id":"290bb7a0.63d8c8","type":"ui_numeric","z": "4131a41e.b9233c","name":"","label":"Max.Humidity Bathroom","group":"6938a6b5.5f1de8","order":0,"width":0,"height": 0,"passthru":true,"topic":"","format":"{{value}}","min":"30","max":"100","step":1," x":1210,"y":1380,"wires":[["7c2998ea.ef3658"]]},{"id":"dd457329.9d893","type":"inject","z":" 4131a41e.b9233c","name":"load StandardValue","topic":"","payload":"70","payloadType":"num","repeat":"","crontab":"" ,"once":true,"onceDelay":0.1,"x":960,"y":1380,"wires":[["290bb7a0.63d8c8"]]},{"id":"7c2998ea.ef3658" ,"type":"function","z":"4131a41e.b9233c","name":"save maxHumiBath","func":"context.global.maxHumiBath=msg.payload; return msg;","outputs":1,"noerr":0,"x":1430,"y":1380,"wires":[[]]},{"id":"6a9e9862.05e698", "type":"trigger","z":"4131a41e.b9233c","op1":"Humidity in bathroom is high.","op2":"0","op1type":"str","op2type" :"str","duration":"0","extend":false,"units":"ms","reset":"false","bytopic":"all","name":"", "x":1280,"y":1340,"wires":[["589714bd.e93cec","ee53da08.077d68"]]},{"id":"ee53da08.077d68","type":"ui_toast ","z":"4131a41e.b9233c","position":"dialog","displayTime":"25","highlight":"","outputs":1,"ok":"OK"," cancel":"","topic":"Information","name":"Information","x":1470,"y":1300,"wires":[[]]},{"id":" ddb40b41.78ae38","type":"mqtt-broker","z":"","name":"Server-Mqtt","broker":"server.fritz.box","port":"1883 ","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0", "birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":"" },{"id":"1788f4a5.0c63bb","type":"pushbullet-config","z":"","name":"FabsPushbullet"},{"id":"6938a6b5.5f1de8", "type":"ui_group","z":"","name":"Values","tab":"fddf98ef.773da8","disp":true,"width":"6","collapse" :false},{"id":"fddf98ef.773da8","type":"ui_tab","z":"","name":"Settings","icon":"dashboard"}]
Adjust values
In this configuration, two values determine the function.
On the one hand, there is the limit value, which determines at what humidity level an alarm is issued. This can be set directly via the dashboard node.
Zum anderen kann man durch erhöhen oder verringern der Anzahl der Werte aus denen der gleitende Mittelwert bestimmt wird, steuern wie „träge“ – aber dafür genauer – der Alarm reagiert. Bezieht sich der gleitende Mittelwert auf sehr wenige Werte, werden Änderungen (und auch Überschreitungen des Grenzwerts) schneller erkannt. Leider können somit auch sehr kurzfristige Messwertänderungen wie Messfehler zu einer falschen Auslösung des Alarms führen.
It's best to experiment a little with the values and see what's best for your case. In this example, the limit value is 70% humidity with ten values on which the moving average is based.

Have fun with the project
I hope everything worked as described for you. If not or you have questions or suggestions please let me know in the comments. I will then add this to the article if necessary.
Ideas for new projects are always welcome. 🙂
PS Many of these projects - especially the hardware projects - cost a lot of time and money. Of course I do this because I enjoy it, but if you think it's cool that I share the information with you, I would be happy about a small donation to the coffee fund. 🙂