Generic hygrostat: support fan speed levels

I have a Stadler Form Karl (Big) connected via LocalTuya [0]. It has an “auto” feature which I don’t like because it never reaches its target. That’s mainly because it does not take into account how the room is ventilated (heat recovery systems blow in desert air). It doesn’t support hysteresis, leading to annoying frequent toggling between fan levels. Home Assistant to the rescue!

I built my own hygrostat to control the fan speed using some threshold sensors and automations. It reads from a separate humidity sensor that’s a bit further away from the device. It then takes into account what setting my home ventilation system is at and what humidity level it’s blowing (dry) air into the house, in order to pick the right fan speed.

In the long run it would be great if the Generic hygrostat integration could do all that. But for starters it would be nice if it supported fan speeds. Currently it only supports a binary on/off switch.

The Stadler has four levels, when it’s on (1 - 4). It can also be turned off, so that’s effectively level 0.

For my use case I’d like to be able to specify a template to decide what level to pick when humidity goes above or below the target (± hystereses). A simpler place to start would be to just increase/decrease it by 1 level (and again after some time passes).

[0] LocalTuya: Stadler Form Eva Humidifier - #17 by Sjors

If you think it’s a good idea, you should vote for it. I did…
Suggested Reading:
Feature Request Guidelines :notebook_with_decorative_cover: - Feature Requests - Home Assistant Community.