Home Assistant Unofficial Reference 2024.12.1
homeassistant.components.zha.websocket_api Namespace Reference

Classes

class  ClusterBinding
 

Functions

ClusterBinding _cv_cluster_binding (dict[str, Any] value)
 
GroupMemberReference _cv_group_member (dict[str, Any] value)
 
zigpy.backups.NetworkBackup _cv_zigpy_network_backup (dict[str, Any] value)
 
str|None _get_entity_name (Gateway zha_gateway, EntityReference entity_ref)
 
str|None _get_entity_original_name (Gateway zha_gateway, EntityReference entity_ref)
 
list[_T]|list[Any]|None _T (_T|None value)
 
None async_binding_operation (Gateway zha_gateway, EUI64 source_ieee, EUI64 target_ieee, zdo_types.ZDOCmd operation)
 
None async_load_api (HomeAssistant hass)
 
None async_unload_api (HomeAssistant hass)
 
None websocket_add_group (HomeAssistant hass, ActiveConnection connection, dict[str, Any] msg)
 
None websocket_add_group_members (HomeAssistant hass, ActiveConnection connection, dict[str, Any] msg)
 
None websocket_bind_devices (HomeAssistant hass, ActiveConnection connection, dict[str, Any] msg)
 
None websocket_bind_group (HomeAssistant hass, ActiveConnection connection, dict[str, Any] msg)
 
None websocket_change_channel (HomeAssistant hass, ActiveConnection connection, dict[str, Any] msg)
 
None websocket_create_network_backup (HomeAssistant hass, ActiveConnection connection, dict[str, Any] msg)
 
None websocket_device_cluster_attributes (HomeAssistant hass, ActiveConnection connection, dict[str, Any] msg)
 
None websocket_device_cluster_commands (HomeAssistant hass, ActiveConnection connection, dict[str, Any] msg)
 
None websocket_device_clusters (HomeAssistant hass, ActiveConnection connection, dict[str, Any] msg)
 
None websocket_get_bindable_devices (HomeAssistant hass, ActiveConnection connection, dict[str, Any] msg)
 
None websocket_get_configuration (HomeAssistant hass, ActiveConnection connection, dict[str, Any] msg)
 
None websocket_get_device (HomeAssistant hass, ActiveConnection connection, dict[str, Any] msg)
 
None websocket_get_devices (HomeAssistant hass, ActiveConnection connection, dict[str, Any] msg)
 
None websocket_get_group (HomeAssistant hass, ActiveConnection connection, dict[str, Any] msg)
 
None websocket_get_groupable_devices (HomeAssistant hass, ActiveConnection connection, dict[str, Any] msg)
 
None websocket_get_groups (HomeAssistant hass, ActiveConnection connection, dict[str, Any] msg)
 
None websocket_get_network_settings (HomeAssistant hass, ActiveConnection connection, dict[str, Any] msg)
 
None websocket_list_network_backups (HomeAssistant hass, ActiveConnection connection, dict[str, Any] msg)
 
None websocket_permit_devices (HomeAssistant hass, ActiveConnection connection, dict[str, Any] msg)
 
None websocket_read_zigbee_cluster_attributes (HomeAssistant hass, ActiveConnection connection, dict[str, Any] msg)
 
None websocket_reconfigure_node (HomeAssistant hass, ActiveConnection connection, dict[str, Any] msg)
 
None websocket_remove_group_members (HomeAssistant hass, ActiveConnection connection, dict[str, Any] msg)
 
None websocket_remove_groups (HomeAssistant hass, ActiveConnection connection, dict[str, Any] msg)
 
None websocket_restore_network_backup (HomeAssistant hass, ActiveConnection connection, dict[str, Any] msg)
 
None websocket_unbind_devices (HomeAssistant hass, ActiveConnection connection, dict[str, Any] msg)
 
None websocket_unbind_group (HomeAssistant hass, ActiveConnection connection, dict[str, Any] msg)
 
