homeassistant.components

air_quality

Component for handling Air Quality data for your location.

class homeassistant.components.air_quality.AirQualityEntity[source]

Bases: homeassistant.helpers.entity.Entity

ABC for air quality data.

property air_quality_index

Return the Air Quality Index (AQI).

property attribution

Return the attribution.

property carbon_dioxide

Return the CO2 (carbon dioxide) level.

property carbon_monoxide

Return the CO (carbon monoxide) level.

property nitrogen_dioxide

Return the NO2 (nitrogen dioxide) level.

property nitrogen_monoxide

Return the NO (nitrogen monoxide) level.

property nitrogen_oxide

Return the N2O (nitrogen oxide) level.

property ozone

Return the O3 (ozone) level.

property particulate_matter_0_1

Return the particulate matter 0.1 level.

property particulate_matter_10

Return the particulate matter 10 level.

property particulate_matter_2_5

Return the particulate matter 2.5 level.

property state

Return the current state.

property state_attributes

Return the state attributes.

property sulphur_dioxide

Return the SO2 (sulphur dioxide) level.

property unit_of_measurement

Return the unit of measurement of this entity.

async homeassistant.components.air_quality.async_setup(hass, config)[source]

Set up the air quality component.

async homeassistant.components.air_quality.async_setup_entry(hass, entry)[source]

Set up a config entry.

async homeassistant.components.air_quality.async_unload_entry(hass, entry)[source]

Unload a config entry.

alarm_control_panel

Component to interface with an alarm control panel.

class homeassistant.components.alarm_control_panel.AlarmControlPanel[source]

Bases: homeassistant.components.alarm_control_panel.AlarmControlPanelEntity

An abstract class for alarm control entities (for backwards compatibility).

class homeassistant.components.alarm_control_panel.AlarmControlPanelEntity[source]

Bases: homeassistant.helpers.entity.Entity

An abstract class for alarm control entities.

alarm_arm_away(code=None)[source]

Send arm away command.

alarm_arm_custom_bypass(code=None)[source]

Send arm custom bypass command.

alarm_arm_home(code=None)[source]

Send arm home command.

alarm_arm_night(code=None)[source]

Send arm night command.

alarm_disarm(code=None)[source]

Send disarm command.

alarm_trigger(code=None)[source]

Send alarm trigger command.

async async_alarm_arm_away(code=None)[source]

Send arm away command.

async async_alarm_arm_custom_bypass(code=None)[source]

Send arm custom bypass command.

async async_alarm_arm_home(code=None)[source]

Send arm home command.

async async_alarm_arm_night(code=None)[source]

Send arm night command.

async async_alarm_disarm(code=None)[source]

Send disarm command.

async async_alarm_trigger(code=None)[source]

Send alarm trigger command.

property changed_by

Last change triggered by.

property code_arm_required

Whether the code is required for arm actions.

property code_format

Regex for code format or None if no code is required.

property state_attributes

Return the state attributes.

abstract property supported_features

Return the list of supported features.

async homeassistant.components.alarm_control_panel.async_setup(hass, config)[source]

Track states and offer events for sensors.

async homeassistant.components.alarm_control_panel.async_setup_entry(hass, entry)[source]

Set up a config entry.

async homeassistant.components.alarm_control_panel.async_unload_entry(hass, entry)[source]

Unload a config entry.

binary_sensor

Component to interface with binary sensors.

class homeassistant.components.binary_sensor.BinarySensorDevice[source]

Bases: homeassistant.components.binary_sensor.BinarySensorEntity

Represent a binary sensor (for backwards compatibility).

class homeassistant.components.binary_sensor.BinarySensorEntity[source]

Bases: homeassistant.helpers.entity.Entity

Represent a binary sensor.

property device_class

Return the class of this device, from component DEVICE_CLASSES.

property is_on

Return true if the binary sensor is on.

property state

Return the state of the binary sensor.

async homeassistant.components.binary_sensor.async_setup(hass, config)[source]

Track states and offer events for binary sensors.

async homeassistant.components.binary_sensor.async_setup_entry(hass, entry)[source]

Set up a config entry.

async homeassistant.components.binary_sensor.async_unload_entry(hass, entry)[source]

Unload a config entry.

camera

Component to interface with cameras.

class homeassistant.components.camera.Camera[source]

Bases: homeassistant.helpers.entity.Entity

The base class for camera entities.

async async_camera_image()[source]

Return bytes of camera image.

async async_disable_motion_detection()[source]

Call the job and disable motion detection.

async async_enable_motion_detection()[source]

Call the job and enable motion detection.

async async_turn_off()[source]

Turn off camera.

async async_turn_on()[source]

Turn off camera.

async_update_token()[source]

Update the used token.

property brand

Return the camera brand.

camera_image()[source]

Return bytes of camera image.

disable_motion_detection()[source]

Disable motion detection in camera.

enable_motion_detection()[source]

Enable motion detection in the camera.

property entity_picture

Return a link to the camera feed as entity picture.

property frame_interval

Return the interval between frames of the mjpeg stream.

