A lightweight web app to help you keep the lights of your friendships on. Also integrates with your physical lights via Philips Hue lights. More details and write-up coming soon.
To run:
- PHP 5.6+
- MySQL 5.1+
To develop UI:
- node.js
To integrate with your physical lights:
- Philips Hue bridge and lightbulb
- Clone codebase on to PHP and MySQL enabled-server
- Configure your app:
- Update
./api/application/config/database.php
with database credentials - Update
./api/application/config/config.php
with yourbase_url
, e.g.http://localhost/api/
- To setup database, in browser go to
http://localhost/api/migrate
- Visit
http://localhost/
, register a new user, add relationships and meetings
-
Follow the steps to obtain your bridge's IP address and generate/obtain your username
-
Create a file at
./js/config.js
based on ./js/config.sample.js -
Fill in your
hueEndpoint
andhueUsername
based on step 1 -
Create a new entry in your config called
lights
that look like this:var PROJECT_CONFIG = { ... lightLevelRange: [0, 9], lights: [ {value: 'bedroom', label: 'Bedroom', hueLightId: '1', image: 'img/lights/bedroom/light{level}.jpg'}, {value: 'corridor', label: 'Corridor', hueLightId: '2', image: 'img/lights/corridor/light{level}.jpg'}, {value: 'dining', label: 'Dining', hueLightId: '3', image: 'img/lights/dining/light{level}.jpg'}, {value: 'kitchen', label: 'Kitchen', hueLightId: '4', image: 'img/lights/kitchen/light{level}.jpg'}, ... ], ... }
-
Update the list of lights that correlate to the lights in your home; you can customize the labels and images
- In this example, there are 10 images (named light0.jpg, light1.jpg, ..., light9.jpg) associated with the different states of each of the lights (bedroom, corridor, dining, kitchen, etc)
-
In the app
http://localhost/
, update your relationships with the appropriate lights that you defined in the previous step -
Now your physical lights should reflect the state of the virtual lights in the app
- Install node modules
npm install
- Install gulp (if necessary)
npm install --global gulp-cli
- Run
gulp
- Changes to .js, .scss, and .ejs files will be watched and compiled