Milights-bridge is a remote control application for your Milight lights. The layout works well on both computers and mobile devices. It provides a GUI as well as an API for third-party applications.
- Remote control (on/off, colours, saturation, brightness, modes)
- Disco mode (making your Milight lights change colour following the rhythm of your songs) Note: due to my previous laptop being damaged, I have lost the code for the disco mode on the local Git of that laptop. It currently does not work in this version, but I will add it ASAP.
- Alarm mode (wake you up using the Milight lights)
- Mood mode (lights keep changing between two chosen colours)
- An extensive API, to be used by any other third-party application, such as the ha-bridge for making your Milight lights compatible with Google Home.
- More features will be added regularly.
It is recommended to run the milights-bridge application on a device similar to the Raspberry Pi. We are not affiliated, however, the Raspberry Pi is advantageous for its low consumption power while still having a CPU powerful enough to run this.
While milights-bridge isn't particularly unsecure, allowing internet traffic to it is not a good idea, since anybody would have control over your lights. Securing it with a password is not an option either, as that would make the API less accessible for 3rd party applications.
Use the application at your own risk. I am not responsible for anything that happens from using this application.
- NodeJS must be installed.
sudo apt-get update
sudo apt-get install nodejs
- NPM must be installed.
sudo apt-get update
sudo apt-get install npm
- Clone the Git repository.
sudo git clone https://github.com/KevinVR/milights-bridge.git
- Go into the milights-bridge directory.
cd milights-bridge
- Install required libraries
sudo npm install
- Copy the example configuration file.
sudo cp config.example.js config.js
- Edit the configuration, follow the instructions inside the file.
sudo vi config.js
orsudo nano config.js
- Now, it is possible to run milights-bridge
sudo node server.js
- Open your browser at
http://localhost:<port>
(the port is configurable in config.js, default is 3000).
- Install forever
sudo npm install -g forever
- Run milights-bridge using forever (inside milights-bridge folder)
sudo forever start server.js
- Stop milights-bridge (inside milights-bridge folder)
sudo forever stop server.js
- Get the latest update from Git (this will not modify your config file, however some updates might require config.js modifications, so take a look at the new config.example.js in case it does not run).
sudo git pull
- Start the updated milights-bridge (inside milights-bridge folder)
sudo forever start server.js
If any of the commands fail, try running them with sudo <cmd_here>
, as it might be a permissions problem. If this does not solve it, open a new issue.
The milights-bridge server returns some quite interesting debug data to the console, when run using sudo node server.js
. However, this output is not shown when using forever
or sudo node server.js &
.
Contributing is possible, contact me if you are interested, or have made some code yourself that might be interesting to include. Your name (and link) will then be added to the contributor's list on the about page of the application.
Do you like this project? If so please star this project on GitHub! Let other people find out about this application.
The milights-bridge application makes use of a few libraries and tools, listed below.
Javascript libraries
- Kelvin To RGB
- HSV To RGB
- Audio Recorder: RecorderJS (used for disco lights that react to music, the audio is in no way tracked).
- Audio Recorder 2 (same remark applies -- these have not yet been fully integrated into the project).
Templates
Please create an issue would it appear that a library was forgotten to be updated into this list.
Also note that this is a project that I've quickly set up in my free time. Due to time limitations, I have purposely chosen for a simple (less scalable) architecture.
© Kevin Van Ryckegem 2017. All Rights Reserved.
Software License: Creative Commons Non-Commercial ShareAlike 3.0 unported
For more information, visit: CC BY-NC-SA 3.0