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/

Releases

  • Update version number in pyproject.toml
  • Run uv build
  • Run git tag v0.1.1 (same version as in pyproject.toml)
  • Run uvx twine upload dist/*

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.1.tar.gz (7.4 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.1-py3-none-any.whl (9.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ecohome-0.1.1.tar.gz
  • Upload date:
  • Size: 7.4 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.1.tar.gz
Algorithm Hash digest
SHA256 9b7f4e3ca5414c4da15468e11da0f64dca54375b0bdd4f35c4edf8c74a56cbc4
MD5 4b4c2e3eee0da662c16ed58d9e2dd7ef
BLAKE2b-256 dc1026107bf43946e8f713d5b1b3885400724b947c5726512429e41065cf39db

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ecohome-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 9.3 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 898a8c86060442b1459786cecda401cdc21f1fc114ac55211fa3694a392e0feb
MD5 5e95d5b101dc393ecafe0b739687cc15
BLAKE2b-256 f5ca224aa2cda7106840058e75ee5785f8e561f87bce6fe65d3b9314ebc4f4b5

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