async handle_async_mjpeg_stream(request)[source]

Serve an HTTP MJPEG stream from the camera.

This method can be overridden by camera platforms to proxy a direct stream from the camera.

async handle_async_still_stream(request, interval)[source]

Generate an HTTP MJPEG stream from camera images.

property is_on

Return true if on.

property is_recording

Return true if the device is recording.

property model

Return the camera model.

property motion_detection_enabled

Return the camera motion detection status.

property should_poll

No need to poll cameras.

property state

Return the camera state.

property state_attributes

Return the camera state attributes.

async stream_source()[source]

Return the source of the stream.

property supported_features

Flag supported features.

turn_off()[source]

Turn off camera.

turn_on()[source]

Turn off camera.

class homeassistant.components.camera.CameraImageView(component: homeassistant.helpers.entity_component.EntityComponent)[source]

Bases: homeassistant.components.camera.CameraView

Camera view to serve an image.

async handle(request: aiohttp.web_request.Request, camera: homeassistant.components.camera.Camera) → aiohttp.web_response.Response[source]

Serve camera image.

name = 'api:camera:image'
url: Optional[str] = '/api/camera_proxy/{entity_id}'
class homeassistant.components.camera.CameraMjpegStream(component: homeassistant.helpers.entity_component.EntityComponent)[source]

Bases: homeassistant.components.camera.CameraView

Camera View to serve an MJPEG stream.

async handle(request: aiohttp.web_request.Request, camera: homeassistant.components.camera.Camera) → aiohttp.web_response.Response[source]

Serve camera stream, possibly with interval.

name = 'api:camera:stream'
url: Optional[str] = '/api/camera_proxy_stream/{entity_id}'
class homeassistant.components.camera.CameraView(component: homeassistant.helpers.entity_component.EntityComponent)[source]

Bases: homeassistant.components.http.view.HomeAssistantView

Base CameraView.

async get(request: aiohttp.web_request.Request, entity_id: str) → aiohttp.web_response.Response[source]

Start a GET request.

async handle(request, camera)[source]

Handle the camera request.

requires_auth = False
class homeassistant.components.camera.Image(content_type: str, content: bytes)[source]

Bases: object

Represent an image.

async homeassistant.components.camera.async_get_image(hass, entity_id, timeout=10)[source]

Fetch an image from a camera entity.

async homeassistant.components.camera.async_get_mjpeg_stream(hass, request, entity_id)[source]

Fetch an mjpeg stream from a camera entity.

async homeassistant.components.camera.async_get_still_stream(request, image_cb, content_type, interval)[source]

Generate an HTTP MJPEG stream from camera images.

This method must be run in the event loop.

async homeassistant.components.camera.async_get_stream_source(hass, entity_id)[source]

Fetch the stream source for a camera entity.

async homeassistant.components.camera.async_handle_play_stream_service(camera, service_call)[source]

Handle play stream services calls.

async homeassistant.components.camera.async_handle_record_service(camera, call)[source]

Handle stream recording service calls.

async homeassistant.components.camera.async_handle_snapshot_service(camera, service)[source]

Handle snapshot services calls.

async homeassistant.components.camera.async_request_stream(hass, entity_id, fmt)[source]

Request a stream for a camera entity.

async homeassistant.components.camera.async_setup(hass, config)[source]

Set up the camera component.

async homeassistant.components.camera.async_setup_entry(hass, entry)[source]

Set up a config entry.

async homeassistant.components.camera.async_unload_entry(hass, entry)[source]

Unload a config entry.

homeassistant.components.camera.websocket_camera_thumbnail(hass, connection, msg)[source]

Handle get camera thumbnail websocket command.

Async friendly.

homeassistant.components.camera.websocket_get_prefs(hass, connection, msg)[source]

Handle request for account info.

homeassistant.components.camera.websocket_update_prefs(hass, connection, msg)[source]

Handle request for account info.

homeassistant.components.camera.ws_camera_stream(hass, connection, msg)[source]

Handle get camera stream websocket command.

Async friendly.

calendar

Support for Google Calendar event device sensors.

class homeassistant.components.calendar.CalendarEventDevice[source]

Bases: homeassistant.helpers.entity.Entity

A calendar event device.

async async_get_events(hass, start_date, end_date)[source]

Return calendar events within a datetime range.

property event

Return the next upcoming event.

property state

Return the state of the calendar event.

property state_attributes

Return the entity state attributes.

class homeassistant.components.calendar.CalendarEventView(component: homeassistant.helpers.entity_component.EntityComponent)[source]

Bases: homeassistant.components.http.view.HomeAssistantView

View to retrieve calendar content.

async get(request, entity_id)[source]

Return calendar events.

name = 'api:calendars:calendar'
url: Optional[str] = '/api/calendars/{entity_id}'
class homeassistant.components.calendar.CalendarListView(component: homeassistant.helpers.entity_component.EntityComponent)[source]

Bases: homeassistant.components.http.view.HomeAssistantView

View to retrieve calendar list.

async get(request: aiohttp.web_request.Request) → aiohttp.web_response.Response[source]

