Skip to content

aiovantage

Asynchronous Python library for controlling Vantage InFusion controllers.

Modules:

  • command_client –

    Clients for the Vantage Host Command (HC) service.

  • config_client –

    Client for the Vantage Application Communication Interface (ACI) service.

  • controllers –

    Controllers for managing collections of objects from the Vantage system.

  • discovery –

    Helper functions for discovering details about Vantage controllers.

  • errors –

    Client exceptions.

  • events –

    Event classes for Vantage controller events.

  • object_interfaces –

    Object interfaces classes.

  • objects –

    Vantage object definitions.

Classes:

  • Vantage –

    Main client for interacting with Vantage systems.

Vantage

Vantage(host: str, username: str | None = None, password: str | None = None, *, ssl: SSLContext | bool = True, ssl_context_factory: Callable[[], SSLContext] | None = None, config_port: int | None = None, command_port: int | None = None)

Main client for interacting with Vantage systems.

The Vantage class manages the various connections to a Vantage system, as well as exposing "controllers" for fetching and interacting with objects in the system.

Parameters:

  • host (str) –

    The hostname or IP address of the Vantage controller.

  • username (str | None, default: None ) –

    The username to use for authentication.

  • password (str | None, default: None ) –

    The password to use for authentication.

  • ssl (SSLContext | bool, default: True ) –

    The SSL context to use. True will use the default context, False will disable SSL.

  • ssl_context_factory (Callable[[], SSLContext] | None, default: None ) –

    A factory function to create an SSL context.

  • config_port (int | None, default: None ) –

    The port to use for the config client.

  • command_port (int | None, default: None ) –

    The port to use for the command client.

Methods:

Attributes:

host property

host: str

The hostname or IP address of the Vantage controller.

config_client property

config_client: ConfigClient

The config client instance.

command_client property

command_client: CommandClient

The command client instance.

event_stream property

event_stream: EventStream

The event stream instance.

master_number property

master_number: int | None

Master number of the master the clients connect to, None before discover_masters.

peers property

peers: list[int]

Master numbers of the other running masters, known after discover_masters.

anemo_sensors property

anemo_sensors: AnemoSensorsController

Controller for interacting with wind speed sensors.

areas property

Controller for interacting with areas.

back_boxes property

back_boxes: BackBoxesController

Controller for interacting with back boxes.

blinds property

Controller for interacting with blinds.

blind_groups property

blind_groups: BlindGroupsController

Controller for interacting with groups of blinds.

buttons property

Controller for interacting with keypad buttons.

dry_contacts property

dry_contacts: DryContactsController

Controller for interacting with dry contacts.

gmem property

Controller for interacting with variables.

light_sensors property

light_sensors: LightSensorsController

Controller for interacting with light sensors.

loads property

Controller for interacting with loads (lights, fans, etc).

load_groups property

load_groups: LoadGroupsController

Controller for interacting with groups of loads.

masters property

Controller for interacting with Vantage Controllers.

modules property

Controller for interacting with dimmer modules.

omni_sensors property

omni_sensors: OmniSensorsController

Controller for interacting with "omni" sensors.

port_devices property

port_devices: PortDevicesController

Controller for interacting with port devices.

power_profiles property

power_profiles: PowerProfilesController

Controller for interacting with power profiles.

rgb_loads property

rgb_loads: RGBLoadsController

Controller for interacting with RGB loads.

stations property

Controller for interacting with stations (keypads, etc).

tasks property

Controller for interacting with tasks.

temperatures property

temperatures: TemperaturesController

Controller for interacting with temperature sensors.

thermostats property

thermostats: ThermostatsController

Controller for interacting with thermostats.

get

get(vid: int) -> SystemObject | None

Return the item with the given Vantage ID.

Parameters:

  • vid (int) –

    The Vantage ID of the object.

Returns:

  • SystemObject | None –

    The object if it exists and has been fetched by a controller, or None.

close

close() -> None

Close all client connections.

initialize async

initialize(*, fetch_state: bool = True, enable_state_monitoring: bool = True) -> None

Initialize all controllers.

Parameters:

  • fetch_state (bool, default: True ) –

    Whether to fetch the state properties of objects.

  • enable_state_monitoring (bool, default: True ) –

    Whether to monitor for state changes on objects.

discover_masters async

discover_masters() -> None

Find the masters in the system. Later calls return at once.

fetch_state async

fetch_state() -> None

Fetch the state properties of all objects.

enable_state_monitoring async

enable_state_monitoring() -> None

Monitor for state changes on all objects.

disable_state_monitoring async

disable_state_monitoring() -> None

Stop monitoring for state changes on all objects.

subscribe

subscribe(event_type: type[T], callback: Callable[[T], None]) -> Callable[[], None]

Subscribe to events from every controller.

Parameters:

  • event_type (type[T]) –

    The type of event to subscribe to.

  • callback (Callable[[T], None]) –

    The callback to call when the event is emitted.

Returns:

  • Callable[[], None] –

    A function to unsubscribe.