ff-asia-light-03.yaml 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. substitutions:
  2. devicename: ff-asia-light-03
  3. low_devicename: ff_asia_light_03
  4. friendly_devicename: FF Asia Light 03
  5. esphome:
  6. name: $devicename
  7. friendly_name: ${friendly_devicename}
  8. bk72xx:
  9. board: generic-bk7231t-qfn32-tuya
  10. # Enable logging
  11. logger:
  12. web_server:
  13. port: 80
  14. # Enable Home Assistant API
  15. api:
  16. encryption:
  17. key: "ejeMnlF5M60w/yuYwAWn/kIBz701xLwVkUGf9iN8uLA="
  18. ota:
  19. password: "2c27af3ab81f992e23745c20ab5dfc02"
  20. wifi:
  21. ssid: !secret iot_ssid
  22. password: !secret iot_password
  23. domain: .int.mmax.cloud
  24. text_sensor:
  25. # - platform: debug
  26. # reset_reason:
  27. # name: Reset Reason
  28. - platform: libretiny
  29. version:
  30. name: LibreTiny Version
  31. packages:
  32. diag: !include common/diag.yaml
  33. output:
  34. - platform: libretiny_pwm
  35. id: output_cold_white
  36. frequency: 500Hz
  37. pin: P24
  38. - platform: libretiny_pwm
  39. id: output_warm_white
  40. frequency: 500Hz
  41. pin: P26
  42. # Example configuration entry
  43. light:
  44. - platform: cwww
  45. name: ${friendly_devicename}
  46. id: the_light
  47. cold_white: output_cold_white
  48. warm_white: output_warm_white
  49. cold_white_color_temperature: 6500 K
  50. warm_white_color_temperature: 2700 K
  51. constant_brightness: true
  52. restore_mode: RESTORE_AND_ON
  53. effects:
  54. - random:
  55. name: "Slow Random"
  56. transition_length: 30s
  57. update_interval: 30s
  58. - random:
  59. name: "Fast Random"
  60. transition_length: 4s
  61. update_interval: 5s
  62. - strobe:
  63. - flicker:
  64. alpha: 50% #The percentage that the last color value should affect the light. More or less the “forget-factor” of an exponential moving average. Defaults to 95%.
  65. intensity: 50% #The intensity of the flickering, basically the maximum amplitude of the random offsets. Defaults to 1.5%.
  66. - lambda:
  67. name: Throb
  68. update_interval: 1s
  69. lambda: |-
  70. static int state = 0;
  71. auto call = id(the_light).turn_on();
  72. // Transtion of 1000ms = 1s
  73. call.set_transition_length(1000);
  74. if (state == 0) {
  75. call.set_brightness(1.0);
  76. } else {
  77. call.set_brightness(0.01);
  78. }
  79. call.perform();
  80. state += 1;
  81. if (state == 2)
  82. state = 0;
  83. ## Blink the light if we aren't connected to WiFi.
  84. ## Uncomment below
  85. #interval:
  86. #- interval: 500ms
  87. # then:
  88. # - if:
  89. # condition:
  90. # not:
  91. # wifi.connected:
  92. # then:
  93. # - light.turn_on:
  94. # id: the_light
  95. # brightness: 50%
  96. # transition_length: 0s
  97. # - delay: 250ms
  98. # - light.turn_off:
  99. # id: the_light
  100. # transition_length: 250ms