DIY HomeKit Ambient Light for Under 100 Yuan

The story goes like this: In September 2021, I saw a video by my friend @ElectricStar on Bilibili, sharing his experience with the Philips Hue Play ambient light. I was immediately captivated by the colorful effects that could sync with screen content and the HomeKit support. However, when I checked on JD.com, the nearly 2000 Yuan price tag completely deterred me.
DIY HomeKit Ambient Light for Under 100 Yuan
Screenshot from @ElectricStar’s video
I thought that was the end of it, but later, Big Ears TV also shared their experience using the Philips Hue Sync Box and Hue ambient light strip, reigniting my desire for this product.
DIY HomeKit Ambient Light for Under 100 Yuan
Screenshot from @BigEarsTV’s video
However, a set priced at 2000 Yuan was truly beyond my means. So I started to wonder if there was a cheaper solution that could achieve similar effects. Thus began a year-long process of experimentation.
DIY HomeKit Ambient Light for Under 100 Yuan
👆 Minority members are currently on a limited time offer for 314 Yuan
Requirements and Early Experimentation
Before we start the article, we need to introduce a concept: Bias lighting.
Bias lighting is a concept in video editing and home theater, referring to a weak light source located behind a screen or monitor to illuminate the wall behind it. The purpose of bias lighting is to reduce the perceived brightness of the monitor and lessen eye fatigue caused by the stark contrast between a bright monitor and a dark environment over long viewing periods.
It’s easy to understand that both the Philips Hue ambient light set and other lighting solutions behind monitors or TVs fall under the category of bias lighting. With this concept in mind, we can proceed further.

What are the requirements?

Before opening Taobao, the first step is to understand what my bias lighting needs are. For me, my main functional requirements are as follows:
  • Support for HomeKit, allowing easy operation through the Home app on iPhone, iPad, and Mac;
  • Support for Siri voice control;
  • Ability to achieve the same dynamic color effects as Hue Play;
  • Can serve as an ambient light behind the monitor for a better working environment at night;
  • Compact size to avoid multiple HDMI connections like the Philips Hue Sync Box, preferably wireless;
  • Price controlled under 100 Yuan.

Ready-made Product Solutions

Once I clarified my needs, I indeed found similar products on Taobao, although the price was slightly above my budget, but still much more affordable compared to the nearly 2000 Yuan Philips option.
After inquiring with the seller, they stated that this bias lighting solution could meet most of my needs, but HomeKit support was lacking. At the time, I thought this wasn’t a big issue; I could simply add a HomeKit-compatible smart plug at the power source of the light strip, which would solve this problem indirectly.
So, I spent 143 Yuan to purchase this “cheap ambient light strip.” Shortly after, I received a control box, a 2-meter light strip, a 5V 8A power supply, and a USB-A to USB-B data cable to connect to my computer, similar to the Hue Play set. I followed the tutorial to stick the light strip and connect it to the computer and control box, but when I powered it on, there was a problem: I mistakenly connected the monitor’s 24V power supply to the light strip, which directly caused the light strip to fail.
DIY HomeKit Ambient Light for Under 100 Yuan
Helpless, I spent more money to repurchase a 2-meter light strip. A few days later, after carefully checking everything was correct, I powered it on and set up the drivers and software on my Mac according to the tutorial, and finally succeeded in lighting it up, activating the dynamic color-changing effects that followed the screen content.
However, as someone who has been through this, I must tell you that it’s best not to choose these solutions from Taobao sellers in the future. Not only are the prices high, but their hardware and software are not developed by them; they simply take ideas from the open-source community to create their products, so they don’t understand the principles, and their after-sales service is very average (eventually, I even had to teach the seller how to set it up, and he could only reply with three ellipses). If possible, I suggest either going directly for Philips Hue or doing it yourself.

Integrating HomeKit

