Skip to main content

1KOMMA5° Python API Client

Tests PyPI Python License

onekommafive is an unofficial Python client for the 1KOMMA5° Heartbeat home-energy-management API — the platform behind 1KOMMA5°'s heat pumps, solar inverters, battery storage systems, and EV chargers (wallboxes).

Read live power flows, control EV charging, monitor Dynamic Pulse market prices, drive the AI energy-management system (EMS), and pull weather forecasts — from Python or a built-in 1k5 command-line interface.

⚠️ Unofficial. The API is undocumented and reverse-engineered from the mobile app; it may change without notice. Not affiliated with or endorsed by 1KOMMA5°.

Documentation

Full documentation lives at https://mrebbert.github.io/1komma5-api/. The README stays short and points there.

  • CLI reference — every 1k5 command with flags and example output.
  • API reference — curl-level documentation of every endpoint the client wraps: URLs, request parameters, response JSON, known quirks. Source: API.md.
  • §14a EnWG grid-fee bundle — regulatory primer, Modul 1 vs. Modul 3, field mapping, convenience method.
  • FAQ — legacy sign-in, token cache, HTTP-400 date quirks, HTTP-403 on price-guarantee, and other recurring questions.
  • Development — setup, tests, lint, type-check, probe-versions, release flow.
  • Changelog — per-version additions, changes and fixes.
  • Postman collection — importable alongside the API reference.

Installation

Requires Python 3.13 or newer. The SDK became async in 1.0.0; if you need Python 3.11/3.12 compatibility, pin onekommafive<1.0.

pip install onekommafive

With development extras (pytest, aioresponses, mypy, ruff):

pip install "onekommafive[dev]"

Quick start

Set your 1KOMMA5° credentials once via environment variables. All CLI commands and the token cache pick them up automatically:

export ONEKOMMAFIVE_USERNAME="user@example.com"
export ONEKOMMAFIVE_PASSWORD="s3cr3t"

# Optional — pin to a specific system (default: first system on the account)
export ONEKOMMAFIVE_SYSTEM="<system-uuid>"

Command-line interface

$ 1k5 live
System:       xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
Status:       ONLINE
PV power:     +1837 W
Battery:      +4802 W  SoC 61.0%
Grid:         +5914 W  (import +5914 W  export +0 W)
Consumption:  +2950 W
Household:    +1900 W
EV chargers:  +0 W
Heat pumps:   +2000 W
ACs:          +1500 W
Self-suff.:   0.0%

Full command catalogue and flags: CLI reference. Local help via 1k5 --help or 1k5 <command> --help.

Python library (async, default since 1.0.0)

import asyncio
import datetime
from onekommafive import Client, Systems
from onekommafive.models import ChargingMode


async def main() -> None:
    async with Client("user@example.com", "s3cr3t") as client:
        system = (await Systems(client).get_systems())[0]

        # Live overview
        ov = await system.get_live_overview()
        print(
            f"PV: {ov.pv_power} W  Battery: {ov.battery_power} W ({ov.battery_soc:.1f}%)"
        )
        print(f"Grid: {ov.grid_power} W  Self-sufficiency: {ov.self_sufficiency:.0%}")

        # Market prices for today (EUR/kWh, hourly)
        today = datetime.datetime.now().replace(
            hour=0, minute=0, second=0, microsecond=0
        )
        mp = await system.get_prices(
            today, today.replace(hour=23, minute=59, second=59)
        )
        print(
            f"Avg spot: {mp.average_price:.4f}  all-in: {mp.average_price_all_in:.4f} EUR/kWh"
        )

        # Switch the EV to solar-only charging
        ev = (await system.get_ev_chargers())[0]
        await ev.set_charging_mode(ChargingMode.SOLAR_CHARGE)
        await ev.set_target_soc(90.0)
        await ev.set_primary_departure_time("07:30")

        # Aggregated AI performance
        summary = await system.get_heartbeat_ai_summary(resolution="1M")
        print(
            f"{summary.self_sufficiency_percent:.0%} autonomous, "
            f"{summary.earned_amount_eur:.2f} € earned, "
            f"{summary.co2_saved_kg:.0f} kg CO2 saved"
        )


