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.

59 lines
2.0 KiB

  1. # Installation guide
  2. The code must be compiled using ESPHome. Therefore, a prerequisite is that
  3. you have ESPHome up and running in some form (command line, docker container,
  4. web dashboard, possibly from within Home Assistant).
  5. For information on this, please refer to the documentation on the
  6. [ESPHome website](https://esphome.io).
  7. Create a folder named `custom_components` in the folder where your device's
  8. yaml configuration file is stored. Then clone the the Github repo into a
  9. subfolder `xiaomi_bslamp2`. For example on the command line:
  10. ```
  11. # cd /your/path/to/config
  12. # mkdir custom_components
  13. # cd custom_components
  14. # git clone https://github.com/mmakaay/esphome-xiaomi_bslamp2 xiaomi_bslamp2
  15. ```
  16. Your folder structure should now look like:
  17. ```
  18. config
  19. ├── yourdevice.yaml
  20. ├── custom_components/
  21. │ ├── xiaomi_bslamp2/
  22. │ . ├── README.md
  23. . . ├── LICENSE.md
  24. . . .
  25. ```
  26. On a Rapsbery Pi with HomeAssistant and ESPHome as a plugin, the directory
  27. should be: `/config/esphome/custom_components/xiaomi_bslamp2/`
  28. ```
  29. config
  30. ├── esphome
  31. │ ├── yourdevice.yaml
  32. │ ├── custom_components/
  33. | . ├── xiaomi_bslamp2/
  34. │ . . ├── README.md
  35. . . . ├── LICENSE.md
  36. . . . .
  37. ```
  38. Then create the required configuration in your device's yaml configuration
  39. file. For an example file, take a look at the example file
  40. [doc/example.yaml](doc/example.yaml) in this repository.
  41. Detailed configuration instructions can be found in the
  42. [Configuration guide](doc/configuration.md).
  43. After these steps you can compile your firmware `firmware.bin` file.
  44. This firmware can then be flashed onto the device.
  45. Like normal with ESPHome, the first time you will have to flash the
  46. device using a serial interface. After this initial flashing operation, you
  47. can flash new versions of the firmware using the OTA (Over The Air) method.
  48. See [doc/flashing.md](the flashing guide) for hints on opening up the
  49. device and flashing its firmware using its serial interface.