pyControl4
Python 3 asyncio package for interacting with Control4 systems
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 pycontrol4uv
uv add pycontrol4poetry
poetry add pycontrol4Installing 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
Tags
More Networking packages
h11 is a pure-Python HTTP/1.1 protocol…
permissive · top 100 on PyPI
psutilpsutil retrieves real-time information about…
permissive · top 1,000 on PyPI
pyOpenSSLpyOpenSSL wraps OpenSSL's SSL/TLS functionality…
permissive · top 1,000 on PyPI
uvloopuvloop is a drop-in replacement for Python's…
permissive · top 1,000 on PyPI
execnetexecnet lets you spawn and communicate with…
permissive · top 1,000 on PyPI
pyzmqPyZMQ provides Python bindings for ZeroMQ…
permissive · top 1,000 on PyPI
switchbot-apiAn async Python library for controlling…
permissive · top 15,000 on PyPI
aiohueAsynchronous Python library for controlling…
permissive · top 15,000 on PyPI
xknxXKNX is an asynchronous Python library for…
permissive · top 15,000 on PyPI
elgatoAsynchronous Python client for controlling and…
permissive · top 15,000 on PyPI
pysensiboProvides an asyncio-friendly Python API client…
permissive · top 15,000 on PyPI
pyisyPyISY is a Python library for asynchronous…
permissive · top 15,000 on PyPI
fjaraskupanControl Fjäråskupan kitchen fans over Bluetooth…
permissive · top 15,000 on PyPI
flux-ledControls Magic Home and Surp Life WiFi LED…
copyleft · top 15,000 on PyPI
pymielepymiele is a Python library that enables Home…
permissive · top 15,000 on PyPI
aioqswAsync Python library for controlling QNAP QSW…
permissive · top 15,000 on PyPI