Retrieve calendar list.

name = 'api:calendars'
url: Optional[str] = '/api/calendars'
async homeassistant.components.calendar.async_setup(hass, config)[source]

Track states and offer events for calendars.

homeassistant.components.calendar.calculate_offset(event, offset)[source]

Calculate event offset.

Return the updated event with the offset_time included.

homeassistant.components.calendar.get_date(date)[source]

Get the dateTime from date or dateTime as a local.

homeassistant.components.calendar.is_offset_reached(event)[source]

Have we reached the offset time specified in the event title.

homeassistant.components.calendar.normalize_event(event)[source]

Normalize a calendar event.

climate

Provides functionality to interact with climate devices.

class homeassistant.components.climate.ClimateDevice[source]

Bases: homeassistant.components.climate.ClimateEntity

Representation of a climate entity (for backwards compatibility).

class homeassistant.components.climate.ClimateEntity[source]

Bases: homeassistant.helpers.entity.Entity

Representation of a climate entity.

async async_set_fan_mode(fan_mode: str) → None[source]

Set new target fan mode.

async async_set_humidity(humidity: int) → None[source]

Set new target humidity.

async async_set_hvac_mode(hvac_mode: str) → None[source]

Set new target hvac mode.

async async_set_preset_mode(preset_mode: str) → None[source]

Set new preset mode.

async async_set_swing_mode(swing_mode: str) → None[source]

Set new target swing operation.

async async_set_temperature(**kwargs) → None[source]

Set new target temperature.

async async_turn_aux_heat_off() → None[source]

Turn auxiliary heater off.

async async_turn_aux_heat_on() → None[source]

Turn auxiliary heater on.

async async_turn_off() → None[source]

Turn the entity off.

async async_turn_on() → None[source]

Turn the entity on.

property capability_attributes

Return the capability attributes.

property current_humidity

Return the current humidity.

property current_temperature

Return the current temperature.

property fan_mode

Return the fan setting.

Requires SUPPORT_FAN_MODE.

property fan_modes

Return the list of available fan modes.

Requires SUPPORT_FAN_MODE.

property hvac_action

Return the current running hvac operation if supported.

Need to be one of CURRENT_HVAC_*.

abstract property hvac_mode

Return hvac operation ie. heat, cool mode.

Need to be one of HVAC_MODE_*.

abstract property hvac_modes

Return the list of available hvac operation modes.

Need to be a subset of HVAC_MODES.

property is_aux_heat

Return true if aux heater.

Requires SUPPORT_AUX_HEAT.

property max_humidity

Return the maximum humidity.

property max_temp

Return the maximum temperature.

property min_humidity

Return the minimum humidity.

property min_temp

Return the minimum temperature.

property precision

Return the precision of the system.

property preset_mode

Return the current preset mode, e.g., home, away, temp.

Requires SUPPORT_PRESET_MODE.

property preset_modes

Return a list of available preset modes.

Requires SUPPORT_PRESET_MODE.

set_fan_mode(fan_mode: str) → None[source]

Set new target fan mode.

set_humidity(humidity: int) → None[source]

Set new target humidity.

set_hvac_mode(hvac_mode: str) → None[source]

Set new target hvac mode.

set_preset_mode(preset_mode: str) → None[source]

Set new preset mode.

set_swing_mode(swing_mode: str) → None[source]

Set new target swing operation.

set_temperature(**kwargs) → None[source]

Set new target temperature.

property state

Return the current state.

property state_attributes

Return the optional state attributes.

property supported_features

Return the list of supported features.

property swing_mode

Return the swing setting.

Requires SUPPORT_SWING_MODE.

property swing_modes

Return the list of available swing modes.

Requires SUPPORT_SWING_MODE.

property target_humidity

Return the humidity we try to reach.

property target_temperature

Return the temperature we try to reach.

property target_temperature_high

Return the highbound target temperature we try to reach.

Requires SUPPORT_TARGET_TEMPERATURE_RANGE.

property target_temperature_low

Return the lowbound target temperature we try to reach.

Requires SUPPORT_TARGET_TEMPERATURE_RANGE.

property target_temperature_step

Return the supported step of target temperature.

property temperature_unit

Return the unit of measurement used by the platform.

turn_aux_heat_off() → None[source]

Turn auxiliary heater off.

turn_aux_heat_on() → None[source]

Turn auxiliary heater on.

async homeassistant.components.climate.async_service_aux_heat(entity: homeassistant.components.climate.ClimateEntity, service: Dict[str, Any]) → None[source]

Handle aux heat service.

async homeassistant.components.climate.async_service_temperature_set(entity: homeassistant.components.climate.ClimateEntity, service: Dict[str, Any]) → None[source]

Handle set temperature service.

async homeassistant.components.climate.async_setup(hass: homeassistant.core.HomeAssistant, config: Dict[str, Any]) → bool[source]

Set up climate entities.

async homeassistant.components.climate.async_setup_entry(hass: homeassistant.core.HomeAssistant, entry)[source]

Set up a config entry.

async homeassistant.components.climate.async_unload_entry(hass: homeassistant.core.HomeAssistant, entry)[source]

Unload a config entry.

conversation

Support for functionality to have conversations with Home Assistant.

class homeassistant.components.conversation.ConversationProcessView[source]

Bases: homeassistant.components.http.view.HomeAssistantView

View to process text.

name = 'api:conversation:process'
async post(request, data)[source]

Send a request for processing.

url: Optional[str] = '/api/conversation/process'
homeassistant.components.conversation.async_set_agent(hass: homeassistant.core.HomeAssistant, agent: homeassistant.components.conversation.agent.AbstractConversationAgent)[source]

Set the agent to handle the conversations.

async homeassistant.components.conversation.async_setup(hass, config)[source]

Register the process service.

homeassistant.components.conversation.websocket_get_agent_info(hass, connection, msg)[source]

Do we need onboarding.

homeassistant.components.conversation.websocket_process(hass, connection, msg)[source]

Process text.

homeassistant.components.conversation.websocket_set_onboarding(hass, connection, msg)[source]

Set onboarding status.

cover

Support for Cover devices.

class homeassistant.components.cover.CoverDevice[source]

Bases: homeassistant.components.cover.CoverEntity

Representation of a cover (for backwards compatibility).

class homeassistant.components.cover.CoverEntity[source]

Bases: homeassistant.helpers.entity.Entity

Representation of a cover.

async async_close_cover(**kwargs)[source]

Close cover.

async async_close_cover_tilt(**kwargs)[source]

Close the cover tilt.

async async_open_cover(**kwargs)[source]

Open the cover.

async async_open_cover_tilt(**kwargs)[source]

Open the cover tilt.

async async_set_cover_position(**kwargs)[source]

Move the cover to a specific position.

async async_set_cover_tilt_position(**kwargs)[source]

Move the cover tilt to a specific position.

async async_stop_cover(**kwargs)[source]

Stop the cover.

async async_stop_cover_tilt(**kwargs)[source]

Stop the cover.

async async_toggle(**kwargs)[source]

Toggle the entity.

async async_toggle_tilt(**kwargs)[source]

Toggle the entity.

close_cover(**kwargs: Any) → None[source]

Close cover.

close_cover_tilt(**kwargs: Any) → None[source]

Close the cover tilt.

property current_cover_position

Return current position of cover.

None is unknown, 0 is closed, 100 is fully open.

property current_cover_tilt_position

Return current position of cover tilt.

None is unknown, 0 is closed, 100 is fully open.

property is_closed

Return if the cover is closed or not.

property is_closing

Return if the cover is closing or not.

property is_opening

Return if the cover is opening or not.

open_cover(**kwargs: Any) → None[source]

Open the cover.

open_cover_tilt(**kwargs: Any) → None[source]

Open the cover tilt.

set_cover_position(**kwargs)[source]

Move the cover to a specific position.

set_cover_tilt_position(**kwargs)[source]

Move the cover tilt to a specific position.

property state

Return the state of the cover.

property state_attributes

Return the state attributes.

stop_cover(**kwargs)[source]

Stop the cover.

stop_cover_tilt(**kwargs)[source]

Stop the cover.

property supported_features

Flag supported features.

toggle(**kwargs: Any) → None[source]

Toggle the entity.

toggle_tilt(**kwargs: Any) → None[source]

Toggle the entity.

async homeassistant.components.cover.async_setup(hass, config)[source]

Track states and offer events for covers.

async homeassistant.components.cover.async_setup_entry(hass, entry)[source]

Set up a config entry.

async homeassistant.components.cover.async_unload_entry(hass, entry)[source]

Unload a config entry.

homeassistant.components.cover.is_closed(hass, entity_id)[source]

Return if the cover is closed based on the statemachine.

device_tracker

Provide functionality to keep track of devices.

async homeassistant.components.device_tracker.async_setup(hass: homeassistant.core.HomeAssistant, config: Dict[str, Any])[source]

Set up the device tracker.

homeassistant.components.device_tracker.is_on(hass: homeassistant.core.HomeAssistant, entity_id: str)[source]

Return the state if any or a specified device is home.

homeassistant.components.device_tracker.see(hass: homeassistant.core.HomeAssistant, mac: str = None, dev_id: str = None, host_name: str = None, location_name: str = None, gps: Tuple[float, float] = None, gps_accuracy=None, battery: int = None, attributes: dict = None)[source]

Call service to notify you see device.

fan

Provides functionality to interact with fans.

class homeassistant.components.fan.FanEntity[source]

Bases: homeassistant.helpers.entity.ToggleEntity

Representation of a fan.

async async_oscillate(oscillating: bool)[source]

Oscillate the fan.

async async_set_direction(direction: str)[source]

Set the direction of the fan.

async async_set_speed(speed: str)[source]

Set the speed of the fan.

async async_turn_on(speed: Optional[str] = None, **kwargs)[source]

Turn on the fan.

property capability_attributes

Return capability attributes.

property current_direction

Return the current direction of the fan.

property is_on

Return true if the entity is on.

