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.

118 lines
3.5 KiB

  1. # =========================================================================
  2. # *** If you are not developing the firmware, you can ignore this file ***
  3. #
  4. # This configuration package is used by Maurice for development purposes.
  5. # The main difference with the regular core.yaml package, is that the
  6. # source code for the bslamp2 component is not a remote GitHub repository,
  7. # but a local checkout of that repository.
  8. # ==========================================================================
  9. # --------------------------------------------------------------------------
  10. # Substitutions as used by the configuration packages
  11. # These can be overriden from the main device configuration file.
  12. # --------------------------------------------------------------------------
  13. substitutions:
  14. name: bedside-lamp
  15. friendly_name: Bedside Lamp
  16. light_name: ${friendly_name} RGBWW Light
  17. light_mode_text_sensor_name: ${friendly_name} Light Mode
  18. default_transition_length: 800ms
  19. # --------------------------------------------------------------------------
  20. # Core setup
  21. # --------------------------------------------------------------------------
  22. esphome:
  23. name: ${name}
  24. esp32:
  25. board: esp32doit-devkit-v1
  26. framework:
  27. type: esp-idf
  28. sdkconfig_options:
  29. CONFIG_FREERTOS_UNICORE: y
  30. advanced:
  31. ignore_efuse_mac_crc: true
  32. # Retrieve the code for the xiaomi_bslamp2 platform from a local clone
  33. # of the github repository, one directory up from the config file.
  34. external_components:
  35. - source:
  36. type: local
  37. path: ../esphome-xiaomi_bslamp2/components
  38. # Disable the reboot timeout. By default, the lamp reboots after 15
  39. # minutes without any client connections (e.g. when home assistant is off
  40. # line, or when the WiFi is broken). Reboots are annoying though, because
  41. # the RGBWW LEDs will turn off during the reboot, causing the light to
  42. # flicker.
  43. api:
  44. reboot_timeout: 0s
  45. # The log level can be raised when needed for debugging the firmware. For
  46. # production, a low log level is recommended. Mainly because high volume log
  47. # output might interfere with the API/WiFi connection stability. So when
  48. # raising the log level, beware that you might see dropped connections from
  49. # Home Assistant and the network log viewer.
  50. logger:
  51. level: INFO
  52. # ----------------------------------------------------------------------
  53. # Hardware setup
  54. # ----------------------------------------------------------------------
  55. i2c:
  56. id: front_panel_i2c
  57. sda: GPIO21
  58. scl: GPIO19
  59. scan: true
  60. output:
  61. - platform: ledc
  62. id: output_red
  63. pin: GPIO13
  64. frequency: 3000
  65. channel: 0
  66. - platform: ledc
  67. id: output_green
  68. pin: GPIO14
  69. frequency: 3000
  70. channel: 1
  71. - platform: ledc
  72. id: output_blue
  73. pin: GPIO5
  74. frequency: 3000
  75. channel: 2
  76. - platform: ledc
  77. id: output_white
  78. pin: GPIO12
  79. frequency: 10000
  80. channel: 4
  81. - platform: gpio
  82. id: output_master1
  83. pin: GPIO33
  84. - platform: gpio
  85. id: output_master2
  86. pin:
  87. number: GPIO4
  88. mode: OUTPUT
  89. # This float output can be used to control the front panel illumination +
  90. # level indicator LEDs. Value 0.0 turns off the illumination. Other values
  91. # (up to 1.0) turn on the illumination and set the level indicator to the
  92. # requested level.
  93. - platform: xiaomi_bslamp2
  94. id: my_front_panel_illumination
  95. xiaomi_bslamp2:
  96. light:
  97. red: output_red
  98. green: output_green
  99. blue: output_blue
  100. white: output_white
  101. master1: output_master1
  102. master2: output_master2
  103. front_panel:
  104. i2c: front_panel_i2c
  105. address: 0x2C
  106. trigger_pin: GPIO16