None websocket_update_topology (HomeAssistant hass, ActiveConnection connection, dict[str, Any] msg)
 
None websocket_update_zha_configuration (HomeAssistant hass, ActiveConnection connection, dict[str, Any] msg)
 

Variables

 _LOGGER = logging.getLogger(__name__)
 
string ATTR_DURATION = "duration"
 
string ATTR_GROUP = "group"
 
string ATTR_IEEE_ADDRESS = "ieee_address"
 
string ATTR_INSTALL_CODE = "install_code"
 
string ATTR_NEW_CHANNEL = "new_channel"
 
string ATTR_QR_CODE = "qr_code"
 
string ATTR_SOURCE_IEEE = "source_ieee"
 
string ATTR_TARGET_IEEE = "target_ieee"
 
string BINDINGS = "bindings"
 
string CLIENT = "client"
 
 CLUSTER_BINDING_SCHEMA
 
string DEVICE_INFO = "device_info"
 
 GROUP_MEMBER_SCHEMA
 
string ID = "id"
 
 IEEE_SCHEMA = vol.All(cv.string, EUI64.convert)
 
string IEEE_SERVICE = "ieee_based_service"
 
string RESPONSE = "response"
 
string SERVICE_DIRECT_ZIGBEE_BIND = "issue_direct_zigbee_bind"
 
string SERVICE_DIRECT_ZIGBEE_UNBIND = "issue_direct_zigbee_unbind"
 
string SERVICE_ISSUE_ZIGBEE_CLUSTER_COMMAND = "issue_zigbee_cluster_command"
 
string SERVICE_ISSUE_ZIGBEE_GROUP_COMMAND = "issue_zigbee_group_command"
 
string SERVICE_PERMIT = "permit"
 
string SERVICE_REMOVE = "remove"
 
string SERVICE_SET_ZIGBEE_CLUSTER_ATTRIBUTE = "set_zigbee_cluster_attribute"
 
string SERVICE_WARNING_DEVICE_SQUAWK = "warning_device_squawk"
 
string SERVICE_WARNING_DEVICE_WARN = "warning_device_warn"
 
string SERVICE_ZIGBEE_BIND = "service_zigbee_bind"
 
string TYPE = "type"
 
dictionary ZHA_CONFIG_SCHEMAS
 

Detailed Description

Web socket API for Zigbee Home Automation devices.

Function Documentation

◆ _cv_cluster_binding()

ClusterBinding homeassistant.components.zha.websocket_api._cv_cluster_binding ( dict[str, Any]  value)
private
Transform a cluster binding.

Definition at line 270 of file websocket_api.py.

◆ _cv_group_member()

GroupMemberReference homeassistant.components.zha.websocket_api._cv_group_member ( dict[str, Any]  value)
private
Transform a group member.

Definition at line 262 of file websocket_api.py.

◆ _cv_zigpy_network_backup()

zigpy.backups.NetworkBackup homeassistant.components.zha.websocket_api._cv_zigpy_network_backup ( dict[str, Any]  value)
private
Transform a zigpy network backup.

Definition at line 280 of file websocket_api.py.

◆ _get_entity_name()

str | None homeassistant.components.zha.websocket_api._get_entity_name ( Gateway  zha_gateway,
EntityReference  entity_ref 
)
private

Definition at line 380 of file websocket_api.py.

◆ _get_entity_original_name()

str | None homeassistant.components.zha.websocket_api._get_entity_original_name ( Gateway  zha_gateway,
EntityReference   entity_ref 
)
private

Definition at line 387 of file websocket_api.py.

◆ _T()

list[_T] | list[Any] | None homeassistant.components.zha.websocket_api._T ( _T | None  value)
private
Wrap value in list if it is provided and not one.

Definition at line 133 of file websocket_api.py.

◆ async_binding_operation()