oscillate(oscillating: bool) → None[source]

Oscillate the fan.

property oscillating

Return whether or not the fan is currently oscillating.

set_direction(direction: str) → None[source]

Set the direction of the fan.

set_speed(speed: str) → None[source]

Set the speed of the fan.

property speed

Return the current speed.

property speed_list

Get the list of available speeds.

property state_attributes

Return optional state attributes.

property supported_features

Flag supported features.

turn_on(speed: Optional[str] = None, **kwargs) → None[source]

Turn on the fan.

async homeassistant.components.fan.async_setup(hass, config: dict)[source]

Expose fan control via statemachine and services.

async homeassistant.components.fan.async_setup_entry(hass, entry)[source]

Set up a config entry.

async homeassistant.components.fan.async_unload_entry(hass, entry)[source]

Unload a config entry.

homeassistant.components.fan.is_on(hass, entity_id: str) → bool[source]

Return if the fans are on based on the statemachine.

light

Provides functionality to interact with lights.

class homeassistant.components.light.Light[source]

Bases: homeassistant.components.light.LightEntity

Representation of a light (for backwards compatibility).

class homeassistant.components.light.LightEntity[source]

Bases: homeassistant.helpers.entity.ToggleEntity

Representation of a light.

property brightness

Return the brightness of this light between 0..255.

property capability_attributes

Return capability attributes.

property color_temp

Return the CT color value in mireds.

property effect

Return the current effect.

property effect_list

Return the list of supported effects.

property hs_color

Return the hue and saturation color value [float, float].

property max_mireds

Return the warmest color_temp that this light supports.

property min_mireds

Return the coldest color_temp that this light supports.

property state_attributes

Return state attributes.

property supported_features

Flag supported features.

property white_value

Return the white value of this light between 0..255.

class homeassistant.components.light.Profiles[source]

Bases: object

Representation of available color profiles.

classmethod get(name)[source]

Return a named profile.

classmethod get_default(entity_id)[source]

Return the default turn-on profile for the given light.

async classmethod load_profiles(hass)[source]

Load and cache profiles.

async homeassistant.components.light.async_setup(hass, config)[source]

Expose light control via state machine and services.

async homeassistant.components.light.async_setup_entry(hass, entry)[source]

Set up a config entry.

async homeassistant.components.light.async_unload_entry(hass, entry)[source]

Unload a config entry.

homeassistant.components.light.filter_turn_off_params(params)[source]

Filter out params not used in turn off.

homeassistant.components.light.is_on(hass, entity_id)[source]

Return if the lights are on based on the statemachine.

homeassistant.components.light.preprocess_turn_off(params)[source]

Process data for turning light off if brightness is 0.

homeassistant.components.light.preprocess_turn_on_alternatives(params)[source]

Process extra data for turn light on request.

lock

Component to interface with locks that can be controlled remotely.

class homeassistant.components.lock.LockDevice[source]

Bases: homeassistant.components.lock.LockEntity

Representation of a lock (for backwards compatibility).

class homeassistant.components.lock.LockEntity[source]

Bases: homeassistant.helpers.entity.Entity

Representation of a lock.

async async_lock(**kwargs)[source]

Lock the lock.

async async_open(**kwargs)[source]

Open the door latch.

async async_unlock(**kwargs)[source]

Unlock the lock.

property changed_by

Last change triggered by.

property code_format

Regex for code format or None if no code is required.

property is_locked

Return true if the lock is locked.

lock(**kwargs)[source]

Lock the lock.

open(**kwargs)[source]

Open the door latch.

property state

Return the state.

property state_attributes

Return the state attributes.

unlock(**kwargs)[source]

Unlock the lock.

async homeassistant.components.lock.async_setup(hass, config)[source]

Track states and offer events for locks.

async homeassistant.components.lock.async_setup_entry(hass, entry)[source]

Set up a config entry.

async homeassistant.components.lock.async_unload_entry(hass, entry)[source]

Unload a config entry.

media_player

Component to interface with various media players.

class homeassistant.components.media_player.MediaPlayerDevice[source]

Bases: homeassistant.components.media_player.MediaPlayerEntity

ABC for media player devices (for backwards compatibility).

class homeassistant.components.media_player.MediaPlayerEntity[source]

Bases: homeassistant.helpers.entity.Entity

ABC for media player entities.

property access_token

Access token for this media player.

property app_id

ID of the current running app.

property app_name

Name of the current running app.

async async_clear_playlist()[source]

Clear players playlist.

async async_get_media_image()[source]

Fetch media image of current playing image.

async async_media_next_track()[source]

Send next track command.

async async_media_pause()[source]

Send pause command.

async async_media_play()[source]

Send play command.

async async_media_play_pause()[source]

Play or pause the media player.

async async_media_previous_track()[source]

Send previous track command.

async async_media_seek(position)[source]

Send seek command.

async async_media_stop()[source]

Send stop command.

async async_mute_volume(mute)[source]

Mute the volume.

async async_play_media(media_type, media_id, **kwargs)[source]

Play a piece of media.