Next, I needed to find a way to integrate them into HomeKit.
Initially, I did consider adding a HomeKit plug directly, but that would be a compromise solution: it would protrude significantly from the power outlet and wouldn’t allow control over the light strip’s color and brightness, only a switch function, which didn’t seem elegant enough.
At this point, the powerful internet played a huge role. After some searching, I found that the software I was using to control the light strip, “Prismatik,” already had a HomeAssistant plugin developed for it. This way, I could connect the light strip to HomeAssistant and bridge it into HomeKit.
DIY HomeKit Ambient Light for Under 100 Yuan
The use of this plugin is also quite simple. After installing the plugin (you can add the home-assistant-prismatik plugin from the HACS store using a custom repository or install it manually), restart, and then add the following configuration to the configuration.yaml file in HomeAssistant:
light:
  - platform: prismatik
    host: Mac IP address
    name: "Light strip name"
After restarting again, the light strip was added to HomeAssistant. Although the plugin hasn’t been updated in over a year, the core functions were already in place, allowing me to adjust the light strip’s switch, color, color temperature, and brightness.

A Series of Existing Problems

The value of this solution lies in providing a quick fix for my pain points before I fully understood the relevant technical principles. However, aside from that, I have been enduring various issues it brings.
First, the collaboration between home-assistant-prismatik and the Prismatik software is very unstable; sometimes, the plugin cannot control the light strip, requiring a restart of the software on the computer, and there were even instances where the light strip inexplicably turned off, needing a restart of both the plugin and software to establish a connection.
Secondly, mobility is limited. Since the data controlling the light strip is connected via USB to the computer, and home-assistant-prismatik connects to the computer via the local network, when I need to go out or use the laptop alone, unplugging the Thunderbolt cable from the MacBook and dock would cause the plugin to lose communication with the light strip control box, leading HomeAssistant and the Home app to indicate that the device is “unresponsive”.
The most unbearable point for me is that the WCH serial chip in the light strip control box changes the port number upon reconnecting to the Mac. Since Prismatik requires reinitialization of the light strip when the connection device’s serial port number changes, I had to run through the light strip initialization setup every time I came home from work, as I needed to take my computer to work every day.
However, after resigning in May this year, I spent a long time in Hainan, so these light strip problems were temporarily shelved. Until the end of September, when I returned to Guangzhou and sorted out the HomeKit standing desk, I could finally tackle this issue.
Solution: Redesigning the Light Strip Control Module
To solve the above issues, I needed to understand how this system worked, so I took apart the hardware and conducted thorough research.
Upon opening the control box, I discovered that this was actually a DIY solution previously shared by someone on Reddit, which had been copied and sold by some Taobao sellers in China. Its core is an Arduino UNO development board running an open-source Ambilight firmware, while the light strip uses the well-known WS2812B. Through this external system combined with the Prismatik software on the computer, it achieved the dynamic color effects.
DIY HomeKit Ambient Light for Under 100 Yuan
Spoiler image: Comparison of Arduino UNO and subsequent modules’ sizes
Given this, where can we start to modify?
WS2812B light strip? The answer is no need. The WS2812B light strip itself is quite good, supporting 16 million colors, and only requires a single signal wire to connect the LEDs in a serial manner for data reception and decoding.
What about the power supply? The seller provided a 5V 8A power supply specification; can it be reduced? No. According to the WS2812B light strip’s datasheet, the driving current for a single WS2812B is 60mA, and to encircle my 32-inch screen, I need at least two meters of length, totaling 120 WS2812B LEDs. Thus, my minimum required current is 0.06 × 120 = 7.2A, otherwise, it won’t provide enough current to light up the strip.
So the only part left for modification is the control box.

Which Control Solution to Choose?

To allow the light strip to directly connect to Apple HomeKit and support switch, brightness, color temperature, and color adjustments, I decided to abandon the original Arduino UNO control box and customize a brand-new control solution for WS2812B that doesn’t require a computer to relay data and can support HomeKit.
Referring to the article by my派 author @EstrellaXD on “How the HomeKit Smart Standing Desk was Made,” I found that there are three commonly used open-source SDKs to choose from when starting from scratch to create a HomeKit module:
ESP Apple HomeKit SDK: This is a custom SDK based on HAP for Espressif’s ESP32 and ESP8266, with full functionality and many definable parameters, but requires a certain level of embedded development knowledge.
Arduino HomeKit ESP8266: This is code customized for the ESP8266 in Arduino by third-party developers. Compared to the official ESP SDK, Arduino is significantly easier to use, with many customizable features.
HomeKit Accessories Architect (HAA): This is also a third-party developed kit based on the ESP8266 chip. Compared to the above two solutions, HAA’s advantage is that it does not require coding; you can easily configure DIY HomeKit accessory types and functions through a JSON file, making it the friendliest and most convenient option.
After searching and considering, I found that unfortunately, there is currently no control solution for the dynamic color light strip that can directly connect to HomeKit. However, there was a silver lining; during my search, I discovered another open-source project: WLED.
The story began to change with the emergence of the WLED project.

