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.

88 lines
2.1 KiB

  1. # --------------------------------------------------------------------------
  2. # Xiaomi Mija Bedside Lamp 2 core configuration
  3. # --------------------------------------------------------------------------
  4. substitutions:
  5. name: bedside-lamp
  6. friendly_name: Bedside Lamp
  7. light_name: ${friendly_name} RGBWW Light
  8. light_mode_text_sensor_name: ${friendly_name} Light Mode
  9. default_transition_length: 800ms
  10. esphome:
  11. name: ${name}
  12. esp32:
  13. board: esp32doit-devkit-v1
  14. framework:
  15. type: esp-idf
  16. sdkconfig_options:
  17. CONFIG_FREERTOS_UNICORE: y
  18. advanced:
  19. ignore_efuse_mac_crc: true
  20. # Retrieve the code for the xiaomi_bslamp2 platform from GitHub.
  21. external_components:
  22. - source: github://mmakaay/esphome-xiaomi_bslamp2@dev
  23. refresh: 60s
  24. # Disable the reboot timeout. By default, the lamp reboots after 15
  25. # minutes without any client connections (e.g. when home assistant is off
  26. # line, or when the WiFi is broken). Reboots are annoying though, because
  27. # the RGBWW LEDs will turn off during the reboot, causing the light to
  28. # flicker.
  29. api:
  30. reboot_timeout: 0s
  31. # ----------------------------------------------------------------------
  32. # Hardware configuration
  33. # ----------------------------------------------------------------------
  34. i2c:
  35. id: front_panel_i2c
  36. sda: GPIO21
  37. scl: GPIO19
  38. scan: true
  39. output:
  40. - platform: ledc
  41. id: output_red
  42. pin: GPIO13
  43. frequency: 3000
  44. channel: 0
  45. - platform: ledc
  46. id: output_green
  47. pin: GPIO14
  48. frequency: 3000
  49. channel: 1
  50. - platform: ledc
  51. id: output_blue
  52. pin: GPIO5
  53. frequency: 3000
  54. channel: 2
  55. - platform: ledc
  56. id: output_white
  57. pin: GPIO12
  58. frequency: 10000
  59. channel: 4
  60. - platform: gpio
  61. id: output_master1
  62. pin: GPIO33
  63. - platform: gpio
  64. id: output_master2
  65. pin:
  66. number: GPIO4
  67. mode: OUTPUT
  68. xiaomi_bslamp2:
  69. light:
  70. red: output_red
  71. green: output_green
  72. blue: output_blue
  73. white: output_white
  74. master1: output_master1
  75. master2: output_master2
  76. front_panel:
  77. i2c: front_panel_i2c
  78. address: 0x2C
  79. trigger_pin: GPIO16