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.

83 lines
2.3 KiB

3 years ago
  1. # esphome-yeelight_bs2
  2. ## Installation
  3. Create a folder named `custom_components` in the folder where your
  4. device's yaml configuration file is stored. Then clone the the Github
  5. repo into a subfolder `yeelight_bs2`. For example on the command line:
  6. ```
  7. # mkdir custom_components
  8. # cd custom_components
  9. # git clone https://github.com/mmakaay/esphome-yeelight_bs2 yeelight_bs2
  10. ```
  11. Your folder structure should now look like:
  12. ```
  13. config
  14. ├── yourdevice.yaml
  15. ├── custom_components/
  16. │ ├── yeelight_bs2/
  17. │ . ├── README.md
  18. . . ├── yeelight_bs2_light_output.h
  19. . . .
  20. ```
  21. Then add the required configuration to your device's yaml configuration file.
  22. For an example file, take a look at `doc/example.yaml` in this repository.
  23. On a Rapsbery Pi with HomeAssistant and ESPHome as a plugin, the directory should be:
  24. /config/esphome/custom_components/yeelight_bs2/
  25. ```
  26. config
  27. ├── epshome
  28. │ ├── yourdevice.yaml
  29. │ ├── custom_components/
  30. | . ├── yeelight_bs2/
  31. │ . . ├── README.md
  32. . . . ├── yeelight_bs2_light_output.h
  33. . . . .
  34. ```
  35. See [doc/FLASHING.md](doc/FLASHING.md) for hints for opening and flashing the light.
  36. ## Issue: the device keeps losing its connection to Home Assistant
  37. This is not a problem with the device or the custom firmware, but a problem
  38. in the upstream library "AsyncTCP". I did identify the issue and have a
  39. proposed fix for it. The issue was reported at:
  40. https://github.com/me-no-dev/AsyncTCP/issues/116
  41. If you want to try out this change, then create a `libs` folder in the
  42. folder where your device's yaml configuration file is stored, and clone the
  43. following repository into that folder:
  44. https://github.com/mmakaay/AsyncTCP
  45. For example on the command line:
  46. ```
  47. # mkdir libs
  48. # cd libs
  49. # git clone://github.com/mmakaay/AsyncTCP
  50. ```
  51. Then add a pointer to this folder from within your device's yaml
  52. configuration file, using the `lib_extra_dirs` option. Provide it with the
  53. absolute path to your `libs` folder. The relevant part of the config change
  54. looks like this:
  55. ```yaml
  56. esphome:
  57. platformio_options:
  58. lib_extra_dirs: /config/libs
  59. ```
  60. This way, the repository version of the library will override the version of
  61. the library that is bundled with ESPHome. Build the device firmware and
  62. flash the device like you would normally do.