Skip to content

DeveloperBlue/Electron-Bluetooth-Lamp-Controller

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Electron Bluetooth Lamp Controller

Demo Video

Electron Bluetooth Lamp Controller is a simple crossplatform desktop and web application for controlling bluetooth lightbulbs and other generic bluetooth devices.

You can download the latest release of the desktop application from releases or use the web application. To build it yourself, see the Build section.

*See the Devices section for compatible devices.

Device Pairing Color & Brightness Control Temperature Control Generic Bluetooth Control
Device Pairing Color and Brightness Control Temperature Control Generic Bluetooth Control

At the moment, the following features are implemented:

  • Device scanning and pairing
  • Color Control with elegant picker and presets
  • Brightness Control
  • Temperature Color Control (eg. the perceived "warmth" of the color of the bulb)
  • Developer Options (Interacting with your own custom bluetooth characteristics)

The Project

The goal was to build an Electron application (Windows, Mac, & Linux) that allowed me to control my bluetooth lamp in basic ways- (On/Off, Set RGB Color, Get RGB Color, etc.) with a nice UI. Originally, the bluetooth bulb could only be used through the product's android application. While the application was able to provide functionaity, it was pretty buggy, mistranslated, and not pleasant to use.

This project was create as both a hobby project and a small honors project for university.

Using what I learned in CS488 Computer Networks and the Internet, CS389 Software Engineering, and my own experience with Electron and development, I got to work. Originally, I tried to reverse-engineer the android application after decompiling it, but that proved to be obfuscated and burried under layers of files and library dependencies. There were also concerns that I wasn't quite sure what else this application was doing on my device, especially giving the abundance of extra libraries embed in the application.

Development involved using Wireshark, packet sniffing, learning various protocols and security standards (eg. Bluetooth), and a ton of other intricacies when developing for the web, Electron, using bluetooth, and implementing different types of color control. There were initial struggling with bluetooth sniffing, manufacturers changing log output directories, whacky functionality, and cross-developing between my Android device and workstation. Overall, it was a good learning experience and I'm happy to say I met my goals.

You can read more about it in my Project Writeup

Build

If you would rather not use the prebuilt executable from releases, you may build the project yourself.

To clone and run this repository you'll need Git and Node.js (which comes with npm) installed on your computer. From your command line:

# Clone this repository
git clone https://github.com/DeveloperBlue/Electron-Bluetooth-Lamp-Controller.git

# Navigate into the repository
cd Electron-Bluetooth-Lamp-Controller

# Install dependencies
npm install

# Start
npm start

Alternatively, you may run npm run-script dev-start rather than npm start to launch with the client-side developer console open.

Future Implementations

Future updates may include:

  • Synthesia (Color Reactions to Music)
  • Color Transitions (Slow, Fast, Rave, Breating, User-defined color transitions)
  • Voice Control
  • User-defined color presets
  • Individual RGB Control submenu
  • Web Socket Service
  • Timed events (CRON events for eg. turning on at 7pm)
  • IFTTT Integration (Google Assistant, Amazon's Alexa, Apple's Siri, Mirosoft's Cortana, etc.)
  • Device Groups (Control multiple devices at once, if your computer has Bluetooth 5 or the devices allow it)

Devices

There are no standards for bluetooth bulbs. Vendors define their own UUIDs, and thefore there is a slim chance that many devices will be compatible.

For developing this project, I used the "Bowlight" bulb. From what I can tell this company also makes other bulbs, and there is a good chance they may be compatible.

Original Android Application

Other devices can be supported, but need to be configured. (This means packet sniffing to figure out which services and characteristics are responsible for what processes, so only experienced users can try this)

If there's a demand, I'll crawl the web for other creations of this kind of project, and compile configs for different bulbs.

Thanks To

Special thanks to:

About

Control a Bluetooth LED lamp over an Electron application

Resources

Stars

Watchers

Forks

Packages

No packages published