None homeassistant.components.zha.websocket_api.async_binding_operation ( Gateway  zha_gateway,
EUI64  source_ieee,
EUI64  target_ieee,
zdo_types.ZDOCmd  operation 
)
Create or remove a direct zigbee binding between 2 devices.

Definition at line 1025 of file websocket_api.py.

◆ async_load_api()

None homeassistant.components.zha.websocket_api.async_load_api ( HomeAssistant  hass)
Set up the web socket API.

Definition at line 1270 of file websocket_api.py.

◆ async_unload_api()

None homeassistant.components.zha.websocket_api.async_unload_api ( HomeAssistant  hass)
Unload the ZHA API.

Definition at line 1593 of file websocket_api.py.

◆ websocket_add_group()

None homeassistant.components.zha.websocket_api.websocket_add_group ( HomeAssistant  hass,
ActiveConnection  connection,
dict[str, Any]   msg 
)
Add a new ZHA group.

Definition at line 513 of file websocket_api.py.

◆ websocket_add_group_members()

None homeassistant.components.zha.websocket_api.websocket_add_group_members ( HomeAssistant  hass,
ActiveConnection  connection,
dict[str, Any]   msg 
)
Add members to a ZHA group.

Definition at line 566 of file websocket_api.py.

◆ websocket_bind_devices()

None homeassistant.components.zha.websocket_api.websocket_bind_devices ( HomeAssistant  hass,
ActiveConnection  connection,
dict[str, Any]   msg 
)
Directly bind devices.

Definition at line 928 of file websocket_api.py.

◆ websocket_bind_group()

None homeassistant.components.zha.websocket_api.websocket_bind_group ( HomeAssistant  hass,
ActiveConnection  connection,
dict[str, Any]   msg 
)
Directly bind a device to a group.

Definition at line 987 of file websocket_api.py.

◆ websocket_change_channel()

None homeassistant.components.zha.websocket_api.websocket_change_channel ( HomeAssistant  hass,
ActiveConnection  connection,
dict[str, Any]   msg 
)
Migrate the Zigbee network to a new channel.

Definition at line 1260 of file websocket_api.py.

◆ websocket_create_network_backup()

None homeassistant.components.zha.websocket_api.websocket_create_network_backup ( HomeAssistant  hass,
ActiveConnection  connection,
dict[str, Any]   msg 
)
Create a ZHA network backup.

Definition at line 1203 of file websocket_api.py.

◆ websocket_device_cluster_attributes()

None homeassistant.components.zha.websocket_api.websocket_device_cluster_attributes ( HomeAssistant  hass,
ActiveConnection  connection,
dict[str, Any]   msg 
)
Return a list of cluster attributes.

Definition at line 724 of file websocket_api.py.

◆ websocket_device_cluster_commands()

None homeassistant.components.zha.websocket_api.websocket_device_cluster_commands ( HomeAssistant  hass,
ActiveConnection  connection,
dict[str, Any]   msg 
)
Return a list of cluster commands.

Definition at line 769 of file websocket_api.py.

◆ websocket_device_clusters()

None homeassistant.components.zha.websocket_api.websocket_device_clusters ( HomeAssistant  hass,
ActiveConnection  connection,
dict[str, Any]   msg 
)
Return a list of device clusters.

Definition at line 680 of file websocket_api.py.

◆ websocket_get_bindable_devices()

None homeassistant.components.zha.websocket_api.websocket_get_bindable_devices ( HomeAssistant  hass,
ActiveConnection  connection,
dict[str, Any]   msg 
)
Directly bind devices.

Definition at line 893 of file websocket_api.py.

◆ websocket_get_configuration()

None homeassistant.components.zha.websocket_api.websocket_get_configuration ( HomeAssistant  hass,
ActiveConnection  connection,
dict[str, Any]   msg 
)
Get ZHA configuration.

Definition at line 1076 of file websocket_api.py.

◆ websocket_get_device()

None homeassistant.components.zha.websocket_api.websocket_get_device ( HomeAssistant  hass,
ActiveConnection  connection,
dict[str, Any]   msg 
)
Get ZHA devices.

