Control your smart home lights with JavaScript and Philips Hue.
This project allows you to control your smart home lights using JavaScript and the Philips Hue API. You can toggle lights on and off, get a list of available lights, and more.
- Toggle smart home lights on and off.
- Get a list of available lights.
- Control lights with a simple JavaScript API.
- Organized using the Model-View-Controller (MVC) pattern.
Follow these instructions to get your project up and running.
Before you begin, ensure you have met the following requirements:
- Node.js installed.
- Philips Hue Bridge and lights set up in your smart home.
-
Clone the repository:
git clone https://github.com/97Fakhreddine/Controlling-Smart-Home-Lights-with-JavaScript.git
Before running the application, make sure you have Node.js and npm (Node Package Manager) installed on your machine.
git clone https://github.com/97Fakhreddine/Controlling-Smart-Home-Lights-with-JavaScript.git
- Make sure your Philips Hue Bridge is connected and configured.
- Start the Express.js server:
npm start
- You can now use the provided API to control your smart home lights.
GET /api/lights:
Get a list of available lights.POST /api/lights/toggle:
Toggle a specific light on or off. Send a JSON object with lightId and on (true/false) in the request body.
Contributions are welcome! Please read the Contributing Guidelines for more information.
This project is licensed under the MIT License - see the LICENSE file for details.