Sfoglia il codice sorgente

gf-office-rgb-02 - lampka biurko

Patryk M. Gutowski 1 anno fa
parent
commit
edfc148ddd
1 ha cambiato i file con 158 aggiunte e 0 eliminazioni
  1. 158 0
      gf-office-rgb-02.yaml

+ 158 - 0
gf-office-rgb-02.yaml

@@ -0,0 +1,158 @@
+substitutions:
+  devicename: gf-office-rgb-02
+  low_devicename: gf_office_rgb_02
+  friendly_devicename: GF Office RGB Light 02
+
+esphome:
+  name: $devicename
+  friendly_name: ${friendly_devicename}
+
+bk72xx:
+  board: generic-bk7231t-qfn32-tuya
+
+
+
+# Enable logging
+logger:
+
+web_server:
+  port: 80
+  
+# Enable Home Assistant API
+api:
+  encryption:
+    key: "ejeMnlF5M60w/yuYwAWn/kIBz701xLwVkUGf9iN8uLA="
+
+ota:
+  password: "2c27af3ab81f992e23745c20ab5dfc02"
+
+wifi:
+  ssid: !secret iot_ssid
+  password: !secret iot_password
+  domain: .int.mmax.cloud
+
+
+text_sensor:
+  #  - platform: debug
+  #  reset_reason:
+  #    name: Reset Reason
+  - platform: libretiny
+    version:
+      name: LibreTiny Version
+packages:
+  diag: !include common/diag.yaml
+
+bp5758d:
+  clock_pin: P24
+  data_pin: P26
+
+#output:
+#  - platform: bp5758d
+#    id: output_red
+#    channel: 3
+#    current: 14
+#  - platform: bp5758d
+#    id: output_green
+#    channel: 2
+#    current: 14
+#  - platform: bp5758d
+#    id: output_blue
+#    channel: 1
+#    current: 14
+#  - platform: bp5758d
+#    id: output_cold
+#    channel: 5
+#    current: 29
+#  - platform: bp5758d
+#    id: output_warm
+#    channel: 4
+#    current: 29
+
+output:
+  - platform: bp5758d
+    id: output_red
+    channel: 2
+    current: 14
+  - platform: bp5758d
+    id: output_green
+    channel: 1
+    current: 14
+  - platform: bp5758d
+    id: output_blue
+    channel: 3
+    current: 14
+  - platform: bp5758d
+    id: output_cold_white
+    channel: 5
+    current: 29
+  - platform: bp5758d
+    id: output_warm_white
+    channel: 4
+    current: 29
+
+
+#light:
+#  - platform: rgbww
+#    id: light_rgbww
+#    name: "light"
+#    color_interlock: true
+#    cold_white_color_temperature: 6500 K
+#    warm_white_color_temperature: 2700 K
+#    red: output_red
+#    green: output_green
+#    blue: output_blue
+#    cold_white: output_cold
+#    warm_white: output_warm
+#    restore_mode: RESTORE_AND_ON
+#    effects:
+#      - random:
+#      - strobe:
+#      - flicker:
+#          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%.
+#          intensity: 50%
+
+
+light:
+  - platform: rgbww
+    name: ${friendly_devicename}
+    id: the_light
+    restore_mode: RESTORE_AND_ON
+    red: output_red
+    green: output_green
+    blue: output_blue
+    cold_white: output_cold_white
+    warm_white: output_warm_white
+    cold_white_color_temperature: 6500 K
+    warm_white_color_temperature: 2700 K
+    color_interlock: true
+    constant_brightness: true
+    effects:
+      - random:
+          name: "Slow Random"
+          transition_length: 30s
+          update_interval: 30s
+      - random:
+          name: "Fast Random"
+          transition_length: 4s
+          update_interval: 5s
+      - strobe:
+      - flicker:
+          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%.
+          intensity: 50% #The intensity of the flickering, basically the maximum amplitude of the random offsets. Defaults to 1.5%.
+      - lambda:
+          name: Throb
+          update_interval: 1s
+          lambda: |-
+            static int state = 0;
+            auto call = id(the_light).turn_on();
+            // Transtion of 1000ms = 1s
+            call.set_transition_length(1000);
+            if (state == 0) {
+              call.set_brightness(1.0);
+            } else {
+              call.set_brightness(0.01);
+            }
+            call.perform();
+            state += 1;
+            if (state == 2)
+              state = 0;