asyncio.run(main())

Inside Home Assistant, pass the shared client session so lifecycle stays with the host:

from homeassistant.helpers.aiohttp_client import async_get_clientsession

client = Client(user, pw, session=async_get_clientsession(hass))

Every response is a fully-typed dataclass (see Python models below); the package ships py.typed (PEP 561) so mypy --strict sees the whole surface.

Python library (sync)

For scripts, notebooks, and other callers who don't want to introduce asyncio, onekommafive.sync wraps the async API on a dedicated background event loop:

from onekommafive.sync import Client, Systems
from onekommafive.models import ChargingMode

with Client("user@example.com", "s3cr3t") as client:
    system = Systems(client).get_systems()[0]
    ov = system.get_live_overview()
    ev = system.get_ev_chargers()[0]
    ev.set_charging_mode(ChargingMode.SOLAR_CHARGE)

Same method names, same return types, just without await. The CLI uses this wrapper internally.

Features

Live and historical

  • Live power snapshot — PV, battery, grid, consumption, per-device flows, self-sufficiency
  • Energy summary and timeseries for today or any historical range (1h / 15m)
  • Market electricity prices with grid costs and VAT (1h / 15m)
  • Weather forecast — today, tomorrow, plus 3-hour slots for 48 h
  • Aggregated Heartbeat savings (EUR) for any date range

Control

  • EV charger — charging mode, target SoC, departure time, current SoC
  • EMS — automatic or manual override, Time-of-Use, per-device manual settings

AI and analytics

  • AI optimisation decisions (battery / EV charging, with market-price context)
  • Self-sufficiency events — granular battery-discharge trace
  • Heartbeat AI performance summary — self-sufficiency, feed-in earnings, CO₂ saved, peak-price avoided
  • Lifetime CO₂ savings (site, community, global estimate)
  • Lifetime and monthly energy-trader savings
  • §14a EnWG Modul 1 / Modul 3 grid-fee savings — see the regulatory primer

Metadata and configuration

  • System, site, and full customer records
  • Site status and hardware asset inventory (inverter, heat pump, meter, EV charger — with manufacturer / model / serial / firmware / network address)
  • Active feature flags per site (Dynamic Pulse, Time-of-Use optimisation, smart charging)
  • Wallbox hardware (distinct from vehicle-side EV profile)
  • Smart-meter registration (ENTSO-E control-area EIC, DSO BDEW code, concession fee)
  • User profile plus every site the user is authorised for
  • Notifications and per-category channel preferences
  • User-configured and comparison prices, contractual price guarantee
  • API version compatibility check

Cross-cutting

  • OAuth2 + PKCE authentication matching the mobile-app flow, with automatic silent token refresh
  • Optional persistent token cache (chmod 600, user-bound) — subsequent CLI calls skip the login round-trip
  • Built-in 1k5 CLI covering every read endpoint and all mutations
  • Ruff-clean, mypy-strict, CodeQL-clean, 95 % coverage gate

Python models

Every endpoint returns a typed dataclass from onekommafive.models:

Domain Classes
System SystemInfo, SystemDetails, SystemCustomer, DeviceGateway, SiteStatus, SiteSystemInfo, Enwg14aModule, Asset, SiteDetails, SmartMeter
User & customer User, ConnectedSystem, Customer
Live & energy LiveOverview, EnergyData, EnergySlot, HeartbeatSavings
Prices MarketPrices, PriceCustomizations, ComparisonPrice, PriceGuarantee, HeartbeatPrices, HeartbeatPriceWindow
EV & EMS EVCharger, ChargingMode, Wallbox, EmsSettings, EmsManualDevice
Weather WeatherData, WeatherDay, WeatherSlot, WEATHER_SYMBOLS
AI & analytics OptimizationEvents, OptimizationEvent, SelfSufficiencyEvents, HeartbeatAiSummary, ImpactOverview, EnergyTrader, MonthlyTradingSavings
Notifications Notification, NotificationsList, NotificationSettings, NotificationChannelSettings
API meta SupportedVersions, VersionInfo

