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.

111 lines
3.1 KiB

  1. substitutions:
  2. name: bedside_lamp
  3. friendly_name: Bedside Lamp
  4. transition_length: 1s
  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. # You can use any effects that you like. These are just examples.
  41. effects:
  42. - random:
  43. name: "Slow Random"
  44. transition_length: 30s
  45. update_interval: 30s
  46. - random:
  47. name: "Fast Random"
  48. transition_length: 3s
  49. update_interval: 3s
  50. # The device uses two I2C busses.
  51. i2c:
  52. # This bus is very likely connected to an EEPROM that can be found
  53. # on the lamp's board, right next to the GND, TX, RX and GPIO0 debug
  54. # pads. The exact use of this component has not yet been reverse
  55. # engineered.
  56. - id: eeprom_i2c
  57. sda: GPIO17
  58. scl: GPIO18
  59. scan: True
  60. # This bus is connected to the front panel with the touch buttons.
  61. # The touch panel is fully separated form the main board and ESP32,
  62. # and communication is done strictly through I2C. The exact protocol
  63. # has been reverse engineered and can be found in the file
  64. # "doc/reverse_engineering/I2C protocol/i2c_commands.txt".
  65. - id: front_panel_i2c
  66. sda: GPIO21
  67. scl: GPIO19
  68. scan: True
  69. # The device uses six GPIO pins for driving the LED circuitry.
  70. output:
  71. # master1 + master2 are used for turning on and off the
  72. # LED circuitry in the lamp. So these are light the
  73. # internal light switch.
  74. - platform: gpio
  75. id: master1
  76. pin: GPIO33
  77. - platform: gpio
  78. id: master2
  79. pin: GPIO4
  80. # The following ledc outputs are used to drive the color of the light
  81. # in two different modes: white light mode (using color temperature
  82. # to set the type of white light) and RGB light (using an RGB mix).
  83. # Note: it is important to include the channels and frequencies as-is.
  84. - platform: ledc
  85. id: led_red
  86. pin: GPIO13
  87. channel: 0
  88. frequency: 3kHz
  89. - platform: ledc
  90. id: led_green
  91. pin: GPIO14
  92. channel: 1
  93. frequency: 3kHz
  94. - platform: ledc
  95. id: led_blue
  96. pin: GPIO5
  97. channel: 2
  98. frequency: 3kHz
  99. - platform: ledc
  100. id: led_white
  101. pin: GPIO12
  102. channel: 4
  103. frequency: 10kHz