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#

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
target_humidityintNoneThe target humidity the device is trying to reach.
max_humidityintDEFAULT_MAX_HUMIDITY (value == 100)Returns the maximum humidity.
min_humidityintDEFAULT_MIN_HUMIDITY (value == 0)Returns the minimum humidity.
modestringNotImplementedError()The current active preset. Requires SUPPORT_MODES.
available_modeslistNotImplementedError()The available modes. Requires SUPPORT_MODES.
supported_featuresint(abstract method)Bitmap of supported features. See below.
is_onboolNotImplementedError()Whether the device is on or off.
device_classstringNoneEither DEVICE_CLASS_HUMIDIFIER or DEVICE_CLASS_DEHUMIDIFIER

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 constants are combined using the bitwise or (|) operator.

NameDescription
SUPPORT_MODESThe device supports different modes.

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."""
Last updated on