Skip to main content

Govee Local API

Upload Python Package

Please note that scene and segment support is still very experimental.

See SUPPORTED_DEVICES.md for the full list of known device models and their capabilities.

Requirements

Installation

From your terminal, run

pip install govee-local-api

or

python3 -m pip install govee-local-api

Usage

Basic Usage

import asyncio
from govee_local_api import GoveeController

async def main():
    # Simple single-interface setup
    controller = GoveeController()

    # Discover devices
    devices = await controller.scan_devices()

    # Control a device
    if devices:
        device = devices[0]
        await device.turn_on()
        await device.set_brightness(80)
        await device.set_color(255, 0, 0)  # Red

asyncio.run(main())

Multi-Interface Setup

For complex network environments with multiple interfaces:

# Multiple listening addresses (basic)
controller = GoveeController(
    listening_addresses=["192.168.1.100", "10.0.0.100", "172.16.1.100"]
)

Tolerating a failed bind (require_all=False)

By default start() requires every configured address to bind; a single failure (EADDRNOTAVAIL for a stale address, EADDRINUSE, an interface that went down) closes any endpoint already opened and re-raises, so the controller is left unbound.

Since 3.1.0 you can opt in to keeping whatever binds successfully:

controller = GoveeController(
    listening_addresses=["192.168.1.100/24", "10.0.0.100/8", "172.16.1.100/16"]
)
await controller.start(require_all=False)

for address, error in controller.bind_failures:
    logging.warning("Not listening on %s: %s", address, error)
print("Live on", controller.listening_addresses)
  • start() raises only if no address binds. The raised exception is the original OSError (errno preserved; an EADDRINUSE is preferred when several differ), never a wrapper type, so errno-based handling keeps working.
  • bind_failures lists (address, OSError) pairs for the most recent start() only and is reset on every call. Partial success is also logged at warning level.
  • The configured address set is never pruned: a later start() retries every address, so a caller can recover an adapter that has come back by simply calling start() again.

Network Mask Configuration

For precise subnet-aware device routing (recommended for enterprise/VLAN environments), embed the network mask directly in the address using CIDR or netmask notation:

# Precise subnet matching with embedded network masks
controller = GoveeController(
    listening_addresses=[
        "192.168.1.100/24",             # Main LAN (CIDR)
        "192.168.10.100/255.255.255.0", # IoT VLAN (dotted netmask)
        "10.0.0.100/8"                  # Management network
    ]
)

Supported Network Mask Formats

  • CIDR Notation: 192.168.1.100/24, 10.0.0.100/8, etc.
  • Dotted Decimal: 192.168.1.100/255.255.255.0, etc.
  • No mask: 192.168.1.100 (uses heuristic subnet matching)
  • Wildcard: 0.0.0.0 (listens on all interfaces, no subnet matching)

Advanced Features

Device Discovery and Control

async def discover_and_control():
    controller = GoveeController(
        listening_addresses=["192.168.1.100/24", "192.168.10.100/24"]
    )

    # Scan for devices across all networks
    devices = await controller.scan_devices()

    # Filter devices by network
    main_lan_devices = [d for d in devices if d.ip.startswith("192.168.1.")]
    iot_vlan_devices = [d for d in devices if d.ip.startswith("192.168.10.")]

    # Control devices on specific networks
    for device in main_lan_devices:
        await device.turn_on()
        await device.set_brightness(50)

    for device in iot_vlan_devices:
        await device.turn_off()

Direct Device Control

# Control device by IP address (uses intelligent transport selection)
await controller.control_device("192.168.1.100", turn_on=True)
await controller.control_device("192.168.1.100", brightness=75)
await controller.control_device("192.168.1.100", color_rgb=(0, 255, 0))

Documentation

Use Cases

  • Home Networks: Simple single-interface setup
  • Small Office: Multi-interface with heuristic matching
  • Enterprise/VLAN: Network mask configuration for precise routing
  • IoT Deployments: Isolated network segments with dedicated interfaces
  • Multi-Building: Physically separated networks with same IP ranges

Metadata

Release files for govee-local-api 3.1.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 govee-local-api 3.1.0
File Size Uploaded
govee_local_api-3.1.0.tar.gz 26.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for govee-local-api 3.1.0
File Interpreter ABI Platform
govee_local_api-3.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 55.3 kB

Release files / govee_local_api-3.1.0.tar.gz

Download URL govee_local_api-3.1.0.tar.gz
Size 26.9 kB
Tags Source
SHA-256 checksum
How to use checksums
89e4feaebd653ed44f1718372565dcda6a4d273de541301c871c2b516ead8279
BLAKE2b-256 checksum
How to use checksums
df7e19ef96d81a1779cfc45eaa2ca971a47feb6199e8d27fa40e6d2d7ef300db
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 8, 2026.

Transparency log

Release files / govee_local_api-3.1.0-py3-none-any.whl

Download URL govee_local_api-3.1.0-py3-none-any.whl
Size 28.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6507f6bdd54311852e0d83df23c4cf9feadd799c487310f7748611a5d3459f9c
BLAKE2b-256 checksum
How to use checksums
dee65a032a59e780e7416359039bc87f520a7e5dc3b29935c27c76387a137f6b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 8, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

3.1.0 This release

2 release files

3.0.1

2 release files

3.0.0

2 release files

2.4.0

2 release files

2.3.0

2 release files

2.2.0

2 release files

2.1.0

2 release files

2.0.1

2 release files

2.0.0

2 release files

1.5.3

2 release files

1.5.2

2 release files

1.5.1

2 release files

1.5.0

2 release files

1.4.5

2 release files

1.4.4

2 release files

1.4.3

2 release files

1.4.1

2 release files

1.4.0

2 release files

1.3.3

2 release files

1.3.2

2 release files

1.3.1

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.0

2 release files

0.0.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