GithubHelp home page GithubHelp logo

cassioiks / hue-ble-ctl Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mic92/hue-ble-ctl

0.0 0.0 0.0 7 KB

Control your Phillips Hue light bulb over bluetooth

License: MIT License

Nix 8.87% Python 91.13%

hue-ble-ctl's Introduction

hue-ble-ctl

Control your Phillips Hue light bulb over Bluetooth.

Features

(Just quickly hacked together in a few hours, more comes later)

  • toggle light
  • introspect GATT services and characteristics (for debugging)

Requirements

How to use

First connect to your hue light using blues bluetoothctl. In this example the device mac address is CD:43:95:FE:CE:D6

$ bluetootctl
[CHG] scan on 
[CHG] connect CD:43:95:FE:CE:D6

Then try to dump all bluetooth gatt attributes:

$ python huectl.py introspect cd:43:95:fe:ce:d6
connect to cd:43:95:fe:ce:d6...
found brightness characteristics
found light characteristics
service: 9da2ddf1-0000-44d0-909c-3f3d3cb34a7b
  characteristic: 9da2ddf1-0001-44d0-909c-3f3d3cb34a7b: None
service: b8843add-0000-4aa1-8794-c3f462030bda
  characteristic: b8843add-0004-4aa1-8794-c3f462030bda:
  characteristic: b8843add-0003-4aa1-8794-c3f462030bda: None
  characteristic: b8843add-0002-4aa1-8794-c3f462030bda: None
  characteristic: b8843add-0001-4aa1-8794-c3f462030bda: bytearray(b'\xff\xff\xff\xff\xff\xff\xff\xff\xff\x00')
service: 932c32bd-0000-47a2-835a-a8d455b859dd
  characteristic: 932c32bd-1005-47a2-835a-a8d455b859dd: bytearray(b'\x01\x01\x01\x02\x01\xfe')
  characteristic: 932c32bd-0007-47a2-835a-a8d455b859dd: bytearray(b'\x01\x01\x00\x02\x01\xfe')
  characteristic: 932c32bd-0006-47a2-835a-a8d455b859dd: None
  characteristic: 932c32bd-0003-47a2-835a-a8d455b859dd: bytearray(b'\xfe')
  characteristic: 932c32bd-0002-47a2-835a-a8d455b859dd:
  characteristic: 932c32bd-0001-47a2-835a-a8d455b859dd:
service: 0000fe0f-0000-1000-8000-00805f9b34fb
  characteristic: 97fe6561-a001-4f62-86e9-b71ee2da3d22: None
  characteristic: 97fe6561-2004-4f62-86e9-b71ee2da3d22: None
  characteristic: 97fe6561-2002-4f62-86e9-b71ee2da3d22: None
  characteristic: 97fe6561-2001-4f62-86e9-b71ee2da3d22:
  characteristic: 97fe6561-1001-4f62-86e9-b71ee2da3d22:
  characteristic: 97fe6561-0008-4f62-86e9-b71ee2da3d22: None
  characteristic: 97fe6561-0004-4f62-86e9-b71ee2da3d22: None
  characteristic: 97fe6561-0003-4f62-86e9-b71ee2da3d22: Shannan's bedroom
  characteristic: 97fe6561-0001-4f62-86e9-b71ee2da3d22: bytearray(b'\x01\x82\xe2\x06\x01\x88\x17\x00')
service: 0000180a-0000-1000-8000-00805f9b34fb
  characteristic: 00002a28-0000-1000-8000-00805f9b34fb: 1.65.9_hB3217DF4
  characteristic: 00002a24-0000-1000-8000-00805f9b34fb: LWA001
  characteristic: 00002a29-0000-1000-8000-00805f9b34fb: Philips
service: 00001801-0000-1000-8000-00805f9b34fb
  characteristic: 00002b29-0000-1000-8000-00805f9b34fb:
  characteristic: 00002b2a-0000-1000-8000-00805f9b34fb: bytearray(b'a\x10;o5\xdc\xcd\xb0{$\xa1\xc6\xd8\x04\xb3\xb1')
  characteristic: 00002a05-0000-1000-8000-00805f9b34fb: None

If all attributes show None, you might need to use the Phillips Hue App to perform a firmware reset and reconnect first with your laptop instead of the app.

If everything works as show here you can toggle the light as the following:

$ python huectl.py toggle cd:43:95:fe:ce:d6

hue-ble-ctl's People

Contributors

mic92 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.