About the WLED Project

WLED is an open-source project developed by German developer Christian Schwinne based on ESP8266 or ESP32, allowing WS2812B, WS2811, and other LED lights or strips to connect to internet control, providing a graphical interface, iOS and Android apps, and rich customization options.
The biggest highlight is that it natively supports integration with HomeAssistant. This means we can perform the WLED integration into HomeAssistant and bridge it to HomeKit without writing a single line of code.
DIY HomeKit Ambient Light for Under 100 Yuan
However, WLED’s surprises don’t stop there; it also supports synchronization with Philips Hue, Alexa voice control, and MQTT features. If you’re interested in tinkering with another open-source project, DiyHue, you can even map WLED as a Philips Hue Strip Plus light strip and use it in conjunction with Hue Sync (the official Philips dynamic color kit) — keep in mind that a 2-meter WS2812B light strip costs around 30 Yuan, while the same length Hue Strip Plus light strip sells for 729 Yuan.

Hyperion: A New Wireless Screen Capture Solution

Simply getting the LED light strip driver and HomeKit connection is only half of the solution; the final dynamic color part remains unresolved. However, the WLED project also mentioned another functionality: Hyperion.
Hyperion, like Prismatik, is an open-source bias lighting software solution, but it has many advantages over Prismatik. The following features are exactly what our project requires:
  • Low CPU load, even a Raspberry Pi can run it easily;
  • Supports a Chinese web interface for configuration and use;
  • Supports remote control.

Selecting Suitable Hardware and Connection Methods

With the support of software and hardware, the next step is to set up a testing environment to verify the feasibility of the solution.
First, we need to choose an ESP8266 development board or module. However, with so many hardware options based on ESP8266, how to choose? Don’t worry, let’s go back to the WLED project’s official page, scroll down, and you will find the “Compatible Hardware” page link, which details the types of LED strips and voltages that can connect, supported WLED control modules or development boards, and other hardware that may be needed.
Since the WS2812B light strip only requires one control signal to drive, theoretically, any control chip with an IO interface can suffice. To minimize the size, I discarded development boards like NodeMCU, ultimately choosing the ESP-01S. The ESP-01S is an IoT module based on ESP8266 developed by AiThinker, only half the size of a thumb, providing two IO interfaces, making it perfect for our needs.
However, it’s important to note that the WLED author advises against using ESP-01S as a WLED controller for three reasons:
  • Flashing firmware requires an external USB-to-serial chip or module;
  • ESP-01S operates at 3.3V, but USB power supply and LED strips use 5V;
  • The module’s storage space is only 1MB, which may not allow for wireless updates in the future.

However, considering that I already have a USB-to-serial module for flashing firmware and that if the firmware can run stably, there isn’t much need for updates. Additionally, the ESP-01S’s power supply can be resolved with an AMS1117-3.3 chip, so the author’s small drawbacks aren’t significant for me.
DIY HomeKit Ambient Light for Under 100 Yuan
The USB-to-serial module generally looks like this
As for the remaining power supply and light strip parts, I decided to continue using the original setup without any modifications. This way, I wouldn’t need to re-stick the WS2812B light strip behind the monitor or deal with the wires under the desk; I just needed to replace the original control box.
However, one difference is that the original Taobao solution used dual power supply, meaning the 5V8A power supply only powered the light strip, while the Arduino was powered via USB from the computer, simultaneously transmitting the screen capture data, with both power supplies grounded together. In the revised solution, I decided to eliminate the USB line, allowing the ESP-01S to wirelessly obtain screen capture data from Hyperion, and directly draw power from the light strip power supply, using the previously mentioned AMS1117-3.3 chip to resolve the power supply issue.

Building the System and Testing

