Skip to content

97Fakhreddine/Controlling-Smart-Home-Lights-with-JavaScript

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Controlling Smart Home Lights with JavaScript

GitHub GitHub last commit GitHub repo size

Control your smart home lights with JavaScript and Philips Hue.

Table of Contents

About

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.

Features

  • 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.

Getting Started

Follow these instructions to get your project up and running.

Prerequisites

Before you begin, ensure you have met the following requirements:

  • Node.js installed.
  • Philips Hue Bridge and lights set up in your smart home.

Installation

  1. Clone the repository:

    git clone https://github.com/97Fakhreddine/Controlling-Smart-Home-Lights-with-JavaScript.git
    

Install the dependencies

Before running the application, make sure you have Node.js and npm (Node Package Manager) installed on your machine.

Navigate to the project folder:

git clone https://github.com/97Fakhreddine/Controlling-Smart-Home-Lights-with-JavaScript.git

Usage

  1. Make sure your Philips Hue Bridge is connected and configured.
  2. Start the Express.js server:
    npm start
  1. You can now use the provided API to control your smart home lights.

API

  • 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.

Contributing

Contributions are welcome! Please read the Contributing Guidelines for more information.

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published