Skip to main content

Humidifier entity

A humidifier entity is a device whose main purpose is to control humidity, i.e. a humidifier or dehumidifier. Derive entity platforms from homeassistant.components.humidifier.HumidifierEntity

Properties

tip

Properties should always only return information from memory and not do I/O (like network requests). Implement update() or async_update() to fetch data.

NameTypeDefaultDescription
actionHumidifierAction | NoneNoneReturns the current status of the device.
available_modeslist[str] | NoneRequired by MODESThe available modes. Requires SUPPORT_MODES.
current_humidityfloat | NoneNoneThe current humidity measured by the device.
device_classHumidifierDeviceClass | NoneNoneType of hygrostat
is_onbool | NoneNoneWhether the device is on or off.
max_humidityfloatDEFAULT_MAX_HUMIDITY (value == 100)The maximum humidity.
min_humidityfloatDEFAULT_MIN_HUMIDITY (value == 0)The minimum humidity.
modestr | NoneRequiredThe current active mode. Requires SUPPORT_MODES.
target_humidityfloat | NoneNoneThe target humidity the device is trying to reach.

Available device classes

ConstantDescription
HumidifierDeviceClass.DEHUMIDIFIERA dehumidifier
HumidifierDeviceClass.HUMIDIFIERA humidifier

Modes

A device can have different modes of operation that it might want to show to the user. They could be viewed as presets or some device states with reduced or enhanced functionality for special conditions, i.e. "auto" or "baby". There are a couple of built-in modes that will offer translations, but you're also allowed to add custom modes if that better represents the device.

NameDescription
MODE_NORMALNo preset is active, normal operation
MODE_ECODevice is running an energy-saving mode
MODE_AWAYDevice is in away mode
MODE_BOOSTDevice turn all valve full up
MODE_COMFORTDevice is in comfort mode
MODE_HOMEDevice is in home mode
MODE_SLEEPDevice is prepared for sleep
MODE_AUTODevice is controlling humidity by itself
MODE_BABYDevice is trying to optimize for babies

Supported features

Supported features are defined by using values in the HumidifierEntityFeature enum and are combined using the bitwise or (|) operator.

ValueDescription
MODESThe device supports different modes.

Action

The action property may return the current operating state of the device, whether it is humidifying or idle. This is an informational property. Please note that when the device is off, the action attribute, if present, will automatically be replaced with "off". Also, please note that setting action to off does not replace the is_on property.

Current values for HumidifierAction:

NameDescription
HUMIDIFYINGThe device is currently humidifying.
DRYINGThe device is currently dehumidifying.
IDLEThe device is on but not active right now.
OFFThe device is switched off.

Methods

Set mode

class MyHumidifierEntity(HumidifierEntity):
# Implement one of these methods.

def set_mode(self, mode):
"""Set new target preset mode."""

async def async_set_mode(self, mode):
"""Set new target preset mode."""

Set humidity

If the current mode does not allow to adjust target humidity, the device should automatically change its mode to the one which makes it possible upon this call.

class MyHumidifierEntity(HumidifierEntity):
# Implement one of these methods.

def set_humidity(self, humidity):
"""Set new target humidity."""

async def async_set_humidity(self, humidity):
"""Set new target humidity."""

Turn on

class MyHumidifierEntity(HumidifierEntity):
# Implement one of these methods.

def turn_on(self, **kwargs):
"""Turn the device on."""

async def async_turn_on(self, **kwargs):
"""Turn the device on."""

Turn off

class MyHumidifierEntity(HumidifierEntity):
# Implement one of these methods.

def turn_off(self, **kwargs):
"""Turn the device off."""

async def async_turn_off(self, **kwargs):
"""Turn the device off."""