async async_select_sound_mode(sound_mode)[source]

Select sound mode.

async async_select_source(source)[source]

Select input source.

async async_set_shuffle(shuffle)[source]

Enable/disable shuffle mode.

async async_set_volume_level(volume)[source]

Set volume level, range 0..1.

async async_toggle()[source]

Toggle the power on the media player.

async async_turn_off()[source]

Turn the media player off.

async async_turn_on()[source]

Turn the media player on.

async async_volume_down()[source]

Turn volume down for media player.

This method is a coroutine.

async async_volume_up()[source]

Turn volume up for media player.

This method is a coroutine.

property capability_attributes

Return capability attributes.

clear_playlist()[source]

Clear players playlist.

property entity_picture

Return image of the media playing.

property is_volume_muted

Boolean if volume is currently muted.

property media_album_artist

Album artist of current playing media, music track only.

property media_album_name

Album name of current playing media, music track only.

property media_artist

Artist of current playing media, music track only.

property media_channel

Channel currently playing.

property media_content_id

Content ID of current playing media.

property media_content_type

Content type of current playing media.

property media_duration

Duration of current playing media in seconds.

property media_episode

Episode of current playing media, TV show only.

property media_image_hash

Hash value for media image.

property media_image_local

Return local url to media image.

property media_image_remotely_accessible

If the image url is remotely accessible.

property media_image_url

Image url of current playing media.

media_next_track()[source]

Send next track command.

media_pause()[source]

Send pause command.

media_play()[source]

Send play command.

property media_playlist

Title of Playlist currently playing.

property media_position

Position of current playing media in seconds.

property media_position_updated_at

When was the position of the current playing media valid.

Returns value from homeassistant.util.dt.utcnow().

media_previous_track()[source]

Send previous track command.

property media_season

Season of current playing media, TV show only.

media_seek(position)[source]

Send seek command.

property media_series_title

Title of series of current playing media, TV show only.

media_stop()[source]

Send stop command.

property media_title

Title of current playing media.

property media_track

Track number of current playing media, music track only.

mute_volume(mute)[source]

Mute the volume.

play_media(media_type, media_id, **kwargs)[source]

Play a piece of media.

select_sound_mode(sound_mode)[source]

Select sound mode.

select_source(source)[source]

Select input source.

set_shuffle(shuffle)[source]

Enable/disable shuffle mode.

set_volume_level(volume)[source]

Set volume level, range 0..1.

property shuffle

Boolean if shuffle is enabled.

property sound_mode

Name of the current sound mode.

property sound_mode_list

List of available sound modes.

property source

Name of the current input source.

property source_list

List of available input sources.

property state

State of the player.

property state_attributes

Return the state attributes.

property support_clear_playlist

Boolean if clear playlist command supported.

property support_next_track

Boolean if next track command supported.

property support_pause

Boolean if pause is supported.

property support_play

Boolean if play is supported.

property support_play_media

Boolean if play media command supported.

property support_previous_track

Boolean if previous track command supported.

property support_seek

Boolean if seek is supported.

property support_select_sound_mode

Boolean if select sound mode command supported.

property support_select_source

Boolean if select source command supported.

property support_shuffle_set

Boolean if shuffle is supported.

property support_stop

Boolean if stop is supported.

property support_volume_mute

Boolean if muting volume is supported.

property support_volume_set

Boolean if setting volume is supported.

property supported_features

Flag media player features that are supported.

turn_off()[source]

Turn the media player off.

turn_on()[source]

Turn the media player on.

property volume_level

Volume level of the media player (0..1).

class homeassistant.components.media_player.MediaPlayerImageView(component)[source]

Bases: homeassistant.components.http.view.HomeAssistantView

Media player view to serve an image.

async get(request: aiohttp.web_request.Request, entity_id: str) → aiohttp.web_response.Response[source]

Start a get request.

name = 'api:media_player:image'
requires_auth = False
url: Optional[str] = '/api/media_player_proxy/{entity_id}'
async homeassistant.components.media_player.async_setup(hass, config)[source]

Track states and offer events for media_players.

async homeassistant.components.media_player.async_setup_entry(hass, entry)[source]

Set up a config entry.

async homeassistant.components.media_player.async_unload_entry(hass, entry)[source]

Unload a config entry.

homeassistant.components.media_player.is_on(hass, entity_id=None)[source]

Return true if specified media player entity_id is on.

Check all media player if no entity_id specified.

homeassistant.components.media_player.websocket_handle_thumbnail(hass, connection, msg)[source]

Handle get media player cover command.

Async friendly.

notify

Provides functionality to notify people.

class homeassistant.components.notify.BaseNotificationService[source]

Bases: object

An abstract class for notification services.

async async_send_message(message, **kwargs)[source]

Send a message.

kwargs can contain ATTR_TITLE to specify a title.

hass: Optional[homeassistant.core.HomeAssistant] = None
send_message(message, **kwargs)[source]

Send a message.

kwargs can contain ATTR_TITLE to specify a title.

async homeassistant.components.notify.async_setup(hass, config)[source]

Set up the notify services.

