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.

110 lines
3.0 KiB

  1. substitutions:
  2. name: bedside_lamp
  3. friendly_name: Bedside Lamp
  4. transition_length: 750ms
  5. # Use your own preferences for these components.
  6. wifi:
  7. #ssid: "Your-SSID"
  8. #password: "Your-Password"
  9. #use_address: 192.168.10.12
  10. #
  11. # Enable fallback hotspot (captive portal) in case wifi connection fails
  12. #ap:
  13. # ssid: "Bedside_lamp_$name"
  14. # password: "bedside2021"
  15. captive_portal:
  16. api:
  17. ota:
  18. logger:
  19. # Special platform + package are used for enabling unicore and disabling the
  20. # efuse mac crc check. These two changes are required for the ESP32-WROOM-32D
  21. # that is used in the Yeelight bedside lamp 2.
  22. esphome:
  23. name: $name
  24. platform: ESP32
  25. board: esp32doit-devkit-v1
  26. platformio_options:
  27. platform: espressif32@1.11.0
  28. platform_packages: |-4
  29. framework-arduinoespressif32 @ https://github.com/pauln/arduino-esp32.git#solo-no-mac-crc/1.0.4
  30. light:
  31. - platform: yeelight_bs2
  32. name: ${friendly_name} RGBW Light
  33. red: led_red
  34. green: led_green
  35. blue: led_blue
  36. white: led_white
  37. master1: master1
  38. master2: master2
  39. default_transition_length: ${transition_length}
  40. effects:
  41. - random:
  42. name: "Slow Random"
  43. transition_length: 30s
  44. update_interval: 30s
  45. - random:
  46. name: "Fast Random"
  47. transition_length: 3s
  48. update_interval: 4s
  49. # The device uses two I2C busses.
  50. i2c:
  51. # This bus is very likely connected to an EEPROM that can be found
  52. # on the lamp's board, right next to the GND, TX, RX and GPIO0 debug
  53. # pads. The exact use of this component has not yet been reverse
  54. # engineered.
  55. - id: eeprom_i2c
  56. sda: GPIO17
  57. scl: GPIO18
  58. scan: True
  59. # This bus is connected to the front panel with the touch buttons.
  60. # The touch panel is fully separated form the main board and ESP32,
  61. # and communication is done strictly through I2C. The exact protocol
  62. # has been reverse engineered and can be found in the file
  63. # "doc/reverse_engineering/I2C protocol/i2c_commands.txt".
  64. - id: front_panel_i2c
  65. sda: GPIO21
  66. scl: GPIO19
  67. scan: True
  68. # The device uses six GPIO pins for driving the LED circuitry.
  69. output:
  70. # master1 + master2 are used for turning on and off the
  71. # LED circuitry in the lamp. So these are light the
  72. # internal light switch.
  73. - platform: gpio
  74. id: master1
  75. pin: GPIO33
  76. - platform: gpio
  77. id: master2
  78. pin: GPIO4
  79. # The following ledc outputs are used to drive the color of the light
  80. # in two different modes: white light mode (using color temperature
  81. # to set the type of white light) and RGB light (using an RGB mix).
  82. # Note: it is important to include the channels and frequencies as-is.
  83. - platform: ledc
  84. id: led_red
  85. pin: GPIO13
  86. channel: 0
  87. frequency: 3kHz
  88. - platform: ledc
  89. id: led_green
  90. pin: GPIO14
  91. channel: 1
  92. frequency: 3kHz
  93. - platform: ledc
  94. id: led_blue
  95. pin: GPIO5
  96. channel: 2
  97. frequency: 3kHz
  98. - platform: ledc
  99. id: led_white
  100. pin: GPIO12
  101. channel: 4
  102. frequency: 10kHz