walter5138 / hue_ble_bash

Project controlling Philips Hue Bluetooth Color bulbs. Bash version.
GNU General Public License v3.0
13 stars 1 forks source link
basch bluez cli dbus hue hue-api hue-app hue-bulbs hue-lamps hue-lights philips-hue philips-hue-api philips-hue-app python

hue_ble_bash

Project controlling Philips Hue Bluetooth color and white bulbs. Bash version.

Project controlling Philips Hue Bluetooth color and white bulbs using:

It is a learning project and there are many improvementes to make, But you can:

It demonstrates what the characteristics do. Aware of that you can use them in your own projects.

This project is in daily development. Therefore it is not granted to work for everybody.

If you are just interested in what the characteristics do watch the file hue_debug.

Following prerequisites are required:

  1. A running Linux system.

  2. Build Dbus with the send-variant-dict.patch.

    https://chromium-review.googlesource.com/changes/chromiumos%2Foverlays%2Fchromiumos-overlay~12323/revisions/2/files/sys-apps%2Fdbus%2Ffiles%2Fdbus-1.4.12-send-variant-dict.patch/download

    Please read: https://stackoverflow.com/questions/8846671/how-to-use-a-variant-dictionary-asv-in-dbus-send/38573254 . This patch is for the dbus-send utility to get the capability to send the data type dict:string:variant a{sv} . Dbus understands a{sv} but dbus-send can't send it out of the box, therefore the patch.

  3. Dbus running with system bus

  4. The Linux bluetooth-stack Bluez build with Dbus

  5. 3 Philips Hue Bluetooth color and white light bulbs ( LCA001 ) If you have more or less than 3 Bulbs you have to alter some scripts at the moment. See TODO.

Get it working:

Once the prerequisites are in place you need to:

Use bluetoothctl to pair and connect the bulbs:

Set the Bulb addresses in hue_settings:

Have fun controlling the bulbs: ./hue_...

Debug

Use -d or --debug parameter to the scripts to see values of all known characteristics when the script finishes.

Tuning

Append to /var/lib/bluetooth/"adapter_id"/"hue_bulb_id"/info :

[ConnectionParameters]

MinInterval=6

MaxInterval=7

Latency=0

Timeout=216

Reduces the response time for the dbus-send commands.

Todo

Questions:

Objectives: