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.

93 lines
2.3 KiB

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