You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

78 lines
4.1 KiB

  1. # ESPHome support for Xiaomi Mijia Bedside Lamp 2
  2. [ [Changelog](CHANGELOG.md) | [License](LICENSE.md) | [Code of conduct](CODE_OF_CONDUCT.md) ]
  3. The Bedside Lamp 2 is a smart RGBWW LED lamp, produced by Yeelight for the Xiaomi Mijia brand. It
  4. can be controlled via the WiFi network and from a touch panel on the front of the device. The touch
  5. panel contains a power button, a button that changes the color of the light and a slider that can be
  6. used to change the brightness of the light.
  7. This project provides custom components for ESPHome, which make it possible to fully control every
  8. aspect of the lamp and to integrate the lamp in your Home Assistant setup.
  9. ## Features
  10. * The lamp **integrates easily with Home Assistant** using the ESPHome integration.
  11. * **The lamp no longer phones home to the Mijia Cloud.** Using this firmware, you can rest assured
  12. that the network traffic is limited to your own network. This matches the ideas behind Home
  13. Assistant, of providing a local home automation platform, that puts privacy first.
  14. * **No more need for the LAN control option** to integrate the lamp with Home Assistant. Especially
  15. important, because Xiaomi decided in all their wisdom to remove LAN control from the device,
  16. breaking existing integrations.
  17. * **The night light supports multiple colors**. The original firmware only supports a single warm
  18. white night light color.
  19. * **Smooth light color transitions**, unlike the current version of the Yeelight integration. The
  20. Homekit integration does provide good transitions, but on my system, the color temperature white
  21. light mode is missing in the Home Assistant GUI.
  22. * **Since the components of the lamp are exposed as ESPHome components, you don't have to stick with
  23. the lamp's original behavior.** You can hook up the lamp in your home automation as you see fit.
  24. Use the slider to control the volume of your audio set? Long press the power button to put your
  25. house in night mode? Use the illumination behind the slider bar to represent the progress of your
  26. sour dough bread bulk fermentation? Go ahead, make it so! :-)
  27. * **All LEDs that are used for illumination of the front panel (power button, color button and
  28. 10 LEDs for the brightness slider) can be controlled individually.** This means that you have
  29. 12 LEDs in total to use as you see fit, instead of sticking with the behavior of the original
  30. firmware.
  31. * **Possibilities to extend the device's functionality through hardware mods.** There are [GPIO pins
  32. that are not in use](doc/technical_details.md#esp32-pinout). If "tinkerer" is your middle name,
  33. you can use those pins to come up with your own hardware hacks to extend the device's
  34. functionality.
  35. ## Quick start guide
  36. For those who have experience with flashing ESPHome onto devices:
  37. * Make sure you are using ESPHome 2021.10.0 or newer.
  38. * Copy [`example.yaml`](example.yaml) to `<CONFIG_DIR>/<NODE_NAME>.yaml`.
  39. * Modify the configuration to your needs (see the [configuration guide](doc/configuration.md)).
  40. * Compile the `firmware.bin` file and download it to the device to which you have connected your
  41. serial to USB adapter.
  42. * [Open up the lamp](doc/flashing.md#opening-the-lamp-to-expose-the-pcb) and connect its `TX`, `RX`,
  43. `GND` and `GPIO0` debug pads to the serial adapter. Check this [image for the debug pad
  44. locations](doc/images/09_debug_pads_for_soldering.jpg).
  45. * Power up the lamp with `GPIO0` connected to GND to enable flashing mode.
  46. * Flash `firmware.bin` onto the device, for example using
  47. [esphome-flasher](https://github.com/esphome/esphome-flasher)..
  48. ## Upgrading
  49. I always try to make it possible to upgrade the lamp firmware without having to do anything special.
  50. Sometimes, this is not possible. For those cases, the upgrade instruction can be found here:
  51. * [Upgrading to 2021.10.0](doc/upgrading_to_2021.10.0.md)
  52. ## Table of contents
  53. * [Why custom firmware?](doc/why_custom_firmware.md)
  54. * [Installation guide](doc/installation.md)
  55. * [Configuration guide](doc/configuration.md)
  56. * [Flashing guide](doc/flashing.md)
  57. * [Technical details](doc/technical_details.md)
  58. * [Sponsoring](doc/sponsoring.md)