This project mimics the Elgato Key Light API on an ESP32.
Elgato's Key Lights are great, this project isn't a real replacement for them. I noticed there is no security for it's REST API, so I figured I'd hack up a clone with an ESP32.
- Just like the original there really is no security for this device. It's discoverable via mDNS, so anyone on your network can turn your light on/off.
- No temperature control, I'm using single color LED strips
- LED Strip Lights
- ESP32 Dev Board
- MOSFET Driver - To isolate the LED Strip's power
- 12V 5A Power Supply
- ESP32 pin
GPIO23to MOSFET DriverTRIG/PWM - ESP32
GRDand MOSFET DriverGRDto Ground... - LED Strip to MOSFET Driver
OUT+andOUT- - Power Supply to MOSFET Driver
VIN+andVIN- - Connect the ESP32's USB port to your computer to upload the firmware
TODO add image of wire connections
- PlatformIO
For macOS
brew install platformio
To compile the code, clone this repo:
git clone https://github.com/bdemers/esp32-fake-light.git
cd esp32-fake-lightThen build it with PlatformIO
pio runUpload the firmware via USB:
pio run --target upload --upload-port /dev/cu.usbserial-0001Or upload over the air:
NOTE: Uncomment the
upload_flagssection inplatformio.iniand then run:
OTA_PASS=<your-pass> pio run -t upload --upload-port <device-ip-address>After uploading the firmware you MUST set your WiFi SSID and passphrase, run:
pio device monitor
# then run
wifi -ssid <your-ssid> -pass <your-pass>'
# additionally you should probably set:
hostname <your-hostname>
# set a unique mdns service name
mdns -service_name <your-service-name> -device_id <3C:6A:9D:13:C1:BD>
# enable Over The Air password updates
ota -pass <a-password>This will restart your ESP32 and connect to your Wifi. Assuming all goes well, you should see "Fake Light" listed in the Elgato Control Center Application.
-
light-on [-on <1>]
Enables or disables light
-
light-temperature [-temp <1>]
Not Implemented
-
light-brightness [-brightness <1>]
Sets light brightness as a percentage 0-100
-
mdns [-service_name <Elgato Key Light Air 1337>] [-device_id <3C:6A:9D:13:C1:BD>]
Sets the mDNS service name and device id, and restarts device
-
wifi -ssid -pass
Sets WiFi SSID and Password
-
reboot
Reboots device
-
echo -message
Prints message back to terminal
-
hostname -hostname
Updates device hostname and restarts
-
status
Prints basic device status
-
ota [-port <3232>] -pass
Sets the OTA firmware update port and password, then restarts
-
help
Prints this help message
-
/elgato/accessory-info"-GET|PUTPUTexample:echo '{"displayName": "<your-nam>"}' | http PUT <device-ip>:9123
-
/elgato/lights/settings"-GET -
/elgato/lights-GET|PUT# light on, brightness 100% echo '{"lights":[{"brightness":100,"on":1}]}' | http PUT <device-ip>:9123
