Skip to main content

Open-source Python implementation of the New Energy (Batavia Heat) Eco-Home API

Project description

ecohome

Open-source Python client and CLI for the New Energy Eco-Home heat pump API, which is used by Batavia Heat heat pumps in the Netherlands.

Installation

Requires Python 3.14+. Older versions probably work fine, YMMV.

pip install ecohome

Or from source using uv:

uv sync

CLI usage

Credentials can be passed as flags or via environment variables:

export ECOHOME_USER=you@example.com
export ECOHOME_PASSWORD=yourpassword

After the first successful login, credentials are saved to ~/.ecohome/credentials.json (mode 0600) and reused automatically on subsequent calls.

Show status

pyecohome status

Example output:

Heating:   off  29.2℃ / 27.6℃  →  40.0℃  (Verwarming)
Hot water: off  61.5℃  →  65.0℃

Add --json for machine-readable output:

pyecohome status --json
{
  "heating": {
    "on": false,
    "current_temp_main": 29.2,
    "current_temp_minor": 27.6,
    "target_temp": 40.0,
    "mode": "Verwarming"
  },
  "hot_water": {
    "on": false,
    "current_temp": 61.5,
    "target_temp": 65.0
  }
}

Control hot water

pyecohome hot-water on
pyecohome hot-water off

Use --dry-run to print the request that would be sent without actually sending it:

pyecohome hot-water on --dry-run

Options

Flag Description
--username Login username (overrides ECOHOME_USER)
--password Login password (overrides ECOHOME_PASSWORD)
--device Device code to target (auto-selected when you have only one device)
--dry-run Print the outgoing request instead of sending it

Python API

from ecohome.client import EcoHomeClient

client = EcoHomeClient.login("you@example.com", "yourpassword")

# List devices
devices = client.list_devices()
device_code = devices[0]["device_code"]

# Current state
detail = client.get_device_detail(device_code)

# Turn hot water on/off
client.update_switch_state(device_code, address="1020", value=True)

# Log out (also removes saved credentials)
client.logout()

Credentials storage

Credentials (username, user ID, token, session cookie) are stored in ~/.ecohome/credentials.json after a successful login. Pass save_credentials=False to EcoHomeClient.login() to opt out.

Development

uv sync
uv run ruff check src/

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

ecohome-0.1.0.tar.gz (7.3 kB view details)

Uploaded Source

Built Distribution

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

ecohome-0.1.0-py3-none-any.whl (9.1 kB view details)

Uploaded Python 3

File details

Details for the file ecohome-0.1.0.tar.gz.

File metadata

  • Download URL: ecohome-0.1.0.tar.gz
  • Upload date:
  • Size: 7.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for ecohome-0.1.0.tar.gz
Algorithm Hash digest
SHA256 fab33ead0ee01333b3596418b4ec8ecfcb710ac807ac43180517af9e5cb5d8d2
MD5 97da25a4913162051e80f48a4cffb36b
BLAKE2b-256 a207c4e7b7edcd00457329f62d28e8c329bef0554963265e9afd784bc0dcc4c5

See more details on using hashes here.

File details

Details for the file ecohome-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: ecohome-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 9.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for ecohome-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 607557ed7627762a808c730d1c970649fbce5e56fa2dea17cea587b00497da31
MD5 ef83557f45f25d2be96c05bbbbb5d966
BLAKE2b-256 6ce932e3a9d8c732e2f82851e7e8bf42e29d2e4070c17eff11e985d034fbe385

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