Skip to main content

Cover Entity

A cover entity controls an opening or cover, such as a garage door or a window shade. Derive a platform entity from homeassistant.components.cover.CoverEntity.

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
current_cover_positionint | NoneNoneThe current position of cover where 0 means closed and 100 is fully open.
current_cover_tilt_positionint | NoneNoneThe current tilt position of the cover where 0 means closed/no tilt and 100 means open/maximum tilt.
is_closedbool | NoneRequiredIf the cover is closed or not. Used to determine state.
is_closingbool | NoneNoneIf the cover is closing or not. Used to determine state.
is_openingbool | NoneNoneIf the cover is opening or not. Used to determine state.

Device Classes

ConstantDescription
CoverDeviceClass.AWNINGControl of an awning, such as an exterior retractible window, door, or patio cover.
CoverDeviceClass.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.
CoverDeviceClass.CURTAINControl of curtains or drapes, which is often fabric hung above a window or door that can be drawn open.
CoverDeviceClass.DAMPERControl of a mechanical damper that reduces air flow, sound, or light.
CoverDeviceClass.DOORControl of a door that provides access to an area which is typically part of a structure.
CoverDeviceClass.GARAGEControl of a garage door that provides access to a garage.
CoverDeviceClass.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.
CoverDeviceClass.SHADEControl of shades, which are a continuous plane of material or connected cells that expanded or collapsed over an opening, such as window shades.
CoverDeviceClass.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.
CoverDeviceClass.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 are defined by using values in the CoverEntityFeature enum and are combined using the bitwise or (|) operator.

ValueDescription
OPENThe cover supports being opened.
CLOSEThe cover supports being closed.
SET_POSITIONThe cover supports moving to a specific position between opened and closed.
STOPThe cover supports stopping the current action (open, close, set position)
OPEN_TILTThe cover supports being tilting open.
CLOSE_TILTThe cover supports being tilting closed.
SET_TILT_POSITIONThe cover supports moving to a specific tilt position between opened and closed.
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(CoverEntity):
# 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(CoverEntity):
# 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(CoverEntity):
# 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(CoverEntity):
# 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(CoverEntity):
# 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(CoverEntity):
# 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(CoverEntity):
# 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(CoverEntity):
# 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."""