skillfed

pyControl4

Python 3 asyncio package for interacting with Control4 systems

pycontrol4 v2.0.2 75.8K downloads/30d#14,678 on PyPI52
Permissive license Active released

What it is and what it does

pyControl4 is an async Python library that bridges your code to Control4 smart home systems via their built-in REST API. It handles authentication (both account-level and controller-level bearer tokens), device discovery, and direct control of connected devices like lights. The library is built on aiohttp and websocket-client for non-blocking I/O, making it suitable for integration into async applications like Home Assistant.

The package is actively maintained and known to work with Control4 OS 2.10.1.544795-res and OS 3.0+. It provides high-level classes (C4Account, C4Director, C4Light) that abstract the REST API details, so you authenticate once, query your controller's device list, and then send commands to individual devices. The official Home Assistant integration uses this library, indicating production readiness for that use case.

Use it for:

  • Integrate Control4 device control into a Home Assistant or other home automation platform
  • Build custom automation scripts that query and control lights, switches, or other Control4 devices on a schedule
  • Discover all devices on a Control4 controller and expose them to a third-party dashboard or API
  • Implement scene triggering or device ramping (e.g., dimming lights over a time interval) from external applications

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

An async library for controlling Control4 smart home systems through their REST API, supporting device discovery, authentication, and direct control of lights and other connected devices.

Yes, if you own a Control4 system and need programmatic control. The library is actively maintained, has no known vulnerabilities, and is already battle-tested in Home Assistant. Install friction is low. The main constraint is Python >=3.11 and network access to your Control4 controller; verify your controller's OS version matches the documented compatibility range.

Install

pycontrol4 on PyPI

pip

pip install pycontrol4

uv

uv add pycontrol4

poetry

poetry add pycontrol4

Installing pyControl4

Before you install

Low install friction with a pure-Python wheel. Maintained actively with recent commits and no known vulnerabilities. Requires Python >=3.11 and four async-capable runtime dependencies (aiohttp, xmltodict, python-socketio-v4, websocket-client).

License in practice

Licensed under Apache Software License (permissive), allowing commercial and private use with minimal restrictions.

Quickstart

from pyControl4.account import C4Account
from pyControl4.director import C4Director
import asyncio

account = C4Account(username, password)
token = asyncio.run(account.get_account_bearer_token())
controllers = asyncio.run(account.get_account_controllers())
director = C4Director(ip, bearer_token)
devices = asyncio.run(director.get_all_item_info())

Requires Python >=3.11; Control4 controller must be reachable on the local network and support the REST API.

Verify before relying

  • Whether the library works reliably with Control4 OS versions other than 2.10.1.544795-res and 3.0+
  • Performance characteristics and concurrency limits when controlling many devices simultaneously
  • Whether all Control4 device types are supported or only a subset (lights are documented)

Package facts

License not declared (permissive)
Python support supports the current Python release (>=3.11)
Install friction low — pure-Python wheel
Runtime dependencies 4 — aiohttp, xmltodict, python-socketio-v4, websocket-client
Maintenance actively maintained — 172 days since the last release
Last repo commit
First released
Downloads 75,819/month — #14,678 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: pycontrol4-2.0.2-py3-none-any.whl

License :: OSI Approved :: Apache Software LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3

Tags

control4 home automation apiasync control4 device controlcontrol4 rest api clientsmart home control4 integrationcontrol4 light control python
home-automationcontrol4async-io

More Networking packages