I have wired an NodeMCU ESP8266 to an SHT30 humidity monitor and publish its reading every 10 sec.
NodeRed subscribes to the published humidity topic and checks it against a threshold value (95%). If it's over that, then the flow publishes an ON value on a fanswitch topic, and another ESP8266, which subscribes to that topic (and has a relay controlling a bathroom fan), turns on the fan until it receives an OFF value. This all works well. Shower on, short delay, fan on. Shower off, slightly longer delay, fan off.
I have just added a momentary switch and a red and green LED to the ESP8266 that has the SHT30 sensor, with a view to introducing manual overrides to the humidity threshold switch (in an executable node in my NodeRed flow. I detect the switch and have it toggle between three modes on the ESP8266.
I'm not sure what the best pattern would be.
1/ keep the timing on the ESP8266 and use it to control the LEDs (red=fan off ie cease publishing the humidity value, green=fan on for 10 mins ie publish a high value humidity for a bit or both off=let the published humidity through.
2/ publish the switch mode (0, 1 or 2) and do the timing LED and fan control in NodeRed
Any thoughts on the best approach. The cease publishing method does mean the NodeRed dashboard won't have continuous humidity graphs for manual override periods. Are there gotchas for letting NodeRed take the strain in this scenario?