Skip to main content

Python interface with Vaillant multiMATIC

Project description

pymultiMATIC

PyPI - License codecov PyPI PyPI - Python Version

Legal Disclaimer

This software is not affiliated with Vaillant and the developers take no legal responsibility for the functionality or security of your vaillant devices.

Install

[sudo] pip3 install pymultimatic 

Tests

You can run tests with

pytest

Usages

Module usage

The project is separated in two layers:

1. ApiConnector

This is the low level connector using the vaillant API and returning raw data directly coming from the API (basically, json formatted responses). The connector is handling the login and session (cookie based). There are 2 helper packages for urls and payload: pymultimatic.api.urls and pymultimatic.api.payloads.

Here is an example on how to use it:

import aiohttp
from pymultimatic.api import Connector, urls, payloads

async with aiohttp.ClientSession() as session:
    connector = Connector('user', 'pass', session)
    # get information about your system
    response = await connector.request('get', urls.system(serial='123'))
    #set the target low heating temperature of a zone to 15 °C
    response = await connector.request('put', urls.zone_heating_setback_temperature(id='1', serial='123'), payload=payloads.zone_temperature_setback(15))

Here is an example of response:

{
    "body": {
        "facilitiesList": [
            {
                "serialNumber": "1234567891234567891234567890",
                "name": "Name",
                "responsibleCountryCode": "BE",
                "supportedBrand": "GREEN_BRAND_COMPATIBLE",
                "capabilities": [
                    "ROOM_BY_ROOM",
                    "SYSTEMCONTROL_MULTIMATIC"
                ],
                "networkInformation": {
                    "macAddressEthernet": "12:34:56:78:9A:BC",
                    "macAddressWifiAccessPoint": "34:56:78:9A:BC:DE",
                    "macAddressWifiClient": "56:78:9A:BC:DE:F0"
                },
                "firmwareVersion": "1.1.1"
            }
        ]
    },
    "meta": {}
}

I would recommend using this layer if you only want to retrieve basic data (outdoor temperature, current temperature of zone, etc.)

2. SystemManager

This layer allows you to interact in a more friendly way with the system and it computes some data for you. The underlying Connector is hidden and raw responses are mapped to more useful objects.

Here is a script example:

#!/usr/bin/env python3

import asyncio
import sys

import aiohttp

from pymultimatic.systemmanager import SystemManager
from pymultimatic.model import System


async def main(user, passw):
    print('Trying to connect with user ' + user)

    async with aiohttp.ClientSession() as session:
        manager = SystemManager(user, passw, session)
        system =  await manager.get_system()
        print(system)


if __name__ == "__main__":
    if not len(sys.argv) == 3:
        print('Usage: python3 dump.py user pass')
        sys.exit(0)
    user = sys.argv[1]
    passw = sys.argv[2]

    asyncio.get_event_loop().run_until_complete(main(user, passw))

Then you can run the script: python3 script.py user passw

The main object to manipulate is pymultimatic.model.System, which is grouping all the information about your system.

In case of error coming from the API, a pymultimtic.api.Error is raised, containing the response and the payload sent to the API.

I would recommend using this layer if you want to do more complex things, e.g: if you want to get the target temperature for a room or a zone, it can become a bit complex since you have to deal with holiday mode, quick mode, quick veto, time program, etc. This layer is hiding you this complexity.


Buy Me A Coffee

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

pymultiMATIC-0.7.3.tar.gz (53.0 kB view details)

Uploaded Source

Built Distribution

pymultiMATIC-0.7.3-py3-none-any.whl (49.8 kB view details)

Uploaded Python 3

File details

Details for the file pymultiMATIC-0.7.3.tar.gz.

File metadata

  • Download URL: pymultiMATIC-0.7.3.tar.gz
  • Upload date:
  • Size: 53.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for pymultiMATIC-0.7.3.tar.gz
Algorithm Hash digest
SHA256 d44830370122acec171f67c502a69345c2b03b7f569344aae8d6f117b91988f3
MD5 cb571f587b9d0178124a9c3c03377eef
BLAKE2b-256 1e1a920914edb51c0729821a7d6470960bca2e9cd41eedb1c798fe290ada2190

See more details on using hashes here.

File details

Details for the file pymultiMATIC-0.7.3-py3-none-any.whl.

File metadata

  • Download URL: pymultiMATIC-0.7.3-py3-none-any.whl
  • Upload date:
  • Size: 49.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for pymultiMATIC-0.7.3-py3-none-any.whl
Algorithm Hash digest
SHA256 8649bef2d0ff42c69a5309f46a948a1b50a1e833dbc67596bd5e8dd3c3faadb8
MD5 9394d7972da4dc689d2c3522380f4a6c
BLAKE2b-256 51647edb4f3c45d33325981c377fef178c864aef02d10eb101b951fb9c3d6cca

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page