After waiting for a while, all the necessary hardware has been delivered, and we can set up the circuit on a breadboard and conduct tests.
But before that, we need to flash the firmware onto the ESP-01S using the USB-to-serial module. The firmware can be downloaded from the WLED Release page; just select the “WLED_0.13.3_ESP01.bin” file.
Next, we install the Tasmotizer flashing program and the USB-to-serial module driver on the computer, then connect the USB-to-serial module and ESP-01S according to the circuit diagram and plug the module into the computer’s USB port:
DIY HomeKit Ambient Light for Under 100 Yuan
Note: Do not connect the 5V power supply directly to the serial module, as it will damage the ESP-01S. Some serial modules may not provide a 3.3V power supply, so you may need to connect an AMS1117-3.3 LDO module to reduce the voltage to 3.3V.
One important point to note is that in download mode, the ESP-01S’s IO0 must be pulled down, so an extra wire is needed to connect IO0 to ground; otherwise, the firmware cannot be flashed.
Finally, in Tasmotizer, select the corresponding serial port and import the appropriate firmware, then click the “Tasmotize!” button, and the firmware will automatically be flashed onto the ESP-01S.
DIY HomeKit Ambient Light for Under 100 Yuan
Once the firmware is flashed, connect the circuit according to the schematic diagram, power the system, and we can begin testing.
DIY HomeKit Ambient Light for Under 100 Yuan
Remember to prepare some 1KΩ resistors in advance
During the first power-up, HIA needs to set the WLED’s Wi-Fi connection. Connect to the WLED-AP Wi-Fi on your computer or phone, the password is wled1234, then enter your Wi-Fi SSID and password in the pop-up page, and click “Save” at the top to save.
Next, find the WLED’s IP address on the router, and input it into a browser to configure it. Here, we won’t make too many changes to other projects; just go straight to “Config > LED Preferences” to change the number of LEDs to 120 (generally, there are 60 LEDs per meter).
DIY HomeKit Ambient Light for Under 100 Yuan
Consider whether to turn off the brightness limit; I tested it with two meters without issues. If the current is too high, it may damage the ESP-01S.
Once the settings are saved, if there are no other errors, all 120 LEDs should be lit and can be controlled via the web interface.
The next step is to add the LED to HomeAssistant through automatic integration. Go to the “Configuration > Devices and Services” page in HomeAssistant, and it should prompt that a new WLED integration has been discovered; follow the prompts to add it to HomeAssistant.
DIY HomeKit Ambient Light for Under 100 Yuan
If it doesn’t auto-discover, you can click the “Add Integration” button in the lower right corner.
At this point, we can use HomeAssistant to control WLED. Additionally, you can view many control options and status parameters in HomeAssistant, which you can continue to explore if you’re interested; here, we’ll temporarily skip it and continue with our main task.
Now, we can bridge WLED into HomeKit through HASS Bridge. Click on the options button of the HASS Bridge card (if not present, you need to add a HASS Bridge integration in the lower right corner first), then set it up accordingly. However, since everyone’s bridging method is different, you can refer to the “Integrating into HomeKit” section of this article for introductions on “Domain,” “Include Mode,” and “Entities to Exclude” based on your needs. Once complete, click the three dots in the lower right corner of the card to reload the integration, and soon you will see that WLED has been successfully added to HomeKit in the Home app.
At this point, the system built on the new approach has successfully integrated WLED and HomeKit. The next step is to return to the Mac and set up Hyperion.
Go to the Hyperion GitHub Release page, download the latest version of Hyperion for Mac, install it, and grant it screen recording permissions, then you can click “Hyperion > Setting” in the menu bar to enter its web setup page.
DIY HomeKit Ambient Light for Under 100 Yuan
Windows users need to click “Show all 14 assets” below to see them.
First, we can click the wrench in the upper right corner to change the Hyperion settings page to Chinese. Then go to “LED Configuration > LED Hardware,” and select WLED as the controller type, allowing Hyperion to discover the device itself (or directly input the WLED’s IP address).
DIY HomeKit Ambient Light for Under 100 Yuan
Next, go to the LED layout settings page, set the corresponding LED layout according to the path of the light strip behind the monitor, and click save on the LED controller page.
DIY HomeKit Ambient Light for Under 100 Yuan
If there are no errors in the settings, you should now see that WLED has begun to display dynamic color effects.
At this point, all tests have successfully passed, achieving all the requirements we initially set.

