Python module for controlling and monitoring Bluetooth Philips Hue bulbs
Project description
HueBLE
Python module for controlling Bluetooth Philips Hue lights.
- 👌 Free software: MIT license
- 🍝 Sauce: https://github.com/flip-dots/HueBLE
- 🖨️ Documentation: https://hueble.readthedocs.io/en/latest/
- 📦 PIP: https://pypi.org/project/HueBLE/
This Python module enables you to control Philips Hue Bluetooth lights directly from your computer, without the need for a Hue bridge or ZigBee dongle. It leverages the Bleak library to interact with Bluetooth Philips Hue lights.
Features
- 💡 On/Off control
- 🌗 Brightness control
- 🌡️ Colour temp control
- 🌈 XY colour control
- ❔ Light state (power/brightness/temp/colour)
- ⚙️ Light configuration (name)
- 📊 Light metadata (manufacturer/model/zigbee address)
- 🤜 Supports push & polling models
- 🔂 Simple structure
- 📜 Mediocre documentation
- ✔️ More emojis than strictly necessary
Requirements
- 🐍 Python 3.11+
- 📶 Bleak 0.19.0+
- 📶 bleak-retry-connector
Supported Operating Systems
- 🐧 Linux (BlueZ)
- Ubuntu Desktop
- Arch (HomeAssistant OS)
- 🏢 Windows
- Windows 10
- 💾 Mac OSX
- Maybe?
Documentation
https://hueble.readthedocs.io/en/latest/
Installation
PIP
pip install HueBLE
Manual
HueBLE consists of a single file (HueBLE.py) which you can simply put in the same directory as your program. If you are using manual installation make sure the dependencies are installed as well.
pip install bleak bleak-retry-connector
Examples
Quick start example
Example code from example.py
import asyncio
from bleak import BleakScanner
import HueBLE
async def main():
# Address of light to connect to
address = "F6:9B:48:A4:D2:D8"
# Obtain the BLEDevice from bleak
device = await BleakScanner.find_device_by_address(address)
# Initialize the light object
light = HueBLE.HueBleLight(device)
# Optionally we could call connect but it will be called automatically
# on the first request to the light. You might want to call this if
# you want to subscribe to state changes without changing the lights state.
# await light.connect()
# Will automatically connect to the light and turn it off
await light.set_power(False)
# Wait
await asyncio.sleep(5)
# Turn the light back on again
await light.set_power(True)
if __name__ == "__main__":
asyncio.run(main())
Demo program
A more fully featured demo program can be found in examples/demo.py which demonstrates all of the implemented features.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file hueble-2.2.0.tar.gz.
File metadata
- Download URL: hueble-2.2.0.tar.gz
- Upload date:
- Size: 22.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bdbfc9e2b9744fe0494e5542b41fa72e7c6b147bf65439b33e6ac40c385a6baa
|
|
| MD5 |
a4981a9ad742987036a0cda8bbfafffc
|
|
| BLAKE2b-256 |
90b0e1ff5dffd2309ee7a182f3d117bff6bcfccf7ec5259a5800d3744468837e
|
Provenance
The following attestation bundles were made for hueble-2.2.0.tar.gz:
Publisher:
publish-to-pypi.yml on flip-dots/HueBLE
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
hueble-2.2.0.tar.gz -
Subject digest:
bdbfc9e2b9744fe0494e5542b41fa72e7c6b147bf65439b33e6ac40c385a6baa - Sigstore transparency entry: 1165398364
- Sigstore integration time:
-
Permalink:
flip-dots/HueBLE@854347feb998e69d3f098b89526710670a07d1d8 -
Branch / Tag:
refs/tags/v2.2.0 - Owner: https://github.com/flip-dots
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@854347feb998e69d3f098b89526710670a07d1d8 -
Trigger Event:
push
-
Statement type:
File details
Details for the file hueble-2.2.0-py3-none-any.whl.
File metadata
- Download URL: hueble-2.2.0-py3-none-any.whl
- Upload date:
- Size: 15.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ef0bec6244cbc1a2622bf3700ebf60846919bf699b58689ea0fd825701d1a31b
|
|
| MD5 |
8a0345389541db88cc7c8aae4f068e7c
|
|
| BLAKE2b-256 |
d06ea7bcd06e6162c6ef15cc2c1a05712a66fc0b0c7846bf67591afdddd5776e
|
Provenance
The following attestation bundles were made for hueble-2.2.0-py3-none-any.whl:
Publisher:
publish-to-pypi.yml on flip-dots/HueBLE
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
hueble-2.2.0-py3-none-any.whl -
Subject digest:
ef0bec6244cbc1a2622bf3700ebf60846919bf699b58689ea0fd825701d1a31b - Sigstore transparency entry: 1165398426
- Sigstore integration time:
-
Permalink:
flip-dots/HueBLE@854347feb998e69d3f098b89526710670a07d1d8 -
Branch / Tag:
refs/tags/v2.2.0 - Owner: https://github.com/flip-dots
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@854347feb998e69d3f098b89526710670a07d1d8 -
Trigger Event:
push
-
Statement type: