Skip to main content

Python library for ConnectLife API

Used by devices from Hisense, Gorenje, ASKO & ATAG and ETNA Connect.

The goal of this library is to support a native Home Assistant integration for devices that uses the ConnectLife API.

The code is based on Connectlife API proxy / MQTT Home Assistant integration (MIT license).

Software is provided as is - use at your own risk. There is probably no way to harm your physical devices, but there is no guarantee that you don't experience other problems, for instance locking your ConnectLife account.

Licensed under GPLv3.

Dumping your appliances

To test out the library (users in Russia/CIS may need to pass the --trir option):

pip install connectlife
python -m connectlife.dump --username <username> [--password '<password>'] [--trir]

Omit password to be prompted for it instead. Make sure to always use single quotes around passwords with special characters.

This will log in to the ConnectLife API using the provided username and password, and write a JSON file with all returned fields for each appliance that is registered with the account. Pass --format dd to instead write a mapping file YAML skeleton to be used with connectlife-ha.

Note: the property set a device reports is not authoritative. A device may report properties it does not actually support (and may omit ones its feature code defines), so two units with the same device type/feature code can report different properties. Treat dumps as a starting point for a mapping, not ground truth — cross-check controls against the device or the ConnectLife app.

Pass --query to dump something else. Each query writes one file per appliance, except property-list. The per-device queries redact the puid, wifi_id and device_id that the responses echo, but the responses are undocumented and may contain other identifiers, so review each file before sharing.

Energy statistics

python -m connectlife.dump --username <username> --query energy

Writes <type>-<feature>-energy.json with the responses from both energy endpoints (air_duct_energy and energyConsumptionCurve).

Static data

python -m connectlife.dump --username <username> --query static

Writes <type>-<feature>-static.json with the query_static_data response: the settings and values the device supports, and its firmware versions. It's per device, so it can differ between two models that report the same device type/feature code.

System data

python -m connectlife.dump --username <username> --query system

Writes <type>-<feature>-system.json with the query_system_data response. For a dishwasher it lists the programs with their position, duration and which options each allows.

Self-check

python -m connectlife.dump --username <username> --query self-check

Writes <type>-<feature>-self-check.json with the faults the device can report (e.g. Error-F11, with the value that means a fault and a description) and the current ones.

Property list

python -m connectlife.dump --username <username> \
    --query property-list --device-type-code <type-code> --device-feature-code <feature-code>

Writes <type>-<feature>-property-list.json with the property list for a device type and feature code (any code, not just ones on your account).

Hourly power

There is no dump query for this, but the library has get_hour_power(puid, date) for the hourly energy use of a day. Non-AC devices reply with zeros.

OAuth (browser sign-in)

OAuthConnectLifeApi uses tokens from the browser sign-in on oauth.hijuconn.com, which also supports Google, Apple, Facebook and Microsoft accounts and accepting updated terms. The caller runs the authorization code flow and refreshes the tokens (in Home Assistant, the OAuth2 config flow), and passes a callback returning a valid access token:

from connectlife.oauth import (
    OAUTH2_AUTHORIZE_URL,
    OAUTH2_CLIENT_ID,
    OAUTH2_CLIENT_SECRET,
    OAUTH2_TOKEN_URL,
    OAuthConnectLifeApi,
    generate_source_id,
)

api = OAuthConnectLifeApi(get_access_token, source_id=stored_source_id)
appliances = await api.get_appliances()

The client ID and secret are Hisense's client for Home Assistant. Requests go to Hisense's third-party API (juapi-3rd.hijuconn.com), except energy statistics, which it doesn't have; those go to the app gateway with the same token. If the API rejects the token twice, LifeConnectAuthError is raised and the sign-in should be repeated. Persist the source_id.

Test server

To use the test server to support developing the Home Assistant integration, clone this repo and see DEVELOPMENT.md.

Metadata

Release files for connectlife 0.13.0

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

Source distribution (sdist)

Source distribution for connectlife 0.13.0
File Size Uploaded Provenance
connectlife-0.13.0.tar.gz 177.3 kB Without provenance Details

Built distribution (wheel)

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

Total release size: 237.3 kB

Release files / connectlife-0.13.0.tar.gz

Download URL connectlife-0.13.0.tar.gz
Size 177.3 kB
Tags Source
SHA-256 checksum
How to use checksums
40494ceed4f2c11d1af183843ad893f9862a15b8ef03ee1965b01ab8f2d73559
BLAKE2b-256 checksum
How to use checksums
b609c099b1a3ed8c7265c1f7a5d73c8738e7e5435986d95e95950f1c16a5dcbb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.8.23

Release files / connectlife-0.13.0-py3-none-any.whl

Download URL connectlife-0.13.0-py3-none-any.whl
Size 60.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
47466f2e57e024d41fc5e7a876528a6e4faa08382c9d4463d3475b4d7ad66507
BLAKE2b-256 checksum
How to use checksums
d23ae700a4e43cb78f7193e1459fc87dda5e7df19cd7d015bf772b62eeb9778c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.8.23

Security for connectlife 0.13.0

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

0.13.0 This release

2 release files No provenance

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