Skip to content

HomeApi

Inherits: Node

Description

Manages the connection to the home automation system and provides a unified interface to the different home automation systems.

Properties

NameTypeDefault
apiNode
groupsVariant

Methods

ReturnsName
void_on_connect ( )
void_on_disconnect ( )
void_ready ( )
Variantget_device ( id: String )
Variantget_devices ( )
Variantget_history ( entity_id: Variant, start: Variant, end: Variant )
Variantget_state ( entity: String )
VoiceHandlerget_voice_assistant ( )
Varianthas_connected ( )
boolhas_integration ( )
Variantset_state ( entity: String, state: Variant, attributes: Dictionary )
voidstart_adapter ( type: String, url: String, token: String )
voidupdate_room ( room: String )
Variantwatch_state ( entity: String, callback: Callable )

Signals

on_connect ( )

Emitted when the connection to the home automation system is established

on_disconnect ( )

Emitted when the connection to the home automation system is lost

Constants

Hass = <Object>

No description provided yet.

EntityGroups = <Object>

No description provided yet.

HassWebSocket = <Object>

No description provided yet.

VoiceAssistant = <Object>

No description provided yet.

apis = {"hass": <Object>, "hass_ws": <Object>}

No description provided yet.

methods = `[

"get_devices", "get_device", "get_state", "set_state", "watch_state" ]`

No description provided yet.

Property Descriptions

api: Node

The current home automation system adapter

groups: Variant

No description provided yet.

Method Descriptions

_on_connect ( ) -> void

No description provided yet.

_on_disconnect ( ) -> void

No description provided yet.

_ready ( ) -> void

No description provided yet.

get_device (id: String ) -> Variant

Get a single device by id

get_devices ( ) -> Variant

Get a list of all devices

get_history (entity_id: Variant , start: Variant , end: Variant ) -> Variant

No description provided yet.

get_state (entity: String ) -> Variant

Returns the current state of an entity

get_voice_assistant ( ) -> VoiceHandler

Returns the VoiceHandler if the adapter has a voice assistant

has_connected ( ) -> Variant

Returns true if the adapter is connected to the home automation system

has_integration ( ) -> bool

Returns true if the adapter has an integration in the home automation system allowing to send the room position of the headset.

set_state (entity: String , state: Variant , attributes: Dictionary ) -> Variant

Updates the state of the entity and returns the resulting state

start_adapter (type: String , url: String , token: String ) -> void

Starts the adapter for the given type and url

update_room (room: String ) -> void

Updates the room position of the headset in the home automation system

watch_state (entity: String , callback: Callable ) -> Variant

Watches the state and each time it changes, calls the callback with the changed state, returns a function to stop watching the state