Skip to content

npaun/philble

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

philble

Python 3 library to control Philips Hue lights over Bluetooth Low Energy (BLE). Uses the Adafruit_BluefruitLE library to issue Bluetooth commands.

Demo of philble controlling lights

API

See philble/client.py for commands available and mapping on to the BLE interface.

import philble.client
client = philble.client.Client(device)
  • power(False | True)
  • brightness(1..254)
  • temperature(153...454): Color temperature decreases as index increases, for some reason.
  • color(hex string)

lightcom

A small demo, providing an IPython REPL for controlling light fixtures. Modify config.py to provide names for your lights. The light client objects are available in a global variable called l.

Example lightcom session

TODO:

  • Figure out which sleeps are due to BLE library oddness and which are due to my sloppy implementation.
  • Read current values for these parameters.
  • Fully understand color code.
  • Provide HSL input for colors - probably easier to reason about for lighting.
  • Save state after lamp power-cycle.
  • Create demo to activate lamps relative to sunrise/sunset.

Resources consulted

About

Philips Hue Bluetooth Low Energy (BLE) light client library in Python

Topics

Resources

License

Stars

Watchers

Forks

Contributors 3

  •  
  •  
  •