Open source firmware with native HomeKit support, and OTA upgrades for:
- TreatLife DS01C touch dimmer switch
- TreatLife DS02S dimmer switch
- TreatLife DS02 three-way dimmer switch
- TreatLife DS03 dimmer and fan control
- Setup esptool
- Acquire a USB to Serial adapter (I used this one)
- Solder the 3.3v (VCC), GND, TXD, and RXD onto the chip:
- Connect GPIO0 to ground when applying power to the chip to enter flash mode
- I did this by soldering a wire to the back of the USB to serial adapter's GND pin, and then touching it to GPIO0 when plugging in USB adapter
- Run esptool (where
/dev/tty.usbserial-XXXX
is your USB to serial adapter, andDS02S.bin
is the desired firmware image):
esptool.py -p /dev/tty.usbserial-XXXX -b 115200 write_flash -e 0x0 DS02S.bin
- Reboot device by unplugging USB power, and then plugging it back in
- When device boots, it will enter config mode
- Connect to WiFi access point the device exposes (ESP-XXXXXX) where XXXXXX is the last 6 bytes of the devices MAC address
- Configure your WiFi SSID/password
- Go to the home app on your iPhone/iPad and press the "+" button and select "Add Accessory"
- Press "I Don't Have a Code or Cannot Scan"
- Your device should appear on this screen, select it, and enter the setup code "030-52-021" (or use QR code above)
- Device should pair
- To enter config mode to change your SSID, or update the firmware, press and hold the light on/off button for at least five seconds, then browse to the IP address of the device. To get the IP, you can look at your ARP cache for the MAC address which matches the devices serial number.
- If upgrading from tasmota, you'll need to use the gzip'd binary in the release
- This firmware is built to utilize the ESP8266EX chip in the SmartLife devices
which has 2mb of flash
- If upgrading from an older version, DO NOT use the gzip'd binary, the full bin should work
# To build a specific device, cd into its dir, then:
# In any of the device directories (DS01C, DS02S, DS03, etc...)
make requirements
make compile
# Resulting binary will be DSXXX.bin; use esptool, "make upload", or Arduino to flash
# To build all at once from top level directory (resulting bins will be in 'release' dir):
make
Use the following settings, and install the required dependencies:
- Arduino-HomeKit-ESP8266 by Mixiaoxiao
- WiFi Manager by tzapu
- Provides easy config, and OTA updates
- Adapted Tuya MCU driver code from Tasmota