Definition at line 457 of file websocket_api.py.

◆ websocket_get_devices()

None homeassistant.components.zha.websocket_api.websocket_get_devices ( HomeAssistant  hass,
ActiveConnection  connection,
dict[str, Any]   msg 
)
Get ZHA devices.

Definition at line 368 of file websocket_api.py.

◆ websocket_get_group()

None homeassistant.components.zha.websocket_api.websocket_get_group ( HomeAssistant  hass,
ActiveConnection  connection,
dict[str, Any]   msg 
)
Get ZHA group.

Definition at line 484 of file websocket_api.py.

◆ websocket_get_groupable_devices()

None homeassistant.components.zha.websocket_api.websocket_get_groupable_devices ( HomeAssistant  hass,
ActiveConnection  connection,
dict[str, Any]   msg 
)
Get ZHA devices that can be grouped.

Definition at line 398 of file websocket_api.py.

◆ websocket_get_groups()

None homeassistant.components.zha.websocket_api.websocket_get_groups ( HomeAssistant  hass,
ActiveConnection  connection,
dict[str, Any]   msg 
)
Get ZHA groups.

Definition at line 440 of file websocket_api.py.

◆ websocket_get_network_settings()

None homeassistant.components.zha.websocket_api.websocket_get_network_settings ( HomeAssistant  hass,
ActiveConnection  connection,
dict[str, Any]   msg 
)
Get ZHA network settings.

Definition at line 1167 of file websocket_api.py.

◆ websocket_list_network_backups()

None homeassistant.components.zha.websocket_api.websocket_list_network_backups ( HomeAssistant  hass,
ActiveConnection  connection,
dict[str, Any]   msg 
)
Get ZHA network settings.

Definition at line 1187 of file websocket_api.py.

◆ websocket_permit_devices()

None homeassistant.components.zha.websocket_api.websocket_permit_devices ( HomeAssistant  hass,
ActiveConnection  connection,
dict[str, Any]   msg 
)
Permit ZHA zigbee devices.

Definition at line 319 of file websocket_api.py.

◆ websocket_read_zigbee_cluster_attributes()

None homeassistant.components.zha.websocket_api.websocket_read_zigbee_cluster_attributes ( HomeAssistant  hass,
ActiveConnection  connection,
dict[str, Any]   msg 
)
Read zigbee attribute for cluster on ZHA entity.

Definition at line 841 of file websocket_api.py.

◆ websocket_reconfigure_node()

None homeassistant.components.zha.websocket_api.websocket_reconfigure_node ( HomeAssistant  hass,
ActiveConnection  connection,
dict[str, Any]   msg 
)
Reconfigure a ZHA nodes entities by its ieee address.

Definition at line 629 of file websocket_api.py.

◆ websocket_remove_group_members()

None homeassistant.components.zha.websocket_api.websocket_remove_group_members ( HomeAssistant  hass,
ActiveConnection  connection,
dict[str, Any]   msg 
)
Remove members from a ZHA group.

Definition at line 598 of file websocket_api.py.

◆ websocket_remove_groups()

None homeassistant.components.zha.websocket_api.websocket_remove_groups ( HomeAssistant  hass,
ActiveConnection  connection,
dict[str, Any]   msg 
)
Remove the specified ZHA groups.

Definition at line 538 of file websocket_api.py.

◆ websocket_restore_network_backup()

None homeassistant.components.zha.websocket_api.websocket_restore_network_backup ( HomeAssistant  hass,
ActiveConnection  connection,
dict[str, Any]   msg 
)
Restore a ZHA network backup.

Definition at line 1230 of file websocket_api.py.

◆ websocket_unbind_devices()

None homeassistant.components.zha.websocket_api.websocket_unbind_devices ( HomeAssistant  hass,
ActiveConnection  connection,
dict[str, Any]   msg 
)
Remove a direct binding between devices.

Definition at line 957 of file websocket_api.py.

