Generic Hygrostat implementation

Greetings fellow users.

I was excited to see the new generic hygrostat in the latest version, and was looking forward to using it in my setup. I have it configured in my configuration.yaml as specified, but it doesn’t seem to automatically activate. I notice that I get a new “hygrostat” showing in my default dashboard, but it will only activate if I manually select a humidity value that is less than the currently detected value. Since it is so new, I can only find documentation on the configuration.

here is my relevant code:

  - name: Bathroom Humidity
    humidifier: switch.mb_exhaust_fan
    target_sensor: sensor.4_in_1_sensor_humidity
    device_class: "dehumidifier"
    wet_tolerance: 5
    min_humidity: 50
    max_humidity: 60
    target_humidity: 55

I had previously set up 2 separate automations that would control the fan at set values. I had hoped that the new native Humidifier would allow a smart response to seasonally adjusted humidity values, but it seems that it locks it to a user selected value that can be randomly changed outside the configured parameters.

here is a snip of the new interface in the overview, as you can see, the value of 57 is not relevant to the config.yaml options.

What am I missing to have the control of the switch that is specified?

Thanks in advance,

The idea is that you set the value of humidity you want, e.g. 55% and if the actual measured humidity falls below that minus the default dry tolerance of 3, (as you have not set one) the switch turns on. So if set to 55% your switch should turn on at 52% (target - dry tolerance) and off at 60% (target + wet tolerance).

You can then adjust the set value according to season with automations if you wish to.

How so?

57% is between your configured min and max humidities.


Thank you for the clarification. I clearly got lost in the overall picture, and did not realize how both wet and dry would set the limits on either side. I was focusing on the “wet” side only. I was treating this as a binary switch in operation.

Also, as a new user, I forgot to reload my config.yaml. I was getting unexpected results and usage because of my error.

After additional reflection, I can see the benefit of using the hygrostat, as it effectively removes the duplicity of setting up separate automations to both turn on and turn off the fan. Even better, like you kindly pointed out, it allows 2 separate humidity values to control the turning on, and turning off at the top and bottom of a specified range.

Thank you for the insight.

Thanks to this and the new Tuya integration I have attempted to make a hygrostat that uses a govee thermo-hygrometer to determine the humidity level and control a dehumidifier accordingly. It works pretty well but just have a few questions:

Is there a way to determine what Away mode does? I imagine I’ll need to use an automation (especially as the modes don’t even seem to be accessible from HA) but I wanted it to change the dehumidifier to high/low mode.

Most importantly though, when I import this over to Apple Home it sets the “Current Relative Humidity” to 0% (but does still turn on/off based on the target sensor I set in HA). This wouldn’t really be an issue but it means the room’s current humidity shows as 0%. Any idea how to fix that?

  - name: Hygrostat
    humidifier: humidifier.electriq
    target_sensor: sensor.living_room_humidity
    min_humidity: 0
    max_humidity: 100
    target_humidity: 50
    device_class: dehumidifier
    dry_tolerance: 1
    wet_tolerance: 1
    away_humidity: 60

I really like this integration, and sucessfully created the entity, and it’s working fine. But I have solar pannels, and I would like to only use the device if I have spare energy to use it, or if I manually order it to. So, is it possible, somehow, to set an entity like this to turn on only when some other conditions are true?
Thanks in advance!

You should be able to control it with the service for example humidifier.turn_on
But when I doe this the hygrostat becomes “unavailable” or unstable: turning itself off or on again.


  • name: Dehumidifier
    humidifier: switch.dehumidifier
    target_sensor: sensor.humidity_garage
    min_humidity: 30
    max_humidity: 80
    target_humidity: 55
    dry_tolerance: 5
    wet_tolerance: 5
    device_class: “dehumidifier”
    seconds: 2000
    initial_state: true
    sensor_stale_duration: 00:60:00

It works fine, but when I reboot HA the dehumidifier never starts even if the humidity is currently above 70 degrees. Any solution for this?

Make a script that runs after HA restarts and set service humidifier.turn_on for your humidifier entity within.

Hi All,

I have implemented this on my home assistant using a switchbot to turn on and off a portable dehumidifier.

The issue I have is the dial says “on” regardless of whether the dehumidifier is on or off. See the below screenshot. The dehumidifier is off but it says on.

Screenshot 2022-03-30 155323

Config is as follows:

  - name: Bedroom
    humidifier: input_boolean.dehumidifier
    target_sensor: sensor.bedroom_temperature_and_humidity_humidity
    device_class: "dehumidifier"
    initial_state: 61
    target_humidity: 60
    min_humidity: 30
    max_humidity: 70
        minutes: 3

The switch is implemented via an input bool that has an automation that triggers the switchbot native button. The reason for this is that the button does not maintain the status of the switchbot it just toggles the state so I wanted a way to know if it was on or off in my UI.

This works great in Homekit except for the 0% relative humidity issue. Also have to set min and max to 0 and 100 which isn’t a problem for me.

Which fan did you purchase? looking for a zigbee Tuya one for the bathroom