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.

63 lines
2.5 KiB

  1. [Index](../README.md) | [Flashing guide](flashing.md) >
  2. # Configuration guide
  3. The `xiaomi_bslamp2` platform provides various components that expose the core functionalities of the lamp.
  4. In the following table, you can find what components are used for exposing what parts of the lamp.
  5. | Part | Component(s) |
  6. | -------------------------- |--------------------------------------------------------|
  7. | ESP32 pinouts | [platform 'xiaomi_bslamp2'](#platform-xiaomi-bslamp2) |
  8. | RGBWW LEDs | [light](#light) |
  9. | Front Panel Power button | [binary_sensor](#binary_sensor) |
  10. | Front Panel Color button | [binary_sensor](#binary_sensor) |
  11. | Front Panel Slider | [binary_sensor](#binary_sensor) (touch/release) |
  12. | | [sensor](#sensor) (touched slider level) |
  13. | Front Panel Illumination | [output](#output) (on/off + indicator level) |
  14. | Light mode propagation | [text_sensor](#text_sensor) |
  15. ## Platform: xiaomi_bslamp2
  16. At the core of the hardware support is the `xiaomi_bslamp2` platform, which provides two
  17. hub-style hardware abstraction layer (HAL) components that are used by the other components:
  18. one for driving the GPIO's for the RGBWW leds and one for the I2C communication between
  19. the ESP32 and the front panel.
  20. I do mention it here for completeness sake, but generally you will not have to add the
  21. following configuration option to your yaml file. It is loaded automatically by the
  22. components that need it, and the GPIO + I2C configurations are fully prepared to work
  23. for the Bedside Lamp 2 wiring out of the box.
  24. Therefore, you will not find this piece of configuration in the [example.yaml](doc/example.yaml).
  25. Having said that, here are the configuration options:
  26. ```yaml
  27. xiaomi_bslamp2:
  28. # Options for the RGBWW LEDs HAL.
  29. red: "GPIO13"
  30. green: "GPIO14"
  31. blue: "GPIO5"
  32. white: "GPIO12"
  33. master_1: "GPIO33"
  34. master_2: "GPIO4"
  35. # Options for the Front Panel HAL.
  36. sda: "GPIO21"
  37. scl: "GPIO19"
  38. address: 0x2C
  39. trigger_pin: "GPIO16"
  40. ```
  41. The only reason that I can think of for adding this platform configuration to your yaml
  42. file, would be if you blew one or more or the ESP32 pins, and need to rewire functions
  43. to different pins.
  44. ## Component: light
  45. ## Component: binary_sensor
  46. ## Component: sensor
  47. ## Component: output
  48. ## Component: text_output