
[](https://github.com/superbox-dev/KEBA-KeEnergy-API/actions/workflows/ci.yml)
[](https://pypi.python.org/pypi/keba-keenergy-api)
[](https://github.com/superbox-dev/KEBA-KeEnergy-API/blob/main/LICENSE)



# KEBA KeEnergy API
A Python wrapper for the KEBA KeEnergy API.
## Getting started
```bash
pip install keba-keenergy-api
```
## Usage
```python
import asyncio
from typing import Any
from keba_keenergy_api import KebaKeEnergyAPI
from keba_keenergy_api.constants import HeatCircuit
async def main() -> None:
client = KebaKeEnergyAPI(host="YOUR-IP-OR-HOSTNAME", ssl=True)
# Get current outdoor temperature
outdoor_temperature: float = await client.get_outdoor_temperature()
# Get heat circuit temperature from heat circuit 2
heat_circuit_temperature: float = await client.heat_circuit.get_temperature(position=2)
# Read multiple values
data: dict[str, tuple[float | int | str]] = await client.read_data(
request=[
HeatCircuit.TEMPERATURE,
HeatCircuit.DAY_TEMPERATURE,
],
)
# Enable "day" mode for heat circuit 2
await client.heat_circuit.set_operating_mode(mode="day", position=2)
# Write multiple values
await client.write_data(
request={
HeatCircuit.DAY_TEMPERATURE: (20, None, 5), # Write heat circuit on position 1 and 3
HeatCircuit.NIGHT_TEMPERATURE: (16,), # Write night temperature on position 1
},
)
asyncio.run(main())
```
By default, the library creates a new connection to `KEBA KeEnergy API` with each coroutine. If you are calling a large number of coroutines, an `aiohttp ClientSession()` can be used for connection pooling:
```python
import asyncio
from keba_keenergy_api import KebaKeEnergyAPI
from aiohttp import ClientSession
async def main() -> None:
async with ClientSession() as session:
client = KebaKeEnergyAPI(host="YOUR-IP-OR-HOSTNAME", session=session, ssl=True)
...
asyncio.run(main())
```
### API endpoints
| Endpoint | Description |
|-------------------------------------------------|----------------------------------------------|
| `.read_data(request, position, human_readable)` | Get multiple values with one http request. |
| `.write_data(request)` | Write multiple values with one http request. |
#### System
| Endpoint | Response | Description |
|----------------------------------------------------|----------------|--------------------------------------------------------------------------------------------------------------------|
| `.get_info()` | `str` | Get system information. |
| `.get_device_info()` | `str` | Get device information. |
| `.get_outdoor_temperature()` | `float` | Get outdoor temperature. |
| `.get_operating_mode(position, human_readable)` | `int` or `str` | Get operating mode as integer (0 is `STANDBY`, 1 is `SUMMER`, 2 is `AUTO_HEAT`, 3 is `AUTO_COOL` and 4 is `AUTO`). |
| `.set_operating_mode(0, position, human_readable)` | `int` or `str` | Set operating mode. |
#### Hot water tank
| Endpoint | Request/Response | Description |
|----------------------------------------------------|------------------|---------------------------------------------------------------------------------------|
| `.get_lower_limit_temperature(position)` | `int` | Get lower limit temperature. |
| `.get_upper_limit_temperature(position)` | `int` | Get upper limit temperature. |
| `.get_temperature(position)` | `float` | Get temperature. |
| `.get_operating_mode(position, human_readable)` | `int` or `str` | Get operating mode as integer (0 is `OFF`, 1 is `AUTO`, 2 is `DAY` and 3 is `NIGHT`). |
| `.set_operating_mode(0, position, human_readable)` | `int` or `str` | Set operating mode. |
| `.get_min_temperature(position)` | `float` | Get minimum temperature. |
| `.set_min_temperature(20, position)` | `float` | Set minimum temperature. |
| `.get_max_temperature(position)` | `float` | Get maximum temperature. |
| `.set_max_temperature(22, position)` | `float` | Set maximum temperature. |
| `.get_heat_request(position)` | `int` or `str` | Get heat request. |
### Heat pump
| Endpoint | Response | Description |
|--------------------------------------------------|----------------|-------------------------------------------------------------------------------|
| `.get_name(position)` | `str` | Get head pump model name. |
| `.get_state(position, human_readable)` | `int` or `str` | Get heat pump state as integer (0 is `STANDBY`, 1 is `FLOW` and 2 is `AUTO`). |
| `.get_operating_mode(position, human_readable)` | `int` or `str` | Get operating mode as integer (0 is `OFF`, 1 is `ON`, 2 is `BACKUP`). |
| `.get_circulation_pump(position)` | `float` | Get circulation pump in percent. |
| `.get_inflow_temperature(position)` | `float` | Get inflow temperature. |
| `.get_reflux_temperature(position)` | `float` | Get reflux temperature. |
| `.get_source_input_temperature(position)` | `float` | Get source input temperature. |
| `.get_source_output_temperature(position)` | `float` | Get source output temperature. |
| `.get_compressor_input_temperature(position)` | `float` | Get compressor input temperature. |
| `.get_compressor_output_temperature(position)` | `float` | Get compressor output temperature. |
| `.get_compressor(position)` | `float` | Get compressor in percent. |
| `.get_high_pressure(position)` | `float` | Get high pressure. |
| `.get_low_pressure(position)` | `float` | Get low pressure. |
| `.get_heat_request(position)` | `int` or `str` | Get heat request. |
### Heat circuit
| Endpoint | Request/Response | Description |
|-------------------------------------------------|----------------|-----------------------------------------------------|
| `.get_temperature(position)` | `float` | Get temperature. |
| `.get_day_temperature(position)` | `float` | Get day temperature. |
| `.set_day_temperature(20, position)` | `float` | Set day temperature. |
| `.get_day_temperature_threshold(position)` | `float` | Get day temperature threshold. |
| `.get_night_temperature(position)` | `float` | Get night temperature. |
| `.set_night_temperature(16, position)` | `float` | Set night temperature. |
| `.get_night_temperature_threshold(position)` | `float` | Get night temperature threshold. |
| `.get_holiday_temperature(position)` | `float` | Get holiday temperature. |
| `.set_holiday_temperature(14, position)` | `float` | Set holiday temperature. |
| `.get_temperature_offset(position)` | `float` | Get temperature offset. |
| `.set_temperature_offset(2, position)` | `float` | Set temperature offset. |
| `.get_operating_mode(position, human_readable)` | `int` or `str` | Get operating mode (0 is `OFF` and 3 is `HEAT_UP`). |
| `.set_operating_mode(3, position)` | `int` or `str` | Set operating mode. |
| `.get_heat_request(position)` | `int` or `str` | Get heat request. |
| `.get_external_cool_request(position)` | `int` or `str` | Get external cool request. |
| `.get_external_heat_request(position)` | `int` or `str` | Get external heat request. |
## Changelog
The changelog lives in the [CHANGELOG.md](CHANGELOG.md) document. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
## Contributing
We're happy about your contributions to the project!
You can get started by reading the [CONTRIBUTING.md](CONTRIBUTING.md).
## Donation
We put a lot of time into this project. If you like it, you can support us with a donation.
[](https://ko-fi.com/F2F0KXO6D)
Raw data
{
"_id": null,
"home_page": null,
"name": "keba-keenergy-api",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.10",
"maintainer_email": "Michael Hacker <mh@superbox.one>",
"keywords": "api, keba, keenergy",
"author": null,
"author_email": "Michael Hacker <mh@superbox.one>",
"download_url": "https://files.pythonhosted.org/packages/a0/08/da6a66ce2d04178e6a3fe0374c3f9876d212ea47ddfc2c8f4ce74c3d9c38/keba_keenergy_api-1.12.9.tar.gz",
"platform": null,
"description": "\n[](https://github.com/superbox-dev/KEBA-KeEnergy-API/actions/workflows/ci.yml)\n[](https://pypi.python.org/pypi/keba-keenergy-api)\n\n[](https://github.com/superbox-dev/KEBA-KeEnergy-API/blob/main/LICENSE)\n\n\n\n\n# KEBA KeEnergy API\n\nA Python wrapper for the KEBA KeEnergy API.\n\n## Getting started\n\n```bash\npip install keba-keenergy-api\n```\n\n## Usage\n\n```python\nimport asyncio\nfrom typing import Any\n\nfrom keba_keenergy_api import KebaKeEnergyAPI\nfrom keba_keenergy_api.constants import HeatCircuit\n\n\nasync def main() -> None:\n client = KebaKeEnergyAPI(host=\"YOUR-IP-OR-HOSTNAME\", ssl=True)\n\n # Get current outdoor temperature\n outdoor_temperature: float = await client.get_outdoor_temperature()\n\n # Get heat circuit temperature from heat circuit 2\n heat_circuit_temperature: float = await client.heat_circuit.get_temperature(position=2)\n\n # Read multiple values\n data: dict[str, tuple[float | int | str]] = await client.read_data(\n request=[\n HeatCircuit.TEMPERATURE,\n HeatCircuit.DAY_TEMPERATURE,\n ],\n )\n\n # Enable \"day\" mode for heat circuit 2\n await client.heat_circuit.set_operating_mode(mode=\"day\", position=2)\n\n # Write multiple values\n await client.write_data(\n request={\n HeatCircuit.DAY_TEMPERATURE: (20, None, 5), # Write heat circuit on position 1 and 3 \n HeatCircuit.NIGHT_TEMPERATURE: (16,), # Write night temperature on position 1\n },\n )\n\n\nasyncio.run(main())\n```\n\nBy default, the library creates a new connection to `KEBA KeEnergy API` with each coroutine. If you are calling a large number of coroutines, an `aiohttp ClientSession()` can be used for connection pooling:\n\n\n```python\nimport asyncio\n\nfrom keba_keenergy_api import KebaKeEnergyAPI\n\nfrom aiohttp import ClientSession\n\nasync def main() -> None:\n async with ClientSession() as session:\n client = KebaKeEnergyAPI(host=\"YOUR-IP-OR-HOSTNAME\", session=session, ssl=True)\n ...\n\nasyncio.run(main())\n```\n\n\n### API endpoints\n\n| Endpoint | Description |\n|-------------------------------------------------|----------------------------------------------|\n| `.read_data(request, position, human_readable)` | Get multiple values with one http request. |\n| `.write_data(request)` | Write multiple values with one http request. |\n\n#### System\n\n| Endpoint | Response | Description |\n|----------------------------------------------------|----------------|--------------------------------------------------------------------------------------------------------------------|\n| `.get_info()` | `str` | Get system information. |\n| `.get_device_info()` | `str` | Get device information. |\n| `.get_outdoor_temperature()` | `float` | Get outdoor temperature. |\n| `.get_operating_mode(position, human_readable)` | `int` or `str` | Get operating mode as integer (0 is `STANDBY`, 1 is `SUMMER`, 2 is `AUTO_HEAT`, 3 is `AUTO_COOL` and 4 is `AUTO`). |\n| `.set_operating_mode(0, position, human_readable)` | `int` or `str` | Set operating mode. |\n\n\n#### Hot water tank\n\n| Endpoint | Request/Response | Description |\n|----------------------------------------------------|------------------|---------------------------------------------------------------------------------------|\n| `.get_lower_limit_temperature(position)` | `int` | Get lower limit temperature. |\n| `.get_upper_limit_temperature(position)` | `int` | Get upper limit temperature. |\n| `.get_temperature(position)` | `float` | Get temperature. |\n| `.get_operating_mode(position, human_readable)` | `int` or `str` | Get operating mode as integer (0 is `OFF`, 1 is `AUTO`, 2 is `DAY` and 3 is `NIGHT`). |\n| `.set_operating_mode(0, position, human_readable)` | `int` or `str` | Set operating mode. |\n| `.get_min_temperature(position)` | `float` | Get minimum temperature. |\n| `.set_min_temperature(20, position)` | `float` | Set minimum temperature. |\n| `.get_max_temperature(position)` | `float` | Get maximum temperature. |\n| `.set_max_temperature(22, position)` | `float` | Set maximum temperature. |\n| `.get_heat_request(position)` | `int` or `str` | Get heat request. |\n\n### Heat pump\n\n| Endpoint | Response | Description |\n|--------------------------------------------------|----------------|-------------------------------------------------------------------------------|\n| `.get_name(position)` | `str` | Get head pump model name. |\n| `.get_state(position, human_readable)` | `int` or `str` | Get heat pump state as integer (0 is `STANDBY`, 1 is `FLOW` and 2 is `AUTO`). |\n| `.get_operating_mode(position, human_readable)` | `int` or `str` | Get operating mode as integer (0 is `OFF`, 1 is `ON`, 2 is `BACKUP`). |\n| `.get_circulation_pump(position)` | `float` | Get circulation pump in percent. |\n| `.get_inflow_temperature(position)` | `float` | Get inflow temperature. |\n| `.get_reflux_temperature(position)` | `float` | Get reflux temperature. |\n| `.get_source_input_temperature(position)` | `float` | Get source input temperature. |\n| `.get_source_output_temperature(position)` | `float` | Get source output temperature. |\n| `.get_compressor_input_temperature(position)` | `float` | Get compressor input temperature. |\n| `.get_compressor_output_temperature(position)` | `float` | Get compressor output temperature. |\n| `.get_compressor(position)` | `float` | Get compressor in percent. |\n| `.get_high_pressure(position)` | `float` | Get high pressure. |\n| `.get_low_pressure(position)` | `float` | Get low pressure. |\n| `.get_heat_request(position)` | `int` or `str` | Get heat request. |\n\n### Heat circuit\n\n| Endpoint | Request/Response | Description |\n|-------------------------------------------------|----------------|-----------------------------------------------------|\n| `.get_temperature(position)` | `float` | Get temperature. |\n| `.get_day_temperature(position)` | `float` | Get day temperature. |\n| `.set_day_temperature(20, position)` | `float` | Set day temperature. |\n| `.get_day_temperature_threshold(position)` | `float` | Get day temperature threshold. |\n| `.get_night_temperature(position)` | `float` | Get night temperature. |\n| `.set_night_temperature(16, position)` | `float` | Set night temperature. |\n| `.get_night_temperature_threshold(position)` | `float` | Get night temperature threshold. |\n| `.get_holiday_temperature(position)` | `float` | Get holiday temperature. |\n| `.set_holiday_temperature(14, position)` | `float` | Set holiday temperature. |\n| `.get_temperature_offset(position)` | `float` | Get temperature offset. |\n| `.set_temperature_offset(2, position)` | `float` | Set temperature offset. |\n| `.get_operating_mode(position, human_readable)` | `int` or `str` | Get operating mode (0 is `OFF` and 3 is `HEAT_UP`). |\n| `.set_operating_mode(3, position)` | `int` or `str` | Set operating mode. |\n| `.get_heat_request(position)` | `int` or `str` | Get heat request. |\n| `.get_external_cool_request(position)` | `int` or `str` | Get external cool request. |\n| `.get_external_heat_request(position)` | `int` or `str` | Get external heat request. |\n\n## Changelog\n\nThe changelog lives in the [CHANGELOG.md](CHANGELOG.md) document. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).\n\n## Contributing\n\nWe're happy about your contributions to the project!\n\nYou can get started by reading the [CONTRIBUTING.md](CONTRIBUTING.md).\n\n## Donation\n\nWe put a lot of time into this project. If you like it, you can support us with a donation.\n\n[](https://ko-fi.com/F2F0KXO6D)\n",
"bugtrack_url": null,
"license": "Apache-2.0 license",
"summary": "A Python wrapper for the KEBA KeEnergy API.",
"version": "1.12.9",
"project_urls": {
"Issue tracker": "https://github.com/superbox-dev/KEBA-KeEnergy-API/issues",
"Source code": "https://github.com/superbox-dev/KEBA-KeEnergy-API"
},
"split_keywords": [
"api",
" keba",
" keenergy"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "6ca302d07b9a87838cc02e90b1b566687a691c81539223c7b4fa0785f63acc17",
"md5": "d8044e7d8d91fd6f2383f78e80549a70",
"sha256": "d620566f0ba87744565a949aaf8d458e41ec043c9a2d71f490cca026bd0b6da8"
},
"downloads": -1,
"filename": "keba_keenergy_api-1.12.9-py3-none-any.whl",
"has_sig": false,
"md5_digest": "d8044e7d8d91fd6f2383f78e80549a70",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10",
"size": 16418,
"upload_time": "2024-12-21T11:48:02",
"upload_time_iso_8601": "2024-12-21T11:48:02.873094Z",
"url": "https://files.pythonhosted.org/packages/6c/a3/02d07b9a87838cc02e90b1b566687a691c81539223c7b4fa0785f63acc17/keba_keenergy_api-1.12.9-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "a008da6a66ce2d04178e6a3fe0374c3f9876d212ea47ddfc2c8f4ce74c3d9c38",
"md5": "060531150f9d354e423b7c10ff49d6df",
"sha256": "56531b687d3210b2f3525a23e253bb435c018a80fe6cc0e0f781077f68d4c0b4"
},
"downloads": -1,
"filename": "keba_keenergy_api-1.12.9.tar.gz",
"has_sig": false,
"md5_digest": "060531150f9d354e423b7c10ff49d6df",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10",
"size": 29612,
"upload_time": "2024-12-21T11:48:05",
"upload_time_iso_8601": "2024-12-21T11:48:05.170523Z",
"url": "https://files.pythonhosted.org/packages/a0/08/da6a66ce2d04178e6a3fe0374c3f9876d212ea47ddfc2c8f4ce74c3d9c38/keba_keenergy_api-1.12.9.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-21 11:48:05",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "superbox-dev",
"github_project": "KEBA-KeEnergy-API",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "keba-keenergy-api"
}