Skip to main content

Async client for BRUdirekt (Brunata) portal

Project description

brunata-nutzerportal-api

Python client for fetching consumption data from the Brunata Munich user portal (nutzerportal.brunata-muenchen.de). Intended as a basis for a Home Assistant integration.

Status

Early/experimental project. The Munich instance uses SAP OData (UI5 frontend).

  • Login: NP_REG_LOGON_SRV_01 (CredentialSet via $batch)
  • Data: NP_APPLAUNCHER_SRV, NP_DASHBOARD_SRV (e.g. monthly values)

Disclaimer

This is an unofficial, independent open-source project and is not affiliated with BRUNATA-METRONA or BRUdirekt.

Use of this client may be subject to the portal's terms of service and applicable law. You are responsible for complying with them.

Use only with your own account / proper authorization, do not share credentials, and avoid aggressive polling.

Trademarks and product names (e.g. BRUdirekt, BRUNATA-METRONA) belong to their respective owners.

Installation (Poetry)

poetry install

Configuration

Create a .env in the project root (it will not be committed due to .gitignore):

BRUNATA_USERNAME=you@example.com
BRUNATA_PASSWORD=your-password
BRUNATA_BASE_URL=https://nutzerportal.brunata-muenchen.de
BRUNATA_SAP_CLIENT=201

CLI

Test login:

poetry run brunata login

Dump account + available periods/cost types (warning: may contain personal data):

poetry run brunata dump-pages --output-dir .brunata-dump

Fetch consumption data:

poetry run brunata readings --kind heating
poetry run brunata readings --kind hot_water

Fetch consumption data for all cost types (e.g. HZ01, HZ02, ... / WW01, WW02, ...):

poetry run brunata readings-all --kind heating
poetry run brunata readings-all --kind hot_water

Fetch meter readings (cumulative index):

poetry run brunata meter

Fetch "current consumption" (as shown in the dashboard):

poetry run brunata current --kind heating
poetry run brunata current --kind hot_water

Library usage (Home Assistant)

The client is async and suitable for Home Assistant's DataUpdateCoordinator patterns:

from brunata_api import BrunataClient, ReadingKind

async def fetch():
    async with BrunataClient(
        base_url="https://nutzerportal.brunata-muenchen.de",
        username="...",
        password="...",
        sap_client="201",
    ) as client:
        await client.login()
        heating = await client.get_readings(ReadingKind.heating)
        hot_water = await client.get_readings(ReadingKind.hot_water)
        return heating, hot_water

Key methods:

  • BrunataClient.login()
  • BrunataClient.get_account()
  • BrunataClient.get_supported_cost_types()
  • BrunataClient.get_readings(...)
  • BrunataClient.get_monthly_consumption(cost_type=..., in_kwh=...)
  • BrunataClient.get_monthly_consumptions(kind, in_kwh=...) (all matching cost types)
  • BrunataClient.get_meter_readings() (all HZ.. and WW.., keyed by cost_type)

Development

poetry run ruff check src tests
poetry run pytest

Packaging (optional)

poetry build
poetry publish --build

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

brunata_nutzerportal_api-0.1.4.tar.gz (14.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

brunata_nutzerportal_api-0.1.4-py3-none-any.whl (15.5 kB view details)

Uploaded Python 3

File details

Details for the file brunata_nutzerportal_api-0.1.4.tar.gz.

File metadata

  • Download URL: brunata_nutzerportal_api-0.1.4.tar.gz
  • Upload date:
  • Size: 14.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for brunata_nutzerportal_api-0.1.4.tar.gz
Algorithm Hash digest
SHA256 4dec445cc10ebf46ab6e0eb83eb24cdc2944df7df7dfd2456e519819ced46bc1
MD5 da834a898ba7e490da9aa6101799bf40
BLAKE2b-256 26dd09c83a45498378eacf48304fcd21a8ff6729fbdc3f5351c5d096d3283a30

See more details on using hashes here.

Provenance

The following attestation bundles were made for brunata_nutzerportal_api-0.1.4.tar.gz:

Publisher: publish.yml on fjfricke/brunata-api

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file brunata_nutzerportal_api-0.1.4-py3-none-any.whl.

File metadata

File hashes

Hashes for brunata_nutzerportal_api-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 6479a12530cc4adfdfd8b40b07b5aa6b1e06cc6f62adbbe7a40c1da2be7a42c1
MD5 70d711b926de8ceb7f0a233cf00a3090
BLAKE2b-256 866455d3543d117a2e3614281475b630159d372ec5852c70f1c2eb8ccf6fbc44

See more details on using hashes here.

Provenance

The following attestation bundles were made for brunata_nutzerportal_api-0.1.4-py3-none-any.whl:

Publisher: publish.yml on fjfricke/brunata-api

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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