Cover Entity

A cover entity is a device that controls an opening or cover, such as a garage door and window shade. Derive entity platforms from homeassistant.components.cover.CoverDevice.

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.

Platform Properties (to be implemented by deriving platform classes)

NameTypeDefaultDescription
current_cover_positionintNoneThe current position of cover where 0 means closed and 100 is fully open. Required with SUPPORT_SET_POSITION.
current_cover_tilt_positionintNoneThe current tilt position of the cover where 0 means closed/no tilt and 100 means open/maximum tilt. Required with SUPPORT_SET_TILT_POSITION
is_openingboolNoneIf the cover is opening or not. Used to determine state.
is_closingboolNoneIf the cover is closing or not. Used to determine state.
is_closedboolNotImplementedError()If the cover is closed or not. if the state is unknown, return None. Used to determine state.

Entity Properties (base class properties which may be overridden)

NameTypeDefaultDescription
device_classstringNoneDescribes the type/class of the cover. Must be None or one of the valid values from the table below.
supported_featuresint (bitwise)Value determined from current_cover_position and current_cover_tilt_positionDescribes the supported features. See the related table below for details.

Device Classes

ConstantDescription
DEVICE_CLASS_AWNINGControl of an awning, such as an exterior retractible window, door, or patio cover.
DEVICE_CLASS_BLINDControl of blinds, which are linked slats that expand or collapse to cover an opening or may be tilted to partially cover an opening, such as window blinds.
DEVICE_CLASS_CURTAINControl of curtains or drapes, which is often fabric hung above a window or door that can be drawn open.
DEVICE_CLASS_DAMPERControl of a mechanical damper that reduces air flow, sound, or light.
DEVICE_CLASS_DOORControl of a door that provides access to an area which is typically part of a structure.
DEVICE_CLASS_GARAGEControl of a garage door that provides access to a garage.
DEVICE_CLASS_GATEControl of a gate that provides access to a driveway or other area. Gates are found outside of a structure and are typically part of a fence.
DEVICE_CLASS_SHADEControl of shades, which are a continuous plane of material or connected cells that expanded or collapsed over an opening, such as window shades.
DEVICE_CLASS_SHUTTERControl of shutters, which are linked slats that swing out/in to cover an opening or may be tilted to partially cover an opening, such as indoor or exterior window shutters.
DEVICE_CLASS_WINDOWControl of a physical window that opens and closes or may tilt.

States

ConstantDescription
STATE_OPENINGThe cover is in the process of opening to reach a set position.
STATE_OPENThe cover has reached the open position.
STATE_CLOSINGThe cover is in the process of closing to reach a set position.
STATE_CLOSEDThe cover has reach the closed position.

Supported Features

Supported features constants are combined using the bitwise or (|) operator.

ConstantDescription
SUPPORT_OPENThe cover supports being opened.
SUPPORT_CLOSEThe cover supports being closed.
SUPPORT_SET_POSITIONThe cover supports moving to a specific position between opened and closed.
SUPPORT_STOPThe cover supports stopping the current action (open, close, set position)
SUPPORT_OPEN_TILTThe cover supports being tilting open.
SUPPORT_CLOSE_TILTThe cover supports being tilting closed.
SUPPORT_SET_TILT_POSITIONThe cover supports moving to a specific tilt position between opened and closed.
SUPPORT_STOP_TILTThe cover supports stopping the current tilt action (open, close, set position)

Methods

Open cover

Only implement this method if the flag SUPPORT_OPEN is set.

class MyCover(CoverDevice):
# Implement one of these methods.
def open_cover(self, **kwargs):
"""Open the cover."""
async def async_open_cover(self, **kwargs):
"""Open the cover."""

Close cover

Only implement this method if the flag SUPPORT_CLOSE is set.

class MyCover(CoverDevice):
# Implement one of these methods.
def close_cover(self, **kwargs):
"""Close cover."""
async def async_close_cover(self, **kwargs):
"""Close cover."""

Set cover position

Only implement this method if the flag SUPPORT_SET_POSITION is set.

class MyCover(CoverDevice):
# Implement one of these methods.
def set_cover_position(self, **kwargs):
"""Move the cover to a specific position."""
async def async_set_cover_position(self, **kwargs):
"""Move the cover to a specific position."""

Stop cover

Only implement this method if the flag SUPPORT_STOP is set.

class MyCover(CoverDevice):
# Implement one of these methods.
def stop_cover(self, **kwargs):
"""Stop the cover."""
async def async_stop_cover(self, **kwargs):
"""Stop the cover."""

Open cover tilt

Only implement this method if the flag SUPPORT_OPEN_TILT is set.

class MyCover(CoverDevice):
# Implement one of these methods.
def open_cover_tilt(self, **kwargs):
"""Open the cover tilt."""
async def async_open_cover_tilt(self, **kwargs):
"""Open the cover tilt."""

Close cover tilt

Only implement this method if the flag SUPPORT_CLOSE_TILT is set.

class MyCover(CoverDevice):
# Implement one of these methods.
def close_cover_tilt(self, **kwargs):
"""Close the cover tilt."""
async def async_close_cover_tilt(self, **kwargs):
"""Close the cover tilt."""

Set cover tilt position

Only implement this method if the flag SUPPORT_SET_TILT_POSITION is set.

class MyCover(CoverDevice):
# Implement one of these methods.
def set_cover_tilt_position(self, **kwargs):
"""Move the cover tilt to a specific position."""
async def async_set_cover_tilt_position(self, **kwargs):
"""Move the cover tilt to a specific position."""

Stop cover tilt

Only implement this method if the flag SUPPORT_STOP_TILT is set.

class MyCover(CoverDevice):
# Implement one of these methods.
def stop_cover_tilt(self, **kwargs):
"""Stop the cover."""
async def async_stop_cover_tilt(self, **kwargs):
"""Stop the cover."""