gf-office-rgb-02.yaml 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. substitutions:
  2. devicename: gf-office-rgb-02
  3. low_devicename: gf_office_rgb_02
  4. friendly_devicename: GF Office RGB Light 02
  5. esphome:
  6. name: $devicename
  7. friendly_name: ${friendly_devicename}
  8. platformio_options:
  9. lib_ignore:
  10. - RPAsyncTCP
  11. bk72xx:
  12. board: generic-bk7231t-qfn32-tuya
  13. packages:
  14. # Enable Home Assistant API
  15. esphome: !include common/keys.yaml
  16. diag: !include common/diag.yaml
  17. # Enable logging
  18. logger:
  19. web_server:
  20. port: 80
  21. wifi:
  22. ssid: !secret iot_ssid
  23. password: !secret iot_password
  24. domain: .int.mmax.cloud
  25. text_sensor:
  26. # - platform: debug
  27. # reset_reason:
  28. # name: Reset Reason
  29. - platform: libretiny
  30. version:
  31. name: LibreTiny Version
  32. bp5758d:
  33. clock_pin: P24
  34. data_pin: P26
  35. #output:
  36. # - platform: bp5758d
  37. # id: output_red
  38. # channel: 3
  39. # current: 14
  40. # - platform: bp5758d
  41. # id: output_green
  42. # channel: 2
  43. # current: 14
  44. # - platform: bp5758d
  45. # id: output_blue
  46. # channel: 1
  47. # current: 14
  48. # - platform: bp5758d
  49. # id: output_cold
  50. # channel: 5
  51. # current: 29
  52. # - platform: bp5758d
  53. # id: output_warm
  54. # channel: 4
  55. # current: 29
  56. output:
  57. - platform: bp5758d
  58. id: output_red
  59. channel: 2
  60. current: 14
  61. - platform: bp5758d
  62. id: output_green
  63. channel: 1
  64. current: 14
  65. - platform: bp5758d
  66. id: output_blue
  67. channel: 3
  68. current: 14
  69. - platform: bp5758d
  70. id: output_cold_white
  71. channel: 5
  72. current: 29
  73. - platform: bp5758d
  74. id: output_warm_white
  75. channel: 4
  76. current: 29
  77. #light:
  78. # - platform: rgbww
  79. # id: light_rgbww
  80. # name: "light"
  81. # color_interlock: true
  82. # cold_white_color_temperature: 6500 K
  83. # warm_white_color_temperature: 2700 K
  84. # red: output_red
  85. # green: output_green
  86. # blue: output_blue
  87. # cold_white: output_cold
  88. # warm_white: output_warm
  89. # restore_mode: RESTORE_AND_ON
  90. # effects:
  91. # - random:
  92. # - strobe:
  93. # - flicker:
  94. # 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%.
  95. # intensity: 50%
  96. light:
  97. - platform: rgbww
  98. name: ${friendly_devicename}
  99. id: the_light
  100. restore_mode: RESTORE_DEFAULT_ON
  101. red: output_red
  102. green: output_green
  103. blue: output_blue
  104. cold_white: output_cold_white
  105. warm_white: output_warm_white
  106. cold_white_color_temperature: 6500 K
  107. warm_white_color_temperature: 2700 K
  108. color_interlock: true
  109. constant_brightness: true
  110. effects:
  111. - random:
  112. name: "Slow Random"
  113. transition_length: 30s
  114. update_interval: 30s
  115. - random:
  116. name: "Fast Random"
  117. transition_length: 4s
  118. update_interval: 5s
  119. - strobe:
  120. - flicker:
  121. 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%.
  122. intensity: 50% #The intensity of the flickering, basically the maximum amplitude of the random offsets. Defaults to 1.5%.
  123. - lambda:
  124. name: Throb
  125. update_interval: 1s
  126. lambda: |-
  127. static int state = 0;
  128. auto call = id(the_light).turn_on();
  129. // Transtion of 1000ms = 1s
  130. call.set_transition_length(1000);
  131. if (state == 0) {
  132. call.set_brightness(1.0);
  133. } else {
  134. call.set_brightness(0.01);
  135. }
  136. call.perform();
  137. state += 1;
  138. if (state == 2)
  139. state = 0;