Skip to main content

A thin Python wrapper for the KEBA KeEnergy API.

Project description

coverage-badge CI Version

license-url Typing: strict Code style: black Code style: Ruff

KEBA KeEnergy API

A thin Python wrapper for the KEBA KeEnergy API.

Getting started

pip install keba-keenergy-api

Usage

import asyncio

from keba_keenergy_api import KebaKeEnergyAPI
from keba_keenergy_api.constants import HeatCircuitOperatingMode


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)

    # Enable "day" mode for heat circuit
    await client.heat_circuit.set_operating_mode(mode=HeatCircuitOperatingMode.DAY)


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:

import asyncio

from keba_keenergy_api import KebaKeEnergyAPI
from keba_keenergy_api.constants import HeatCircuitOperatingMode

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 Type Description
.get_outdoor_temperature() float Get outdoor temperature.

Device

Endpoint Type Description
.get_name() str Get name.
.get_serial_number() int Get serial number.
.get_revision_number() int Get revision name.
.get_variant_number() int Get variant name.

Hot water tank

Endpoint Type Description
.get_temperature() float Get temperature.
.get_operating_mode() int Get operating mode as integer (0 is OFF, 1 is AUTO, 2 is DAY and 3 is NIGHT.
.set_operating_mode(0) int Set operating mode.
.get_min_temperature() float Get minimum temperature.
.set_min_temperature(20) float Set minimum temperature.
.get_max_temperature() float Get maximum temperature.
.set_max_temperature(22) float Set maximum temperature.

Heat pump

Endpoint Type Description
.get_status() int Get operating mode as integer (0 is STANDBY, 1 is FLOW and 2 is AUTO.
.get_circulation_pump() float Get circulation pump in percent.
.get_inflow_temperature() float Get inflow temperature.
.get_reflux_temperature() float Get reflux temperature.
.get_source_input_temperature() float Get source input temperature.
.get_source_output_temperature() float Get source output temperature.
.get_compressor_input_temperature() float Get compressor input temperature.
.get_compressor_output_temperature() float Get compressor output temperature.
.get_compressor() float Get compressor in percent.
.get_high_pressure() float Get high pressure.
.get_low_pressure() float Get low pressure.

Heat circuit

Endpoint Type Description
.get_temperature() float Get temperature.
.get_day_temperature() float Get day temperature.
.set_day_temperature(20) float Set day temperature.
.get_day_temperature_threshold() float Get day temperature threshold.
.get_night_temperature() float Get night temperature.
.set_night_temperature(16) float Set night temperature.
.get_night_temperature_threshold() float Get night temperature threshold.
.get_holiday_temperature() float Get holiday temperature.
.get_offset_temperature() float Get offset temperature.
.set_offset_temperature(2) float Set offset temperature.
.get_operating_mode() int Get operating mode (0 is OFF and 3 is HEAT_UP).
.set_operating_mode(3) int Set operating mode.

Changelog

The changelog lives in the CHANGELOG.md document. The format is based on Keep a Changelog.

Contributing

We're happy about your contributions to the project!

You can get started by reading the CONTRIBUTING.md.

Donation

We put a lot of time into this project. If you like it, you can support us with a donation.

ko-fi

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

keba_keenergy_api-1.1.0.tar.gz (17.6 kB view details)

Uploaded Source

Built Distribution

keba_keenergy_api-1.1.0-py3-none-any.whl (11.6 kB view details)

Uploaded Python 3

File details

Details for the file keba_keenergy_api-1.1.0.tar.gz.

File metadata

  • Download URL: keba_keenergy_api-1.1.0.tar.gz
  • Upload date:
  • Size: 17.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for keba_keenergy_api-1.1.0.tar.gz
Algorithm Hash digest
SHA256 cabae5a58f2f0cda15e478829526e456c1deebaae1a0dd1e77489da2d830a05c
MD5 f84a3828d591737eddea24b537ca3b31
BLAKE2b-256 2a35435953ef390b3a2651e83a7924844a10dac0604b1ae0f4f15004242bf842

See more details on using hashes here.

File details

Details for the file keba_keenergy_api-1.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for keba_keenergy_api-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0f118c58cc18844fd2e11a937bdb02aee53731ed69add1146764d5c7dbbab137
MD5 3931610d26f322d4dd752ca3c1d0373f
BLAKE2b-256 4c2207432a6355f5d244569a4c06f075dd868fb9258c22a58d739dfda1526c6c

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page