Service to control Hue Bluetooth lights using the HueBLE library (big thanks to the author!) through a UNIX socket.
Its main purpose is to pair it with HueyUI, so lights can be controlled through a webinterface.
Turn on all the lights you want to connect to and run the discover.py script. This will create the address-list.txt file from which the server.py script will read which lights to connect to when it starts.
Run the server.py script to start the service. It will open a UNIX socket at ./var/huey.sock, which you can write commands to and read results from.
Returns a JSON string containing data about the state of all known lights.
It's an array containing an item for each light, that's structured like this:
{
"address",
"name",
"is_in_temperature_mode",
"is_available",
"is_powered_on",
"brightness",
"temperature",
"min_temperature",
"max_temperature",
"color": {
"x",
"y"
}
}
Polls the light associated with [address] for data about its current state.
Returns data about the light's state in a JSON string (same as list, but for a single light).
Turns the light on (power_state=true) or off (power_state=false)
Sets the brightness level. Valid range for brightness_level: 0-255
Sets the light's color temperature. Range is min_temperature-max_temperature for each light.
Sets the light's color using XY color coordinates (X and Y range is 0.0-1.0)
Explicitly connects to the light.
Sets the name of the light.
Allows you to send commands to the service from the terminal as they are described above.
Gets the light's state data from the service.
If Huey is having trouble connecting to your lights, you might need to reset them first.
I was able to do this by powering them on (8 sec) and off (2 sec) a couple of times in a row, until they start blinking, indicating that they have been reset.
I don't know if this is the recommended way of resetting lights or if this works for all Hue lights. So use this method at your own risk!
I made this (mostly) as a learning exercise. It works well enough for my purposes, but YMMV.
The docs here are hastily written and might contain errors.
It's likely this won't receive updates or bug fixes.