◆ websocket_unbind_group()

None homeassistant.components.zha.websocket_api.websocket_unbind_group ( HomeAssistant  hass,
ActiveConnection  connection,
dict[str, Any]   msg 
)
Unbind a device from a group.

Definition at line 1011 of file websocket_api.py.

◆ websocket_update_topology()

None homeassistant.components.zha.websocket_api.websocket_update_topology ( HomeAssistant  hass,
ActiveConnection  connection,
dict[str, Any]   msg 
)
Update the ZHA network topology.

Definition at line 664 of file websocket_api.py.

◆ websocket_update_zha_configuration()

None homeassistant.components.zha.websocket_api.websocket_update_zha_configuration ( HomeAssistant  hass,
ActiveConnection  connection,
dict[str, Any]   msg 
)
Update the ZHA configuration.

Definition at line 1123 of file websocket_api.py.

Variable Documentation

◆ _LOGGER

homeassistant.components.zha.websocket_api._LOGGER = logging.getLogger(__name__)
private

Definition at line 99 of file websocket_api.py.

◆ ATTR_DURATION

string homeassistant.components.zha.websocket_api.ATTR_DURATION = "duration"

Definition at line 107 of file websocket_api.py.

◆ ATTR_GROUP

string homeassistant.components.zha.websocket_api.ATTR_GROUP = "group"

Definition at line 108 of file websocket_api.py.

◆ ATTR_IEEE_ADDRESS

string homeassistant.components.zha.websocket_api.ATTR_IEEE_ADDRESS = "ieee_address"

Definition at line 109 of file websocket_api.py.

◆ ATTR_INSTALL_CODE

string homeassistant.components.zha.websocket_api.ATTR_INSTALL_CODE = "install_code"

Definition at line 110 of file websocket_api.py.

◆ ATTR_NEW_CHANNEL

string homeassistant.components.zha.websocket_api.ATTR_NEW_CHANNEL = "new_channel"

Definition at line 111 of file websocket_api.py.

◆ ATTR_QR_CODE

string homeassistant.components.zha.websocket_api.ATTR_QR_CODE = "qr_code"

Definition at line 114 of file websocket_api.py.

◆ ATTR_SOURCE_IEEE

string homeassistant.components.zha.websocket_api.ATTR_SOURCE_IEEE = "source_ieee"

Definition at line 112 of file websocket_api.py.

◆ ATTR_TARGET_IEEE

string homeassistant.components.zha.websocket_api.ATTR_TARGET_IEEE = "target_ieee"

Definition at line 113 of file websocket_api.py.

◆ BINDINGS

string homeassistant.components.zha.websocket_api.BINDINGS = "bindings"

Definition at line 116 of file websocket_api.py.

◆ CLIENT

string homeassistant.components.zha.websocket_api.CLIENT = "client"

Definition at line 102 of file websocket_api.py.

◆ CLUSTER_BINDING_SCHEMA

homeassistant.components.zha.websocket_api.CLUSTER_BINDING_SCHEMA
Initial value:
1 = vol.All(
2  vol.Schema(
3  {
4  vol.Required(ATTR_NAME): cv.string,
5  vol.Required(ATTR_TYPE): cv.string,
6  vol.Required(ATTR_ID): vol.Coerce(int),
7  vol.Required(ATTR_ENDPOINT_ID): vol.Coerce(int),
8  }
9  ),
10  _cv_cluster_binding,
11 )

Definition at line 300 of file websocket_api.py.

◆ DEVICE_INFO

string homeassistant.components.zha.websocket_api.DEVICE_INFO = "device_info"

Definition at line 105 of file websocket_api.py.

◆ GROUP_MEMBER_SCHEMA

homeassistant.components.zha.websocket_api.GROUP_MEMBER_SCHEMA
Initial value:
1 = vol.All(
2  vol.Schema(
3  {
4  vol.Required(ATTR_IEEE): IEEE_SCHEMA,
5  vol.Required(ATTR_ENDPOINT_ID): vol.Coerce(int),
6  }
7  ),
8  _cv_group_member,
9 )

