Skip to main content

AIOHUESYNCBOX

Asyncio package to communicate with Philips Hue Play HDMI Sync Box. This package is aimed at basic control of the box. Initial setup and configuration is assumed to done with the official Hue app.

Installation

    python3 -m pip install aiohuesyncbox

Usage

Instantiate the HueSyncBox class and access the API.

For more details on the API see the official API documentation on https://developers.meethue.com

Note on changing bridge

Changing a bridge is a bit more involved than other calls. After calling box.hue.set_bridge() the syncbox will start switching which takes a while (seems to take about 15 seconds). You will have to wait until the attributes match the expected endstate, but the status displayed on the API can be a bit confusing during the process.

These are the status changes I see when switching from bridge A to bridge B.

  • ID: Bridge A, IP: Bridge A, Status: connected
  • Call box.hue.set_bridge() with info for bridge B
  • ID: Bridge B, IP: Bridge A, Status: connecting
  • ID: Bridge B, IP: Bridge B, Status: disconnected
  • ID: Bridge B, IP: Bridge B, Status: connected or ID: Bridge B, IP: Bridge B, Status: invalidgroup

Examples

The examples below are available as a runnable script in the repository. There is also an example on using zeroconf for device discovery.

Registration

    from aiohuesyncbox import HueSyncBox, InvalidState

    # host and id can be obtained through mDNS/zeroconf discovery
    # (or for testing look them up in the official Hue app)
    # The ID is the number that looks like C43212345678
    box = HueSyncBox(host, id)

    print("Press the button on the box for a few seconds until the light blinks green.")

    registration_info = None
    while not registration_info:
        try:
            registration_info = await box.register("Your application", "Your device")
        except InvalidState:
            # Indicates the button was not pressed
            pass
        await asyncio.sleep(1)

    # Save registration_info somewhere and use the 'access_token' when instantiating HueSyncBox next time
    print(registration_info)

    # Unregister by registration ID.
    # HueSyncBox needs to use the associated `access_token` to execute this request.
    await box.unregister(registration_info['registration_id'])

Basic usage

    from aiohuesyncbox import HueSyncBox

    # host and id can be obtained through mDNS/zeroconf discovery
    # (or for testing look them up in the official Hue app)
    box = HueSyncBox(host, id, access_token_from_registration_info)

    # Call initialize before interacting with the box
    await box.initialize()
    print(box.device.name)
    print(box.execution.sync_active)
    print(box.execution.mode)

    # Turn the box on, start syncing with video mode on input 4
    await box.execution.set_state(sync_active=True, mode="video", hdmi_source="input4")

    # Call refresh() to update with latest status from the box
    await box.execution.refresh()
    print(box.execution.sync_active)
    print(box.execution.mode)

Metadata

Release files for aiohuesyncbox 0.1.1

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

Source distribution (sdist)

Source distribution for aiohuesyncbox 0.1.1
File Size Uploaded
aiohuesyncbox-0.1.1.tar.gz 25.1 kB Details

Built distribution (wheel)

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

Total release size: 53.3 kB

Release files / aiohuesyncbox-0.1.1.tar.gz

Download URL aiohuesyncbox-0.1.1.tar.gz
Size 25.1 kB
Tags Source
SHA-256 checksum
How to use checksums
03f3f9170d9af0e415a46fb5b2dbdd6c7d7777429933db93d2517a8e444b3025
BLAKE2b-256 checksum
How to use checksums
f52508de854cb18b54451ba3b03e308be1ce2e131ea2664070109ef462323a6a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release files / aiohuesyncbox-0.1.1-py3-none-any.whl

Download URL aiohuesyncbox-0.1.1-py3-none-any.whl
Size 28.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3a6f72b2b99271182535316c5aa1dda2f924d578b30cb484f77bc661eef638d0
BLAKE2b-256 checksum
How to use checksums
3e304c2bad9b8df01e27781ba16db2b436fc5ee730ad5ee59c1fca6a7e4190b8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release history Release notifications | RSS feed

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

This release

0.1.1 This release

2 release files

0.1.0

2 release files

0.0.31

2 release files

0.0.27

2 release files

0.0.26

2 release files

0.0.25

2 release files

0.0.22

2 release files

0.0.21

2 release files

0.0.20

2 release files

0.0.19

2 release files

0.0.18

2 release files

0.0.16

2 release files

0.0.15

2 release files

0.0.14

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