Alexa-compatible light controller for ESP8266 and ESP32. Developed on Wemos D1 Mini, but it should work for any other ESP8266/ESP32 device.
Dependencies listed at top of sketch.
-
Build the sketch and install it on the device.
-
Follow the WiFiManager setup by connecting to its captive wifi portal and entering your SSID/password.
-
Optional: find the IP address the device is connected to, and try
curl http://<ip address>:52000/setup.xml. If you get back a bunch of XML, then it's probably working. -
Start up the Alexa app on a phone.
-
Go to add devices, then when it asks for brand names, select "Other" and then "Discover Devices."
-
The app should find your new device, named something like
Smart 12345. You can rename it in the app if you wish.
-
Adapt to different light controller types, such as P9813-based driver boards, APA102C, WS2812B, etc. At a minimum this will allow gradual fading in/out of the light rather than abrupt switching.
-
Switch to a smart-light protocol that allows colors and intensity control, but doesn't require a hub. The TP-Link protocol seems like a good candidate.
-
Using ESP32's Bluetooth Low Energy support, react to BLE buttons to enable control without connecting to the Alexa system.