Skip to main content

API client for interacting with IOLite's remote API

Project description

Python IOLite Client

CI Codacy Badge codecov Code style: black PyPI version PyPI downloads License

Python client for IOLite's remote API.

The client has basic functionality such as the authentication layer, some basic command models, and a client to change the heating intervals are available.

Build by reverse engineering the Deutsche Wohnen MIA Android App and subsequently their remote API.

Read the following short post on how that was achieved.

Used in making the IOLite Custom Component for Home Assistant.

Requirements

Getting credentials

Open your Deutsche Wohnen tablet and begin pairing device process. Scan the QR code with your QR-Scanner and instead of opening the QR code in your browser, copy it's content. You'll get the following payload:

{
  "webApp": "/ui/",
  "code": "<redacted>",
  "basicAuth": "<redacted>"
}
  • basicAuth contains base64 encoded HTTP basic username and password. Decode this to get the : separated user:pass.
  • code is the pairing code

You can decode the credentials using the scripts/get_credentials.py script. e.g.

 python scripts/get_credentials.py '{"webApp":"/ui/","code":"<redacted>","basicAuth":"<redacted>"}'

Development

  • Init your virtualenv environment (poetry install)
  • Copy .env.example to .env
  • Decode credentials (poetry run python scripts/get_credentials.py <basic-auth-value>)
  • Add your credentials to .env following the above process

The pre-commit framework is used enforce some linting and style compliance on CI.

To get the same behaviour locally you can run pre-commit install within your activated venv.

Alternatively to run manually you can run pre-commit run -a.

Access remote UI

Run poetry run python scripts/example.py and copy the URL to your browser of choice.

You will need the HTTP basic credentials you defined earlier within the .env file.

Be sure to run poetry install -E dev to get the required dependencies for this.

Usage example

A jupyter notebook showcasing the heating interval scheduler can be found in notebooks/Heating Scheduler.ipynb. To access the notebook install jupyter notebook or jupyter lab into the virtual environment and run the notebook:

poetry shell
pip install notebook
jupyter notebook

If running the notebook gives you a ModuleNotFoundError, you may fix this issue by changing the notebook's kernel (following this StackOverflow post):

poetry shell
python -m ipykernel install --user --name=`basename $VIRTUAL_ENV`

Then switch the kernel in the notebook's top menu under: Kernel > Change Kernel.

Licence

MIT

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

iolite_client-0.7.6.tar.gz (14.0 kB view details)

Uploaded Source

Built Distribution

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

iolite_client-0.7.6-py3-none-any.whl (14.2 kB view details)

Uploaded Python 3

File details

Details for the file iolite_client-0.7.6.tar.gz.

File metadata

  • Download URL: iolite_client-0.7.6.tar.gz
  • Upload date:
  • Size: 14.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.14

File hashes

Hashes for iolite_client-0.7.6.tar.gz
Algorithm Hash digest
SHA256 14d488da12d259fce664c8bd521b93abe583c70b42f9f6c3fe64484cb943f1eb
MD5 51556b175028331e73306d9f8451f609
BLAKE2b-256 a29e8af094fd1eabad0c4bcc5650199a3410532508502961d111b83fee02674c

See more details on using hashes here.

File details

Details for the file iolite_client-0.7.6-py3-none-any.whl.

File metadata

  • Download URL: iolite_client-0.7.6-py3-none-any.whl
  • Upload date:
  • Size: 14.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.14

File hashes

Hashes for iolite_client-0.7.6-py3-none-any.whl
Algorithm Hash digest
SHA256 dbbd5158abadd9e8ec6dbf657c2daa3881cb793ca80e2d587d6cedd06b575697
MD5 a573e24b074d7e0aee29264e52978ff2
BLAKE2b-256 0fdff135e33eb2917950491c62574e23b391cf88265edbdbbe254d7480545af7

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