This project enables you to control your Philips Hue lamps using traditional wall switches without cutting power to the bulbs. By integrating devices like Shelly relays, your switches send commands to a server, which then controls the lights via the Hue API.
- Preserve Smart Bulb Functionality: Keep your Hue lamps continuously powered to maintain smart features.
- Use Existing Switches: Operate your lights with traditional wall switches.
- Seamless Integration: Switches send requests to a server, which manages the lights without interrupting power.
Before setting up, ensure you have:
- Philips Hue Bridge: Manages your Hue lamps.
- Shelly Relay (or similar): Installed behind your wall switches to send HTTP requests.
- Docker: To run the server application.
Follow these steps to set up the system:
Download the project files to your local machine:
git clone https://github.com/olizimmermann/alwayshue.git
cd alwayshueCreate a .env file in the app directory with the following content:
apikey=YOUR_HUE_API_KEY
ip=YOUR_HUE_BRIDGE_IP
allowed_hosts=*apikey: Your Philips Hue Bridge API key.ip: The IP address of your Hue Bridge.allowed_hosts: Comma-separated list of IPs allowed to control the lights (use*to allow all).
Ensure Docker is installed on your system. Then, build and run the container:
docker-compose up --build -d- This command builds the Docker image and starts the server in detached mode.
Set up your Shelly relay to send HTTP GET requests to the server when the switch is toggled:
- URL:
http://SERVER_IP:8000/room_1(replaceSERVER_IPwith your server's IP address). - Method: GET
Repeat this configuration for each switch, adjusting the endpoint (/room_1, /room_2, etc.) as needed.
The application logs its activities to app.log within the container. To access the logs:
-
Enter the running container:
docker exec -it alwayshue_webserver_1 bash -
View the log file:
cat /app/app.log
The logging system uses rotation to prevent the log file from becoming too large, maintaining up to three backup files, each with a maximum size of 10 MB.
- Allowed Hosts: Restrict
allowed_hoststo specific IP addresses to enhance security. - API Key: Keep your Hue API key confidential.
- Connection Issues: Ensure the server can communicate with the Hue Bridge and that the Shelly relay can reach the server.
- Log Files: Check
app.logfor error messages and debugging information.
Contributions are welcome! Feel free to submit issues and pull requests to improve the project.
This project is licensed under the MIT License.
By following this guide, you can integrate your existing wall switches with Philips Hue lamps, maintaining smart functionality while using familiar controls.