Switch a fan based on absolute humidity difference between two humid/temp sensors

Hope it’s OK to re-awaken this thread instead of making a new one.

I have a slightly different use case in mind, and as a Home Assistant newbie would value any advice before I go and buy the devices.

We have a central MVHR air circulation system in the attic, effectively one big fan which extracts air from the bathroom and two en-suites. It’s running all the time but when someone is having a shower the steam quickly builds up. It has a “boost” switch which puts it on full power, but no-one remembers to use it, and boost makes it noisy so I don’t want to leave it running in boost all the time.

So my plan is to put a “dry contact” relay in parallel with the boost switch, and extend the blueprint presented here, to read 3 humidity/temp sensors in the bathrooms and compare them with one reference sensor in the living room like this:

  • Calculate the absolute humidity for all four sensors
  • Calculate the three differences of each bathroom compared with the reference sensor
  • If any difference is above the high threshold, turn boost on
  • If all the differences are below the low threshold, turn boost off (maybe with a little run-on period)

To further complicate it, I want boost to only be used between the hours of 07:00 and 21:00 (because of the noise). And I want to force the boost off at 21:05 if it’s still running. I think I can achieve that using conditions and a separate time trigger at 21:05.

It looks like I will have to write out the absolute humidity calculations for each of the sensors, perhaps encapsulating the formula in a macro. And then OR and AND the comparisons together when figuring out the new fan state.

In the blueprint presented in this thread, it looks like the string “unknown” can be passed to the computations - how can you guard against that? If any of the sensors are reporting “unknown” then I would like to take it out of the comparison - or abandon the current trigger and wait for the next update.

I thought that rather than triggering on state changes, I might trigger on a timer, say every 1 or 2 minutes - what are the pros and cons? Anything else I’ve overlooked?

Thanks for any tips.