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.

125 lines
3.8 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. # Bugfix for ESPHome 2022.12.0 and up: fallback to older platform
  33. # version, to prevent bricked devices. ESPHome uses newer versions
  34. # by default.
  35. # See also: https://github.com/mmakaay/esphome-xiaomi_bslamp2/issues/104
  36. version: 4.3.2
  37. source: ~3.40302.0
  38. platform_version: platformio/espressif32 @ 3.5.0
  39. # Retrieve the code for the xiaomi_bslamp2 platform from a local clone
  40. # of the github repository, one directory up from the config file.
  41. external_components:
  42. - source:
  43. type: local
  44. path: ../esphome-xiaomi_bslamp2/components
  45. # Disable the reboot timeout. By default, the lamp reboots after 15
  46. # minutes without any client connections (e.g. when home assistant is off
  47. # line, or when the WiFi is broken). Reboots are annoying though, because
  48. # the RGBWW LEDs will turn off during the reboot, causing the light to
  49. # flicker.
  50. api:
  51. reboot_timeout: 0s
  52. # The log level can be raised when needed for debugging the firmware. For
  53. # production, a low log level is recommended. Mainly because high volume log
  54. # output might interfere with the API/WiFi connection stability. So when
  55. # raising the log level, beware that you might see dropped connections from
  56. # Home Assistant and the network log viewer.
  57. logger:
  58. level: INFO
  59. # ----------------------------------------------------------------------
  60. # Hardware setup
  61. # ----------------------------------------------------------------------
  62. i2c:
  63. id: front_panel_i2c
  64. sda: GPIO21
  65. scl: GPIO19
  66. scan: true
  67. output:
  68. - platform: ledc
  69. id: output_red
  70. pin: GPIO13
  71. frequency: 3000
  72. channel: 0
  73. - platform: ledc
  74. id: output_green
  75. pin: GPIO14
  76. frequency: 3000
  77. channel: 1
  78. - platform: ledc
  79. id: output_blue
  80. pin: GPIO5
  81. frequency: 3000
  82. channel: 2
  83. - platform: ledc
  84. id: output_white
  85. pin: GPIO12
  86. frequency: 10000
  87. channel: 4
  88. - platform: gpio
  89. id: output_master1
  90. pin: GPIO33
  91. - platform: gpio
  92. id: output_master2
  93. pin:
  94. number: GPIO4
  95. mode: OUTPUT
  96. # This float output can be used to control the front panel illumination +
  97. # level indicator LEDs. Value 0.0 turns off the illumination. Other values
  98. # (up to 1.0) turn on the illumination and set the level indicator to the
  99. # requested level.
  100. - platform: xiaomi_bslamp2
  101. id: my_front_panel_illumination
  102. xiaomi_bslamp2:
  103. light:
  104. red: output_red
  105. green: output_green
  106. blue: output_blue
  107. white: output_white
  108. master1: output_master1
  109. master2: output_master2
  110. front_panel:
  111. i2c: front_panel_i2c
  112. address: 0x2C
  113. trigger_pin: GPIO16