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.

78 lines
2.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. master1: master1
  34. master2: master2
  35. default_transition_length: ${transition_length}
  36. # You can use any effects that you like. These are just examples.
  37. effects:
  38. - random:
  39. name: "Slow Random"
  40. transition_length: 30s
  41. update_interval: 30s
  42. - random:
  43. name: "Fast Random"
  44. transition_length: 3s
  45. update_interval: 3s
  46. # The device uses two I2C busses.
  47. i2c:
  48. # This bus is very likely connected to an EEPROM that can be found
  49. # on the lamp's board, right next to the GND, TX, RX and GPIO0 debug
  50. # pads. The exact use of this component has not yet been reverse
  51. # engineered.
  52. - id: eeprom_i2c
  53. sda: GPIO17
  54. scl: GPIO18
  55. scan: True
  56. # This bus is connected to the front panel with the touch buttons.
  57. # The touch panel is fully separated form the main board and ESP32,
  58. # and communication is done strictly through I2C. The exact protocol
  59. # has been reverse engineered and can be found in the file
  60. # "doc/reverse_engineering/I2C protocol/i2c_commands.txt".
  61. - id: front_panel_i2c
  62. sda: GPIO21
  63. scl: GPIO19
  64. scan: True
  65. output:
  66. - platform: gpio
  67. id: master1
  68. pin: GPIO33
  69. - platform: gpio
  70. id: master2
  71. pin: GPIO4