Skip to main content

Python Hue V2

Python library to control the Philips Hue lighting system for Hue-V2 API.

Features

  • Design for Hue API 2.0

High Level Control

Simple Example

import time
from python_hue_v2 import Hue, BridgeFinder

finder = BridgeFinder()
time.sleep(1)  # wait for search
# Get server by mdns
host_name = finder.get_bridge_server_lists()[0]  # Here we use first Hue Bridge

# or hue = Hue('ip address','app-key')
hue = Hue(host_name, 'hue app key')  # create Hue instance

lights = hue.lights

for light in lights:
    print(light.on)
    light.on = True
    light.brightness = 80.0

Scenes

You can get scenes from hue bridge.

from python_hue_v2 import Hue

hue = Hue('bridge-ip', 'app-key')

scenes = hue.scenes
for scene in scenes:
    print(scene.id)
    print(scene.data_dict)

Recall scene using active, dynamic_palette, static.

scene = scenes[0]
scene.recall(action='active')

Grouped Light

Get Lights from hue.

from python_hue_v2 import Hue

hue = Hue('bridge-ip', 'app-key')
grouped_lights = hue.grouped_lights

for group in grouped_lights:
    print(group.type)

Low Level Control

Also, you can use basic function in bridge class.

import time
from python_hue_v2 import Hue

# or hue = Hue('ip address','app-key')
hue = Hue('host_name', 'hue app key')  # create Hue instance
bridge = hue.bridge

bridge.get_lights()
bridge.set_light('id', light_property_name='on', property_value={'on': True})

bridge.get_zones()

Attention

Some API may be de deprecated When major version updates.

TODO

  • Zones Control Class

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

python_hue_v2-1.0.0.tar.gz (13.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

python_hue_v2-1.0.0-py3-none-any.whl (13.9 kB view details)

Uploaded Python 3

File details

Details for the file python_hue_v2-1.0.0.tar.gz.

File metadata

  • Download URL: python_hue_v2-1.0.0.tar.gz
  • Upload date:
  • Size: 13.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.17

File hashes

Hashes for python_hue_v2-1.0.0.tar.gz
Algorithm Hash digest
SHA256 27784a512cc21c17821273a5ec89d41a50261c33d5ae576f4c906cea42b44218
MD5 191c5a5ca0f8ba2b04b339c0ad10ba2e
BLAKE2b-256 752fc38fa9fea6a9d6385126335bbf23298ee1c36747b7c227a92a41a3e86726

See more details on using hashes here.

File details

Details for the file python_hue_v2-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: python_hue_v2-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 13.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.17

File hashes

Hashes for python_hue_v2-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fff0cf3c33aacacd49e8d62efeabfc31894f483566949caabbb54eb2096c5fec
MD5 de2627e03766c9746405b07179f5d6e0
BLAKE2b-256 d114652425d320f1479c692cd159dbfc3fadcf3d834d8985b1808d38a152e1ce

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page