Home Connect Websocket API
Project description
HomeConnect Websocket
Control HomeConnect Appliances through a local Websocket connection.
Authentication and Device Description
To connect to an Appliance, you need its encryption keys and the description of its features and options. The Appliance uses either TLS PSK or AES encryption, AES requiring an additional Initialization Vector (IV). Both Key and IV are send to Home Connect cloud servers on setup. To get the keys and description from the cloud use the Home Connect Profile Downloader tool.
For each registered Appliance, the downloaded zip-file contains three files named with the Appliance serial number:
[serialNumber].json: Contains information about the Appliance including encryption keys. TheconnectionTypefield indicates if the Appliance uses PSK or AES encryption. When the connection type is "AES" the Appliance uses AES Encryption and requires the IV.[serialNumber]_DeviceDescription.xmland[serialNumber]_FeatureMapping.xml: Contains the Device Description, see below
Parsing Device Description
import json
from pathlib import Path
from homeconnect_websocket import parse_device_description
# Load Description from File
with Path("[serialNumber]_DeviceDescription.xml").open() as file:
DeviceDescription = file.read()
with Path("[serialNumber]_FeatureMapping.xml").open() as file:
FeatureMapping = file.read()
description = parse_device_description(DeviceDescription, FeatureMapping)
# Save Description to File for later use
with Path("DeviceDescription.json", "w").open() as file:
json.dump(description, file)
Its best to save the parsed description as a json File to reuse later.
Connecting
import asyncio
import json
from homeconnect_websocket import DeviceDescription, HomeAppliance
async def main(description: DeviceDescription) -> None:
app_name = "Example App" # Name of your App, can be anything
app_id = "d50661eca7e45a" # ID of your App, can be anything
psk64 = "whZJhkPa3a1hkuDdI3twHdqi1qhTxjnKE8954_zyY_E=" # PSK Key
# iv64 = "ofi7M1WB98sJeM2H1Ew3XA==" # IV for Appliances with AES Encryption
appliance = HomeAppliance(
description,
"192.168.1.2",
app_name,
app_id,
psk64=psk64,
# iv64=iv64
)
# Connect to Appliances
await appliance.connect()
# Set PowerState to On
await appliance.settings["BSH.Common.Setting.PowerState"].set_value("On")
if __name__ == "__main__":
# Load DeviceDescription from File
with open("DeviceDescription.json", "r") as f:
description = json.load(f)
asyncio.run(main(description))
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file homeconnect_websocket-1.2.3b1.tar.gz.
File metadata
- Download URL: homeconnect_websocket-1.2.3b1.tar.gz
- Upload date:
- Size: 22.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
824336d80e617581d697d471f233f00497f1fe59725c9291537fc3af40f64b0d
|
|
| MD5 |
cd4abe05e6d01ac91c374080cd30722f
|
|
| BLAKE2b-256 |
2572ad42d46360bb43488d96ef22ed075a735ad5af0b50a95c05670bd2405b8e
|
Provenance
The following attestation bundles were made for homeconnect_websocket-1.2.3b1.tar.gz:
Publisher:
publish.yml on chris-mc1/homeconnect_websocket
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
homeconnect_websocket-1.2.3b1.tar.gz -
Subject digest:
824336d80e617581d697d471f233f00497f1fe59725c9291537fc3af40f64b0d - Sigstore transparency entry: 183012903
- Sigstore integration time:
-
Permalink:
chris-mc1/homeconnect_websocket@da31857d4560af63ac37e33d546d8e71b652d4f8 -
Branch / Tag:
refs/tags/1.2.3b1 - Owner: https://github.com/chris-mc1
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@da31857d4560af63ac37e33d546d8e71b652d4f8 -
Trigger Event:
release
-
Statement type:
File details
Details for the file homeconnect_websocket-1.2.3b1-py3-none-any.whl.
File metadata
- Download URL: homeconnect_websocket-1.2.3b1-py3-none-any.whl
- Upload date:
- Size: 20.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4bc415d674cb184c9b62af700a7310da014d889fea11a9a5a351f6d25b60e39c
|
|
| MD5 |
45582105957b018b4b43c986a1d6942d
|
|
| BLAKE2b-256 |
45a3819e05568bdbf39221a1d059312ebf39cc8fadbc9e6643af0ae9064d93b2
|
Provenance
The following attestation bundles were made for homeconnect_websocket-1.2.3b1-py3-none-any.whl:
Publisher:
publish.yml on chris-mc1/homeconnect_websocket
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
homeconnect_websocket-1.2.3b1-py3-none-any.whl -
Subject digest:
4bc415d674cb184c9b62af700a7310da014d889fea11a9a5a351f6d25b60e39c - Sigstore transparency entry: 183012904
- Sigstore integration time:
-
Permalink:
chris-mc1/homeconnect_websocket@da31857d4560af63ac37e33d546d8e71b652d4f8 -
Branch / Tag:
refs/tags/1.2.3b1 - Owner: https://github.com/chris-mc1
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@da31857d4560af63ac37e33d546d8e71b652d4f8 -
Trigger Event:
release
-
Statement type: