Glen Akins has redecorated his backyard with low-cost off-the-shelf RGB LED patio lights — cleverly reverse-engineered and upgraded for compatibility with WLED and, optionally, TinyTuya.
“Two years in the past, I hung a set of generic G50 RGB globe lights within the yard. They weren’t precisely waterproof and the person lights grew to become waterlogged and began performing erratically,” Akins writes by means of background to the undertaking. “This yr, I changed them with two units of XMCOSY+ RGBW Patio String Lights. The brand new XMCOSY lights look nice and I like that there is actual white LEDs in them to allow them to present each ornament and practical illumination for my yard.”
If you happen to’ve received any XCOMSY string lights in your backyard, Glen Akins has accomplished the onerous work of WLED and TinyTuya integration for you. (📷: Glen Akins)
The lights are designed to be managed from the Tuya Good Life smartphone app, being primarily based on a Tuya microcontroller board. “I feel the app is ample for most individuals’s wants,” Akins says. “I intend to make use of the Good Life app more often than not with these lights however was excited by having the ability to management them from crontab and a Python script.”
Whereas Tuya gives an utility programming interface (API) for this, Akins determined to assault the issue a special approach: reverse-engineering the management indicators, discovering — with a fast take a look at the oscilloscope traces — that the lights used the WS2811 protocol at 800kHz with 5V signalling.
With that info in hand, Akins was capable of management the lights from an Athom Tech WLED controller — offering help for Christian Schwinne’s fashionable lighting management system on an Espressif ESP32 microcontroller, with Athom’s specific board including infrared and radio-frequency distant compatibility.
Then, Akins switched to one thing he hadn’t tried earlier than: the TinyTuya Python library, which might use Tuya’s official Web of Issues (IoT) cloud service to generate the keys required to subject instructions completely domestically. “The fundamentals labored nicely sufficient,” Akins writes of the library, “however what I actually wished to do was set the colours of all of the bulbs individually.
Akins found out the management protocol with an oscilloscope, whereas packet captures revealed deeper management with TinyTuya. (📷: Glen Akins)
By sniffing the site visitors between the official telephone app and the lights, Akins was ready to determine a approach to format the messages for per-light management. “Every colour is specified with a tuple containing the six parameters [required],” Akins writes of the ensuing Python script. “The colours might be repeated if there’s extra lights on the string than colours specified within the dictionary.”
This is not Akins’ first shot at determining easy methods to get extra flexibility from off-the-shelf RGB LED lighting: in November final yr he revealed a submit documenting experimentation with “a number of units of random LED lights from third-party sellers on Amazon,” all of which resulted in at the least partial WLED compatibility.
Akins’ full write-up is out there on his weblog, together with the supply code for the per-light Python management script.