Every model exposes a raw attribute (dict[str, Any]) with the full untouched API response for fields that are not yet mapped. See the FAQ entry on the escape hatch.

Development

Full developer guide (setup, tests, lint, type-check, probe, release) lives at Development. Quick reference:

uv sync
uv run pre-commit install
uv run pytest

Integration tests opt-in via ONEKOMMAFIVE_USERNAME / ONEKOMMAFIVE_PASSWORD environment variables (read-only, no mutations). Contribution policy and PR expectations: CONTRIBUTING.md.

See CHANGELOG.md for the release history, API.md for the full curl-level endpoint reference, and scripts/probe_versions.py for the local version-bump probe.

Compatibility

This project is developed against the author's own 1KOMMA5° installation. It has not been tested broadly across hardware configurations — a lot of it is "it works for me". Use at your own risk.

Reference setup:

Component Model
Hybrid inverter Sungrow SH6.0RT-V112
Battery Sungrow SBR256
Wallbox go-e homeFix 11 kW
EV Volkswagen ID.5
Heat pump Stiebel Eltron WPL-A 10 HK 400 Premium
Smart meter Chint DTSU666

Legacy accounts served only from my.1komma5.io / api.gridx.de are out of scope; see the FAQ.

1komma5-ha

A Home Assistant integration built on top of this library. Exposes your 1KOMMA5° system as sensors, switches, and controls directly in Home Assistant.

Credits

Large parts of this project are inspired by and based on the work of Alex Birkner and his hacs_1komma5grad integration. Many thanks for paving the way.

License

MIT — see LICENSE.

Metadata

Release files for onekommafive 1.1.10

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for onekommafive 1.1.10
File Size Uploaded
onekommafive-1.1.10.tar.gz 112.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for onekommafive 1.1.10
File Interpreter ABI Platform
onekommafive-1.1.10-py3-none-any.whl Python 3 none any Details

Total release size: 189.4 kB

Release files / onekommafive-1.1.10.tar.gz

Download URL onekommafive-1.1.10.tar.gz
Size 112.1 kB
Tags Source
SHA-256 checksum
How to use checksums
2fd1b37f168ce2795f6cef8dacda5e53365524470af0f5bfee81abb076c3126b
BLAKE2b-256 checksum
How to use checksums
729fdfd19cd68ec4b2546c955be4ad55f61612fd91a907d29c83cba4f8e8b332
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 16, 2026.

Transparency log

Release files / onekommafive-1.1.10-py3-none-any.whl

Download URL onekommafive-1.1.10-py3-none-any.whl
Size 77.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4456f4362016cfeb449f5913976f0dead9afe8da7ff10c4a443c5b0b68cc19cd
BLAKE2b-256 checksum
How to use checksums
b51196dfc35b3c7fdca430f13e382fd007071893ad714de56ab0a43e89d77bb0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 16, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

1.1.10 This release

2 release files

1.1.9

2 release files

1.1.8

2 release files

1.1.7

2 release files

1.1.6

2 release files

1.1.5

2 release files

1.1.4

2 release files

1.1.3

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.5.0

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.46

2 release files

0.1.25

2 release files

0.1.24

2 release files

0.1.23

2 release files

0.1.22

2 release files

0.1.21

2 release files

0.1.16

2 release files

0.1.15

2 release files

0.1.14

2 release files

0.1.13

2 release files

0.1.12

2 release files

0.1.9

2 release files

0.1.8

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page