Designing the PCB Module and Stability Testing

Although our tests have been successful, clearly, this “Spider Cave” system cannot be directly used behind the monitor. We need to design a suitable PCB board to house the entire circuit and EPS-01S module.
DIY HomeKit Ambient Light for Under 100 Yuan

Designing and Sampling PCB

I chose Jialichuang EDA for this. As a domestic EDA design software, we can directly submit the designed PCB to Jialichuang for production; you can sample two PCB projects for free each month (5 pieces per project), which is quite generous. Additionally, if you don’t want to solder SMT yourself, you can also let Jialichuang handle it.
After registering an account and creating a project, the first step is to draw the schematic. This part isn’t difficult; find or search for the corresponding components on the left, add them to the drawing area, and connect them according to the scheme that has been tested on the breadboard.
Once the schematic is done, save it, and then click “Design Schematic to PCB.” Since this project’s PCB isn’t very complex, a single-sided connection is sufficient.
After completing the design, click “Manufacture > One-click PCB / SMT” to place an order; the software will prompt you to perform a DRC check to verify if there are any issues with the circuit design. After passing the DRC check, we can go to Jialichuang for PCB sampling and wait for the board to be delivered to our home.
As a lazy person, I also didn’t have a reflow soldering platform, so I really didn’t want to solder SMT chips myself, so I let Jialichuang provide a one-stop service for this step. Although the 50 Yuan soldering fee is indeed a bit high, considering I have already taken advantage of so many boards from Jialichuang, I won’t complain too much.
DIY HomeKit Ambient Light for Under 100 Yuan

Soldering Direct Connectors

Once the board arrives, I still need to solder the ESP-01S module that has been flashed with the WLED firmware and the connectors for the power supply and WS2812B light strip on both sides. However, the connectors on both sides are somewhat large, so I simply soldered the wires directly onto the corresponding pads, which further reduced the overall module’s size.
DIY HomeKit Ambient Light for Under 100 Yuan

Stability Testing

The slimmed-down and more functional dynamic color control module has been completed, but I still don’t recommend installing it behind the monitor immediately. After all, the power supply’s power reaches 40W, and the current is as high as 8A, so I conducted a day’s stability test to see if any issues would arise after being lit for a long time.
In practice, I found that the AMS1117-3.3 was quite hot to the touch, with a temperature of around 50-60 degrees Celsius. On one hand, the ESP-01S module above blocked the heat dissipation, and on the other hand, the module’s small size didn’t allow for any heat dissipation facilities, relying solely on air for cooling. Fortunately, the AMS1117-3.3’s maximum operating temperature can reach 120 degrees Celsius, so I don’t need to worry about this issue.
Nevertheless, I still need to install it behind the monitor for an extended period to determine if this module can handle the task.

Calculating the Costs

If we don’t consider the expenses during the development process, the actual cost of this light strip (including shipping) is as follows:
Material Name
Price
ESP-01S Module
9.7
2 Meter WS2812B Light Strip
30
PCB Sampling
0
SMT Soldering
50
SMT Components
4
5V8A Power Supply
27
Total 120.7
Although it slightly exceeds the budget, it is clear that the main expenditure is on the SMT soldering at Jialichuang. If you choose to solder it yourself, you can save this cost. Overall, this setup doesn’t cost much, especially compared to the Philips Hue dynamic color set priced at over a thousand Yuan, which is considered “the lowest of the low” in terms of price.
However, compared to commercial products, this version of the WLED dynamic color control module still has many areas for improvement. But for a DIY product for personal use, it is already quite cheap, stable, and user-friendly.
DIY HomeKit Ambient Light for Under 100 Yuan
Using it as a regular light also enhances the ambiance.

Second Version Improvements

