Skip to main content

aiovantage

Documentation PyPI - Version Discord

Python library for interacting with and controlling Vantage InFusion home automation controllers.

This open-source, non-commercial library is not affiliated, associated, authorized, endorsed by, or in any way officially connected with Vantage, and is provided for interoperability purposes only.

Example

from aiovantage import Vantage

async with Vantage("192.168.1.2", "username", "password") as vantage:
    async for load in vantage.loads:
        print(f"{load.name} is at {load.level}%")

See the examples folder for more examples.

Features

  • Fetch object configuration from your Vantage system.
  • Fetch object state and subscribe to state changes (e.g. load levels, sensor readings).
  • Control devices (turn on lights, set thermostats, etc).
  • Uses asyncio for non-blocking I/O.
  • Uses SSL connections by default, with automatic reconnection.
  • Supports both lazy and eager object fetching.

Installation

Add aiovantage as a dependency to your project, or install it directly:

pip install aiovantage

Supported objects

The following interfaces/controllers are currently supported.

Type Description Controller
AnemoSensor Wind speed sensors vantage.anemo_sensors
Area Rooms, etc vantage.areas
BackBox Backboxes vantage.back_boxes
Blind Shades, blinds vantage.blinds
BlindGroups Groups of blinds vantage.blind_groups
Buttons Keypad buttons vantage.buttons
DryContacts Motion sensors, etc vantage.dry_contacts
GMem Vantage variables vantage.gmem
LightSensor Light sensors vantage.light_sensors
Load Lights, relays, etc vantage.loads
LoadGroup Groups of loads vantage.load_groups
Master Vantage controllers vantage.masters
Module Dimmer modules vantage.modules
OmniSensor Power, current, etc vantage.omni_sensors
PortDevice Port devices (hubs) vantage.port_devices
PowerProfile Load power profiles vantage.power_profiles
RGBLoad RGB lights vantage.rgb_loads
Stations Keypads, etc vantage.stations
Tasks Vantage tasks vantage.tasks
Temperature Temperature sensors vantage.temperatures
Thermostat Thermostats vantage.thermostats

If you have an object that you expect to show up in one of these controllers but is missing, please create an issue or submit a pull request.

Usage

Creating a client

Begin by importing the Vantage class:

from aiovantage import Vantage

The most convenient way to create a client is by using the async context manager:

async with Vantage("hostname", "username", "password") as vantage:
    # ...use the vantage client

Alternatively, you can manage the lifecycle of the client yourself:

from aiovantage import Vantage

vantage = Vantage("hostname", "username", "password")
# ...use the vantage client
vantage.close()

Querying objects

The Vantage class exposes a number of controllers, which can be used to query objects. Controllers can either be populated lazily (by using async for), or eagerly (by using controller.initialize()).

For example, to get a list of all loads:

async with Vantage("hostname", "username", "password") as vantage:
    async for load in vantage.loads:
        print(f"{load.name} is at {load.level}%")

Alternatively, you can use controller.initialize() to eagerly fetch all objects:

async with Vantage("hostname", "username", "password") as vantage:
    await vantage.loads.initialize()
    for load in vantage.loads:
        print(f"{load.name} is at {load.level}%")

If you aren't interested in the state of the objects, you can call controller.initialize(fetch_state=False) to slightly speed up the initialization:

async with Vantage("hostname", "username", "password") as vantage:
    await vantage.loads.initialize(fetch_state=False)
    for load in vantage.loads:
        print(f"{load.name}")

All controllers implement a django-like query interface, which can be used to filter objects. You can either query by matching attributes:

async with Vantage("hostname", "username", "password") as vantage:
    async for load in vantage.loads.filter(name="Kitchen"):
        print(f"{load.name} is at {load.level}%")

Or by using a filter predicate:

async with Vantage("hostname", "username", "password") as vantage:
    async for load in vantage.loads.filter(lambda load: load.level > 50):
        print(f"{load.name} is at {load.level}%")

Fetching a single object

You can fetch a single object by id, by calling controller.aget() or controller.get():

async with Vantage("hostname", "username", "password") as vantage:
    load = await vantage.loads.aget(118)
    print(f"{load.name} is at {load.level}%")

These functions also implement the same query interface as controller.filter() for querying by attributes or filter predicate:

async with Vantage("hostname", "username", "password") as vantage:
    load = await vantage.loads.aget(name="Kitchen")
    print(f"{load.name} is at {load.level}%")

Controlling objects

Objects also expose various methods for controlling state. For example, to turn on a load:

async with Vantage("hostname", "username", "password") as vantage:
    load = vantage.loads.aget(name="Study Lights")
    await load.turn_on()

Subscribing to state changes

You can subscribe to state changes by using the controller.subscribe() method. The callback receives a typed event, with the updated object available as event.obj:

from aiovantage.events import ObjectUpdated


def on_load_state_change(event: ObjectUpdated):
    print(f"{event.obj.name} is at {event.obj.level}%")


async with Vantage("hostname", "username", "password") as vantage:
    await vantage.loads.initialize()
    vantage.loads.subscribe(ObjectUpdated, on_load_state_change)

Note that a subscription will only receive state changes for objects that have populated into the controller.

Metadata

Release files for aiovantage 0.23.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for aiovantage 0.23.0
File Size Uploaded
aiovantage-0.23.0.tar.gz 140.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for aiovantage 0.23.0
File Interpreter ABI Platform
aiovantage-0.23.0-py3-none-any.whl Python 3 none any Details

Total release size: 244.4 kB

Release files / aiovantage-0.23.0.tar.gz

Download URL aiovantage-0.23.0.tar.gz
Size 140.4 kB
Tags Source
SHA-256 checksum
How to use checksums
efbeb33308e5acd49544d17e6d76dc27bd9db21ba7c3f74b5e4f677c39e6b492
BLAKE2b-256 checksum
How to use checksums
a6b9963ccb5dfc6067fef1b9f4272236137790147a2fc53cd7f62b8db2e1e302
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.17 {"installer":{"name":"uv","version":"0.12.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / aiovantage-0.23.0-py3-none-any.whl

Download URL aiovantage-0.23.0-py3-none-any.whl
Size 104.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
959f116f3de32fc42d78c1f0a718cd7a21e6283f10f5ac73ef850ea08866f89e
BLAKE2b-256 checksum
How to use checksums
45431f5a82e5cb5b13b7d525562e16488190f4eb2ee777c211fc0247db06e359
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.17 {"installer":{"name":"uv","version":"0.12.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

This release

0.23.0 This release

2 release files

0.22.5

2 release files

0.22.2

2 release files

0.22.1

2 release files

0.22.0

2 release files

0.21.0

2 release files

0.20.0

2 release files

0.19.0

2 release files

0.17.2

2 release files

0.17.1

2 release files

0.17.0

2 release files

0.16.0

2 release files

0.15.1

2 release files

0.15.0

2 release files

0.14.0

2 release files

0.13.0

2 release files

0.12.8

2 release files

0.12.2

2 release files

0.12.1

2 release files

0.12.0

2 release files

0.11.1

2 release files

0.11.0

2 release files

0.10.1

2 release files

0.10.0

2 release files

0.9.0

2 release files

0.8.1

2 release files

0.8.0

2 release files

0.7.0

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page