Skip to content

API

KebaKeEnergyAPI(host, username=None, password=None, *, ssl=False, skip_ssl_verification=False, session=None)

An asynchronous client to interact with KEBA KeEnergy API from the Web HMI.

PARAMETER DESCRIPTION
host

The hostname or IP adress e.g. ap4400.local

TYPE: str

username

Required for basic auth

TYPE: str | None DEFAULT: None

password

Required for basic auth

TYPE: str | None DEFAULT: None

ssl

Enable https schema for API URLs

TYPE: bool DEFAULT: False

skip_ssl_verification

Disable SSL verification (required for self-signed certificates)

TYPE: bool DEFAULT: False

session

Add an aiohttp client session

TYPE: ClientSession | None DEFAULT: None

Examples:

>>> client = KebaKeEnergyAPI(
>>>     host="ap4400.local",
>>>     username="test",
>>>     password="test",
>>>     ssl=True,
>>>     skip_ssl_verification=True
>>> )

device_url property

Get the device URL.

RETURNS DESCRIPTION
str

e.g. https://ap4400.local

read_data(request, position=None, *, human_readable=True, extra_attributes=True) async

Read multiple data from API with one request.

PARAMETER DESCRIPTION
request

Section or a list of sections e.g. [BufferTank.NAME, …]

TYPE: Section | list[Section]

position

The number of the installed devices e.g. number of buffer tanks

TYPE: Position | int | list[int] | None DEFAULT: None

human_readable

Return a human-readable string

TYPE: bool DEFAULT: True

extra_attributes

Append the extra attributes to the response

TYPE: bool DEFAULT: True

Examples:

>>> await client.read_data(
>>>     request=[
>>>         HeatCircuit.TARGET_TEMPERATURE,
>>>         HeatCircuit.TARGET_TEMPERATURE_DAY
>>>     ]
>>> )
RETURNS DESCRIPTION
dictionary

A dictionary with section as key and reponse data as value

write_data(request) async

Write multiple data to API with one request.

PARAMETER DESCRIPTION
request

A dictionary with section as key and value to set as a tuple (first index is position 1)

TYPE: dict[Section, Any]

Examples:

>>> await client.write_data(
>>>     request={
>>>        HeatCircuit.TARGET_TEMPERATURE_DAY: (20, None, 5),
>>>        HeatCircuit.TARGET_TEMPERATURE_NIGHT: (16,),
>>>     }
>>> )

filter_request(request, position=None) async

Return only available section that are supported by the Web HMI software version.

PARAMETER DESCRIPTION
request

Section or a list of sections e.g. [BufferTank.NAME, …]

TYPE: Section | list[Section]

position

The number of the installed devices e.g. number of buffer tanks

TYPE: Position | int | list[int] | None DEFAULT: None

RETURNS DESCRIPTION
request

A list of sections e.g. [BufferTank.NAME, …]

Examples:

>>> data = await client.filter_request(
>>>     request=[
>>>         HeatCircuit.TARGET_TEMPERATURE,
>>>         HeatCircuit.TARGET_TEMPERATURE_DAY
>>>     ]
>>> )