As mentioned above, I found that the connectors on both sides for wiring were too large, and soldering the wires directly led to significant protrusions, which still seemed somewhat inelegant. Therefore, less than a week after using the first version of the WLED dynamic color light control module, I started working on the second version of the PCB diagram.
Compared to the first version, the second version of the PCB significantly reduced the length on both sides of the module, with an overall length of only 3.4 centimeters, compressed to the limit length that can accommodate the ESP-01S.
Additionally, to enhance the heat dissipation capability of the AMS1117-3.3, the second version of the PCB added an exposed copper area beneath it, allowing it to transfer heat more effectively to the surrounding module, increasing contact area with the air.
Finally, this version of the PCB also includes interfaces for future firmware upgrades for the ESP-01S. In the future, if there is a major firmware update for WLED that cannot be performed wirelessly, these four interfaces can be used for easy upgrades: simply connect RXD and TXD to the corresponding lines of the USB-to-serial module, and short IO0 and GND.

DIY HomeKit Ambient Light for Under 100 Yuan

However, as of now, the first version of the WLED dynamic color module is still functioning well, so unless there is a need, I may not sample the second version of the PCB for now, leaving it for future upgrades or new needs to add new features, such as an HDMI input capture module similar to the Philips Hue Sync Box priced at 2399 Yuan.
By the way, this WLED dynamic color module can also serve as a general WS2812B light strip control module. Stick it with the light strip in the desired location, connect it to power, and bridge it to HomeKit via HomeAssistant, and you can achieve a color light strip device controlled by the Apple Home app at an extremely low cost.
HomeKit and HomeAssistant Automation
With the WLED light strip that doesn’t rely on computer communication, we can finally confidently connect it to HomeKit and HomeAssistant for automation operations.
Based on my own needs, most of the time, WLED serves as a constant bias light behind the monitor at night, so I set up a linkage with the work mode: when turned on, WLED will switch to around 4000K natural light, which helps me concentrate.
Additionally, during gaming mode, I can use HomeAssistant’s automation to set WLED to RGB rainbow mode, creating an internet cafe-like atmosphere.
DIY HomeKit Ambient Light for Under 100 Yuan
Some Drawbacks
If I were to point out some drawbacks of this new WLED dynamic color module, they mainly lie in the software aspect.
The biggest regret, in my opinion, is the inability to select ambient light mode or dynamic color mode directly in HomeKit. Unfortunately, I can’t change this issue; the root cause is that HomeKit does not support selecting lighting modes, so we can only hope Apple adds this feature in the future.
The second point is that when I want to end the dynamic color mode, I need to manually exit Hyperion on the computer. After exiting Hyperion, there is a high probability that the light strip will turn off completely instead of transferring control back to WLED. At this point, I need to manually go to the WLED web or app settings interface and click “Override once” to re-establish control over WLED, which is somewhat cumbersome. Moreover, this problem, like the previous one, currently has no better solution.
Postscript
This project initially stemmed from my dissatisfaction with the fragmented user experience of the original Prismatik dynamic color solution, but for a long time, I didn’t have a solution. It wasn’t until I followed my派 author @EstrellaXD to learn the DIY approach for the HomeKit standing desk that I conceived the idea of making significant changes.
Honestly, luck played a significant role here; I didn’t expect that so many DIY predecessors had created such excellent solutions — I was merely a transporter, solidifying these successfully run hardware into my module. Therefore, I truly need to thank the WLED developer Christian Schwinne and the Hyperion developers for selflessly open-sourcing their achievements online.
The WLED dynamic color driver module is the second HomeKit device I’ve successfully DIY-ed after the standing desk, relying on my research and data manuals. This process of exploring the unknown and achieving success reminded me of the night six years ago when I first encountered HomeKit and integrated YeeLight bulbs into it — at the moment of success, I realized how long it had been since I felt this happy.
DIY HomeKit Ambient Light for Under 100 Yuan
So, which product will be transformed into “Work with Apple Home” next? Stay tuned.
Related Links
WLED:
https://github.com/Aircoookie/WLED/releases
Hyperion:
https://github.com/hyperion-project/hyperion.ng
Tasmotizer:
https://github.com/tasmota/tasmotizer
Original link:
https://sspai.com/post/76707?utm_source=wechat&utm_medium=social
Author: Wan Tong
Editor: Bei Xiao

/ More Popular Articles /

DIY HomeKit Ambient Light for Under 100 Yuan

DIY HomeKit Ambient Light for Under 100 Yuan

DIY HomeKit Ambient Light for Under 100 Yuan

DIY HomeKit Ambient Light for Under 100 Yuan

Leave a Comment

Your email address will not be published. Required fields are marked *