Skip to main content

Weheat Backend client

Project description

Weheat backend client

This is a client for the Weheat backend. It is automatically generated from the OpenAPI specification.

Requirements.

Python 3.7+

Installation & Usage

You can install directly using:

pip install weheat

Then import the package:

import weheat

Getting Started

After installation, you can now use the client to interact with the Weheat backend. Note that all methods are async as of version 2025.1.15.

import asyncio
from keycloak import KeycloakOpenID  # install with pip install python-keycloak
from weheat.abstractions.heat_pump import HeatPump

# connection information
auth_url = 'https://auth.weheat.nl/auth/'
api_url = 'https://api.weheat.nl/third_party'
realm_name = 'Weheat'

# client ID and secret provided by Weheat
client_id = ''
client_secret = ''

# username and password used for the online portal
username = ''
password = ''

# your heat pump UUID
my_heat_pump_id = ''


async def demo():
    # login into keycloak and get an access token
    keycloak_open_id = KeycloakOpenID(server_url=auth_url,
                                      client_id=client_id,
                                      realm_name=realm_name,
                                      client_secret_key=client_secret)

    token_response = keycloak_open_id.token(username, password)
    # The access token is valid for its lifetime even after logging out
    keycloak_open_id.logout(token_response['refresh_token'])

    # construct the heat pump object and fetch its data
    hp = HeatPump(api_url=api_url, uuid=my_heat_pump_id)
    await hp.async_get_status(token_response['access_token'])

    # Print some of the information, look in the files for all available properties
    print(f'Heat pump status: {hp.heat_pump_state}')
    print(f'Heat pump RPM: {hp.compressor_percentage}%')
    print(f'Total produced central heating energy: {hp.energy_out_heating} kWh')

asyncio.run(demo())

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

weheat-2025.11.24rc1.tar.gz (56.6 kB view details)

Uploaded Source

Built Distribution

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

weheat-2025.11.24rc1-py3-none-any.whl (75.8 kB view details)

Uploaded Python 3

File details

Details for the file weheat-2025.11.24rc1.tar.gz.

File metadata

  • Download URL: weheat-2025.11.24rc1.tar.gz
  • Upload date:
  • Size: 56.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for weheat-2025.11.24rc1.tar.gz
Algorithm Hash digest
SHA256 81dda406e112b9f39c4bcc668809065a08d612a73ff188b667a05bd37d520e8d
MD5 72e5ae839503edba91f48e93ad93411e
BLAKE2b-256 52fcfe864dfd27f79efda77d3ba1e4b1744111cc52738a96bdffdfdb234253d2

See more details on using hashes here.

File details

Details for the file weheat-2025.11.24rc1-py3-none-any.whl.

File metadata

  • Download URL: weheat-2025.11.24rc1-py3-none-any.whl
  • Upload date:
  • Size: 75.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for weheat-2025.11.24rc1-py3-none-any.whl
Algorithm Hash digest
SHA256 65a29c27bd57fb928f79aa3d8029232f975e4534327005857f426c59675d1eea
MD5 1535efde23c564dac95a953e2f327e32
BLAKE2b-256 466f9c904ab7ab989ae64dbe5a2e32ceeb964142316aaf86c9edd66ffc327822

See more details on using hashes here.

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