Python IOLite Client
WIP Python client for IOLite's remote API.
The client is still incomplete, but 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.
Requirements
- Python 3.7+
- Poetry
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:
separateduser:pass
.code
is the pairing code
You can decode the base64 encoded basicAuth information using the scripts/get_credentials.py
script (see development section).
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.
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