remote

Support to interface with universal remote control devices.

class homeassistant.components.remote.RemoteDevice[source]

Bases: homeassistant.components.remote.RemoteEntity

Representation of a remote (for backwards compatibility).

class homeassistant.components.remote.RemoteEntity[source]

Bases: homeassistant.helpers.entity.ToggleEntity

Representation of a remote.

async async_learn_command(**kwargs: Any) → None[source]

Learn a command from a device.

async async_send_command(command: Iterable[str], **kwargs: Any) → None[source]

Send commands to a device.

learn_command(**kwargs: Any) → None[source]

Learn a command from a device.

send_command(command: Iterable[str], **kwargs: Any) → None[source]

Send commands to a device.

property supported_features

Flag supported features.

async homeassistant.components.remote.async_setup(hass: homeassistant.core.HomeAssistant, config: Dict[str, Any]) → bool[source]

Track states and offer events for remotes.

async homeassistant.components.remote.async_setup_entry(hass: homeassistant.core.HomeAssistant, entry: homeassistant.config_entries.ConfigEntry) → bool[source]

Set up a config entry.

async homeassistant.components.remote.async_unload_entry(hass: homeassistant.core.HomeAssistant, entry: homeassistant.config_entries.ConfigEntry) → bool[source]

Unload a config entry.

homeassistant.components.remote.is_on(hass: homeassistant.core.HomeAssistant, entity_id: str) → bool[source]

Return if the remote is on based on the statemachine.

switch

Component to interface with switches that can be controlled remotely.

class homeassistant.components.switch.SwitchDevice[source]

Bases: homeassistant.components.switch.SwitchEntity

Representation of a switch (for backwards compatibility).

class homeassistant.components.switch.SwitchEntity[source]

Bases: homeassistant.helpers.entity.ToggleEntity

Representation of a switch.

property current_power_w

Return the current power usage in W.

property device_class

Return the class of this device, from component DEVICE_CLASSES.

property is_standby

Return true if device is in standby.

property state_attributes

Return the optional state attributes.

property today_energy_kwh

Return the today total energy usage in kWh.

async homeassistant.components.switch.async_setup(hass, config)[source]

Track states and offer events for switches.

async homeassistant.components.switch.async_setup_entry(hass, entry)[source]

Set up a config entry.

async homeassistant.components.switch.async_unload_entry(hass, entry)[source]

Unload a config entry.

homeassistant.components.switch.is_on(hass, entity_id)[source]

Return if the switch is on based on the statemachine.

Async friendly.

sensor

Component to interface with various sensors that can be monitored.

async homeassistant.components.sensor.async_setup(hass, config)[source]

Track states and offer events for sensors.

async homeassistant.components.sensor.async_setup_entry(hass, entry)[source]

Set up a config entry.

async homeassistant.components.sensor.async_unload_entry(hass, entry)[source]

Unload a config entry.

vacuum

Support for vacuum cleaner robots (botvacs).

class homeassistant.components.vacuum.StateVacuumDevice[source]

Bases: homeassistant.components.vacuum.StateVacuumEntity

Representation of a vacuum (for backwards compatibility).

class homeassistant.components.vacuum.StateVacuumEntity[source]

Bases: homeassistant.components.vacuum._BaseVacuum

Representation of a vacuum cleaner robot that supports states.

async async_pause()[source]

Pause the cleaning task.

This method must be run in the event loop.

async async_start()[source]

Start or resume the cleaning task.

This method must be run in the event loop.

async async_toggle(**kwargs)[source]

Not supported.

async async_turn_off(**kwargs)[source]

Not supported.

async async_turn_on(**kwargs)[source]

Not supported.

property battery_icon

Return the battery icon for the vacuum cleaner.

pause()[source]

Pause the cleaning task.

start()[source]

Start or resume the cleaning task.

property state

Return the state of the vacuum cleaner.

class homeassistant.components.vacuum.VacuumDevice[source]

Bases: homeassistant.components.vacuum.VacuumEntity

Representation of a vacuum (for backwards compatibility).

class homeassistant.components.vacuum.VacuumEntity[source]

Bases: homeassistant.components.vacuum._BaseVacuum, homeassistant.helpers.entity.ToggleEntity

Representation of a vacuum cleaner robot.

async async_pause()[source]

Not supported.

async async_start()[source]

Not supported.

async async_start_pause(**kwargs)[source]

Start, pause or resume the cleaning task.

This method must be run in the event loop.

async async_turn_off(**kwargs)[source]

Turn the vacuum off stopping the cleaning and returning home.

This method must be run in the event loop.

async async_turn_on(**kwargs)[source]

Turn the vacuum on and start cleaning.

This method must be run in the event loop.

property battery_icon

Return the battery icon for the vacuum cleaner.

start_pause(**kwargs)[source]

Start, pause or resume the cleaning task.

property state_attributes

Return the state attributes of the vacuum cleaner.

property status

Return the status of the vacuum cleaner.

turn_off(**kwargs)[source]

Turn the vacuum off stopping the cleaning and returning home.

turn_on(**kwargs)[source]

Turn the vacuum on and start cleaning.

async homeassistant.components.vacuum.async_setup(hass, config)[source]

Set up the vacuum component.

async homeassistant.components.vacuum.async_setup_entry(hass, entry)[source]

Set up a config entry.

async homeassistant.components.vacuum.async_unload_entry(hass, entry)[source]

Unload a config entry.

homeassistant.components.vacuum.is_on(hass, entity_id)[source]

Return if the vacuum is on based on the statemachine.

water_heater

Support for water heater devices.

class homeassistant.components.water_heater.WaterHeaterDevice[source]

Bases: homeassistant.components.water_heater.WaterHeaterEntity

Representation of a water heater (for backwards compatibility).

class homeassistant.components.water_heater.WaterHeaterEntity[source]

Bases: homeassistant.helpers.entity.Entity

Representation of a water_heater device.

async async_set_operation_mode(operation_mode)[source]

Set new target operation mode.

async async_set_temperature(**kwargs)[source]

Set new target temperature.

async async_turn_away_mode_off()[source]

Turn away mode off.

async async_turn_away_mode_on()[source]

Turn away mode on.

property capability_attributes

Return capability attributes.

property current_operation

Return current operation ie. eco, electric, performance, …

property current_temperature

Return the current temperature.

property is_away_mode_on

Return true if away mode is on.

property max_temp

Return the maximum temperature.

property min_temp

Return the minimum temperature.

property operation_list

Return the list of available operation modes.

property precision

Return the precision of the system.

set_operation_mode(operation_mode)[source]

Set new target operation mode.

set_temperature(**kwargs)[source]

Set new target temperature.

property state

Return the current state.

property state_attributes

Return the optional state attributes.

property supported_features

Return the list of supported features.

property target_temperature

Return the temperature we try to reach.

property target_temperature_high

Return the highbound target temperature we try to reach.

property target_temperature_low

Return the lowbound target temperature we try to reach.

property temperature_unit

Return the unit of measurement used by the platform.

turn_away_mode_off()[source]

Turn away mode off.

turn_away_mode_on()[source]

Turn away mode on.

async homeassistant.components.water_heater.async_service_away_mode(entity, service)[source]

Handle away mode service.

async homeassistant.components.water_heater.async_service_temperature_set(entity, service)[source]

Handle set temperature service.

async homeassistant.components.water_heater.async_setup(hass, config)[source]

Set up water_heater devices.

async homeassistant.components.water_heater.async_setup_entry(hass, entry)[source]

Set up a config entry.

async homeassistant.components.water_heater.async_unload_entry(hass, entry)[source]

Unload a config entry.

weather

Weather component that handles meteorological data for your location.

class homeassistant.components.weather.WeatherEntity[source]

Bases: homeassistant.helpers.entity.Entity

ABC for weather data.

property attribution

Return the attribution.

property condition

Return the current condition.

property forecast

Return the forecast.

property humidity

Return the humidity.

property ozone

Return the ozone level.

property precision

Return the precision of the temperature value.

property pressure

Return the pressure.

property state

Return the current state.

property state_attributes

Return the state attributes.

property temperature

Return the platform temperature.

property temperature_unit

Return the unit of measurement.

property visibility

Return the visibility.

property wind_bearing

Return the wind bearing.

property wind_speed

Return the wind speed.

async homeassistant.components.weather.async_setup(hass, config)[source]

Set up the weather component.

async homeassistant.components.weather.async_setup_entry(hass, entry)[source]

Set up a config entry.

async homeassistant.components.weather.async_unload_entry(hass, entry)[source]

Unload a config entry.

webhook

Webhooks for Home Assistant.

class homeassistant.components.webhook.WebhookView[source]

Bases: homeassistant.components.http.view.HomeAssistantView

Handle incoming webhook requests.

cors_allowed = True
async head(request: aiohttp.web_request.Request, webhook_id)[source]

Handle webhook call.

name = 'api:webhook'
async post(request: aiohttp.web_request.Request, webhook_id)[source]

Handle webhook call.

async put(request: aiohttp.web_request.Request, webhook_id)[source]

Handle webhook call.

requires_auth = False
url: Optional[str] = '/api/webhook/{webhook_id}'
homeassistant.components.webhook.async_generate_id()[source]

Generate a webhook_id.

homeassistant.components.webhook.async_generate_path(webhook_id)[source]

Generate the path component for a webhook_id.

homeassistant.components.webhook.async_generate_url(hass, webhook_id)[source]

Generate the full URL for a webhook_id.

async homeassistant.components.webhook.async_handle_webhook(hass, webhook_id, request)[source]

Handle a webhook.

homeassistant.components.webhook.async_register(hass, domain, name, webhook_id, handler)[source]

Register a webhook.

async homeassistant.components.webhook.async_setup(hass, config)[source]

Initialize the webhook component.

homeassistant.components.webhook.async_unregister(hass, webhook_id)[source]

Remove a webhook.

homeassistant.components.webhook.websocket_list(hass, connection, msg)[source]

Return a list of webhooks.