HueMix Link provides a convenient way to control Hue lights using a physical button. The ESP-based button, configured as an ESP-NOW device, sends data to a server running on another ESP. The server then communicates with a TCP server running on a Linux machine. The Linux machine hosts a website that allows you to configure buttons, servers, the Hue bridge, & more. The project includes various components, such as the ESP code, the TCP server, the website, & more.
To set up the HueMix Link project, follow these steps:
- Run the
tcp_server.py
script and thewebsite.py
on the Linux machine. Set-up service - Configure the hue bridge and assign ports according to your preferences.
- Connect the ESP-based button according to the provided PCB and wire connections. Schematics and PCB
- Connect the ESP-based server according to the provided PCB and wire connections.Schematics and PCB
- Flash the
esp_now_server.ino
sketch to the ESP NOW server andtcp_client_server.ino
sketch to the TCP server. - Flash the
esp_now_button.ino
sketch to the ESP-based button (esp8266 version does not include deep sleep). - Wait until blue led is flashing, connect to
HueMix Link - id
network with passwordHueMixLink
. Follow the steps at192.168.4.1
. - When you press the button it should be automaticaly added to the website to set-up the scenes.
Once the project is set up and configured, follow these steps to use HueMix Link:
- Access the website hosted on the Linux machine.
- Use the website's interface to configure buttons, servers, and the Hue bridge.
- Press the physical button connected to the ESP-based button to control the Hue lights. 💡
- Press the button once to go through the scenes. Hold to increase or decrease brightness and press once with light on to turn them off.
The HueMix Link website provides a user-friendly interface for configuring buttons, servers, and the Hue bridge. It allows you to:
- ⚙️ Add and manage buttons: Assign scenes to different buttons depending on the room and customize their behavior.
- 📡 Configure servers: Define the ESP server's name and delete servers that are no longer in use.
- 💡 Set up the Hue bridge: Specify the IP address and authentication credentials of the Hue bridge to control the lights.
The ESP server is responsible for receiving data from the ESP-NOW device and sending it to the TCP server. It consists of two ESP devices connected via UART communication. One ESP device receives the data, and the other ESP device sends the data to the TCP server.
The ESP server has three LED indicators:
- Blue LED: Indicates the Wi-Fi connection status.
- On: The device is connected to Wi-Fi.
- Blinking: The device is in Wi-Fi Manager mode.
- White LED: Indicates data reception via ESP-NOW.
- Red LED: Indicates successful transmission of the message to the TCP server.
When the blue LED is blinking, it means the ESP server is in Wi-Fi Manager mode. Follow these steps to connect to the device:
- Connect to the network named
HueMix Link - id
. - Use the password
HueMixLink
. - Access the website at
192.168.4.1
. - Enter the Wi-Fi credentials and TCP server IP and port on the website to configure the ESP server.
To reset the TCP data or Wi-Fi credentials, follow these steps:
- Locate the button under the ESP server device.
- Hold the button for 5 seconds to initiate the reset process.
To update all the servers that are running and let the buttons know which servers to connect to, follow these steps:
- Press the button under the ESP server device once.
- This action will update the servers that are currently running. This helps the button know which server to connect to in order to get a more reliable connection.
The ESP server also has a button that can be used to control the lights. The main button of the server functions as a normal button.
Note: It is recommended to press the button under the device once every time a new server is created to ensure the buttons are aware of the server's existence.
The ESP button is based on the ESP-NOW protocol and operates in deep sleep mode to optimize battery life. With a single main button, it provides convenient control over the Hue lights. Here are the key features and functionalities of the button:
The ESP-NOW button is designed to operate in deep sleep mode at all times. This feature helps to maximize battery life by minimizing power consumption during idle periods.
The main button on the ESP button serves various functions:
- First Click Interaction:
- If it's the first time the button is clicked and it's in proximity to a server, it automatically gets added to the entire system and the website.
- Single Click:
- It cycles through the scenes that can be configured on the website.
- If the button is clicked again after two seconds of the last click, it turns off the lights or it transitions to the first scene depending on the state of the lights.
- Holding the Button:
- Holding the button allows you to increase or decrease the brightness level of the lights.
- When you start holding for the first time it will always start decreasing the brightness and if you hold again it will increase the brightness.
The ESP button features LED indicators to provide feedback on the status of data transmission:
- Single Blink: The LED blinks once to indicate that the message was successfully sent to the server.
- Double Blink: If the LED blinks twice, it means the data was not successfully sent. Please ensure that the server is connected and within close proximity to the button.
Note: It is recommended to check the server connection and ensure they are not too far apart if you encounter issues with data transmission.
By utilizing the ESP button, you can conveniently control the Hue lights and enjoy extended battery life due to the efficient deep sleep mode.
To set up the Linux service for hosting the HueMix Link website and running the TCP server, follow these steps:
- Run
sudo nano /etc/systemd/system/huemixlinktcp.service
- Paste code provided at HueMix-Link TCP service.
- Change paths as necessary then save and close the file.
- Run
sudo systemctl enable huemixlinktcp
andsudo systemctl start huemixlinktcp
. - TCP server should be up and running. To check status run
sudo systemctl status huemixlinktcp
.
- Run
sudo nano /etc/systemd/system/huemixlinkwebsite.service
- Paste code provided at HueMix-Link Website service.
- Change paths as necessary then save and close the file.
- Run
sudo systemctl enable huemixlinkwebsite
andsudo systemctl start huemixlinkwebsite
. - Website server should be up and running. To check status run
sudo systemctl status huemixlinkwebsite
.
- This 3D model represents the physical design for the HueMix-Link button and server.
- Dimensions: 10cm x 5cm x 2cm
- Works with the provided PCB layout.
If you are interested in printing the PCB and reviewing the schematics, you can find the necessary files and resources below:
- PCB Image: View the image of the PCB designs.
- Schematics PDF: Access the detailed schematics in PDF format.
- KiCad Files: Download the KiCad project files for further exploration and customization.
- PCB Image: View the image of the PCB designs.
- Schematics PDF: Access the detailed schematics in PDF format.
- KiCad Files: Download the KiCad project files for further exploration and customization.