Definition at line 289 of file websocket_api.py.

◆ ID

string homeassistant.components.zha.websocket_api.ID = "id"

Definition at line 103 of file websocket_api.py.

◆ IEEE_SCHEMA

homeassistant.components.zha.websocket_api.IEEE_SCHEMA = vol.All(cv.string, EUI64.convert)

Definition at line 130 of file websocket_api.py.

◆ IEEE_SERVICE

string homeassistant.components.zha.websocket_api.IEEE_SERVICE = "ieee_based_service"

Definition at line 128 of file websocket_api.py.

◆ RESPONSE

string homeassistant.components.zha.websocket_api.RESPONSE = "response"

Definition at line 104 of file websocket_api.py.

◆ SERVICE_DIRECT_ZIGBEE_BIND

string homeassistant.components.zha.websocket_api.SERVICE_DIRECT_ZIGBEE_BIND = "issue_direct_zigbee_bind"

Definition at line 123 of file websocket_api.py.

◆ SERVICE_DIRECT_ZIGBEE_UNBIND

string homeassistant.components.zha.websocket_api.SERVICE_DIRECT_ZIGBEE_UNBIND = "issue_direct_zigbee_unbind"

Definition at line 124 of file websocket_api.py.

◆ SERVICE_ISSUE_ZIGBEE_CLUSTER_COMMAND

string homeassistant.components.zha.websocket_api.SERVICE_ISSUE_ZIGBEE_CLUSTER_COMMAND = "issue_zigbee_cluster_command"

Definition at line 121 of file websocket_api.py.

◆ SERVICE_ISSUE_ZIGBEE_GROUP_COMMAND

string homeassistant.components.zha.websocket_api.SERVICE_ISSUE_ZIGBEE_GROUP_COMMAND = "issue_zigbee_group_command"

Definition at line 122 of file websocket_api.py.

◆ SERVICE_PERMIT

string homeassistant.components.zha.websocket_api.SERVICE_PERMIT = "permit"

Definition at line 118 of file websocket_api.py.

◆ SERVICE_REMOVE

string homeassistant.components.zha.websocket_api.SERVICE_REMOVE = "remove"

Definition at line 119 of file websocket_api.py.

◆ SERVICE_SET_ZIGBEE_CLUSTER_ATTRIBUTE

string homeassistant.components.zha.websocket_api.SERVICE_SET_ZIGBEE_CLUSTER_ATTRIBUTE = "set_zigbee_cluster_attribute"

Definition at line 120 of file websocket_api.py.

◆ SERVICE_WARNING_DEVICE_SQUAWK

string homeassistant.components.zha.websocket_api.SERVICE_WARNING_DEVICE_SQUAWK = "warning_device_squawk"

Definition at line 125 of file websocket_api.py.

◆ SERVICE_WARNING_DEVICE_WARN

string homeassistant.components.zha.websocket_api.SERVICE_WARNING_DEVICE_WARN = "warning_device_warn"

Definition at line 126 of file websocket_api.py.

◆ SERVICE_ZIGBEE_BIND

string homeassistant.components.zha.websocket_api.SERVICE_ZIGBEE_BIND = "service_zigbee_bind"

Definition at line 127 of file websocket_api.py.

◆ TYPE

string homeassistant.components.zha.websocket_api.TYPE = "type"

Definition at line 101 of file websocket_api.py.

◆ ZHA_CONFIG_SCHEMAS

dictionary homeassistant.components.zha.websocket_api.ZHA_CONFIG_SCHEMAS
Initial value:
1 = {
2  ZHA_OPTIONS: CONF_ZHA_OPTIONS_SCHEMA,
3  ZHA_ALARM_OPTIONS: CONF_ZHA_ALARM_SCHEMA,
4 }

Definition at line 247 of file websocket_api.py.