Skip to content

max13fr/AirzoneCloud

Repository files navigation

Airzone Cloud

Presentation

Abstract

Allow to communicate easily with Airzone Cloud to retrieve information or to send commands (on/off, temperature, HVAC mode, ...)

This library manage the main Airzone Cloud API (try to connect to www.airzonecloud.com to be sure).

Official API documentation is available here : https://developers.airzonecloud.com/docs/web-api/

Module classes

  • AirzoneCloud : represent your AirzoneCloud account. Contains a list of your installations :
    • Installation: represent one of your installation (like your home, an office, ...). Contains a list of its groups :
      • Group : represent a group of devices in the installation
        • Device : represent your thermostat to control

Airzonecloud tree elements

Usage

Install

pip3 install AirzoneCloud

Start API

from AirzoneCloud import AirzoneCloud
api = AirzoneCloud("email@domain.com", "password")

Get installations

for installation in api.installations:
    print(
        "Installation(name={}, access_type={}, ws_ids=[{}], id={})".format(
            installation.name, installation.access_type, ", ".join(installation.ws_ids), installation.id
        )
    )

Output :

Installation(name=Home, access_type=admin, ws_ids=[AA:BB:CC:DD:EE:FF], id=60f5cb990123456789abdcef)

Get installations

for installation in api.installations:
    print(
        "Installation(name={}, access_type={}, ws_ids=[{}], id={})".format(
            installation.name, installation.access_type, ", ".join(installation.ws_ids), installation.id
        )
    )

Output :

Installation(name=Home, access_type=admin, ws_ids=[AA:BB:CC:DD:EE:FF], id=60f5cb990123456789abdcef)

Get groups for each installation

for installation in api.installations:
    print(installation)
    for group in installation.groups:
        print(
            "  Group(name={}, installation={}, id={})".format(
                group.name, group.installation.name, group.id
            )
        )

Output :

Installation(name=Home)
  Group(name=System 1, installation=Home, id=60f5cb990123456789abdce0)

Get devices for each grou of each installation

for installation in api.installations:
    print(installation)
    for group in installation.groups:
        print("  " + str(group))
        for device in group.devices:
            print(
                "    Device(name={}, is_connected={}, is_on={}, mode={}, current_temp={}, target_temp={}, id={}, ws_id={})".format(
                    device.name,
                    device.is_connected,
                    device.is_on,
                    device.mode,
                    device.current_temperature,
                    device.target_temperature,
                    device.id,
                    device.ws_id,
                )
            )

Output :

Installation(name=Home)
  Group(name=System 1, installation=Home)
    Device(name=Salon, is_connected=True, is_on=True, mode=heating, current_temp=20.9, target_temp=20.0, id=60f5cb990123456789abdce1, ws_id=AA:BB:CC:DD:EE:FF)
    Device(name=Ch parents, is_connected=True, is_on=False, mode=heating, current_temp=17.2, target_temp=18.0, id=60f5cb990123456789abdce2, ws_id=AA:BB:CC:DD:EE:FF)
    Device(name=Ch bebe, is_connected=True, is_on=False, mode=heating, current_temp=18.6, target_temp=19.5, id=60f5cb990123456789abdce3, ws_id=AA:BB:CC:DD:EE:FF)

Get all devices from all installations shortcut

for device in api.all_devices:
    print(
        "Device(name={}, is_on={}, mode={}, current_temp={}, target_temp={}, id={})".format(
            device.name,
            device.is_on,
            device.mode,
            device.current_temperature,
            device.target_temperature,
            device.id,
        )
    )

Output :

Device(name=Salon, is_connected=True, is_on=True, mode=heating, current_temp=20.9, target_temp=20.0, id=60f5cb990123456789abdce1, ws_id=AA:BB:CC:DD:EE:FF)
Device(name=Ch parents, is_connected=True, is_on=False, mode=heating, current_temp=17.2, target_temp=18.0, id=60f5cb990123456789abdce2, ws_id=AA:BB:CC:DD:EE:FF)
Device(name=Ch bebe, is_connected=True, is_on=False, mode=heating, current_temp=18.6, target_temp=19.5, id=60f5cb990123456789abdce3, ws_id=AA:BB:CC:DD:EE:FF)

Control a device

All actions by default are waiting 1 second then refresh the device. You can disable this behavior by adding auto_refresh=False.

# get first device
device = api.all_devices[0]
print(device)

# start device & set temperature
device.turn_on(auto_refresh=False).set_temperature(22)
print(device)

# stopping device
device.turn_off()
print(device)

Output :

Device(name=Salon, is_connected=True, is_on=False, mode=heating, current_temp=20.8, target_temp=20.0)
Device(name=Salon, is_connected=True, is_on=True, mode=heating, current_temp=20.8, target_temp=22.0)
Device(name=Salon, is_connected=True, is_on=False, mode=heating, current_temp=20.8, target_temp=22.0)

HVAC mode

Available modes

  • stop : Stop mode
  • auto : Automatic mode
  • cooling : Cooling mode
  • heating : Heating mode
  • ventilation : Ventilation mode
  • dehumidify : Dehumidifier / Dry mode
  • emergency-heating : Emergency heat mode
  • air-heating : Heat air mode (only compatible systems)
  • radiant-heating : Heat radiant mode (only compatible systems)
  • combined-heating : Heat combined mode (only compatible systems)
  • air-cooling : Cooling air mode (only compatible systems)
  • radiant-cooling : Cooling radiant mode (only compatible systems)
  • combined-cooling : Cooling combined mode (only compatible systems)

Only master thermostat device can update the mode.

List supported modes for each devices

for device in api.all_devices:
    print(
        "Device(name={}, mode={}, modes_availables={})".format(
            device.name,
            device.mode,
            device.modes_availables,
        )
    )

Output :

Device(name=Salon, mode=heating, modes_availables=['cooling', 'heating', 'ventilation', 'dehumidify', 'stop'])
Device(name=Ch parents, mode=heating, modes_availables=[])
Device(name=Ch bebe, mode=heating, modes_availables=[])

If modes_availables is an empty list, your device is not the master thermostat.

Set HVAC mode on a master thermostat device (and all linked thermostats)

device = api.all_devices[0]
print(device)

# set mode to cooling
device.set_mode("cooling")
print(device)

Output :

Device(name=Salon, is_connected=True, is_on=True, mode=heating, current_temp=20.8, target_temp=20.0)
Device(name=Salon, is_connected=True, is_on=True, mode=cooling, current_temp=20.8, target_temp=20.0)

API documentation

API full doc

Tests

Update configuration in config_test.json

  • email : used to log-in to you AirzoneCloud account (default to changeme@example.com)
  • password : used to log-in to you AirzoneCloud account (default to changeme)
  • log_level : minimum level of log to display : DEBUG | INFO | WARNING | ERROR | CRITICIAL (default to INFO)
  • display_group_properties : display all properties for each group (default to true).
  • display_device_properties : display all properties for each device (default to true).
  • display_api_token : ask to display token used to connect to the AirzoneCloud API (default to false). Useful for https://developers.airzonecloud.com/docs/web-api/
  • refresh_before_display : ask to call all refresh functions before displaying for test purpose (default to false).

Run test script

./test.py