substitutions: devicename: ff-asia-light-03 low_devicename: ff_asia_light_03 friendly_devicename: FF Asia Light 03 esphome: name: $devicename friendly_name: ${friendly_devicename} bk72xx: board: generic-bk7231t-qfn32-tuya packages: # Enable Home Assistant API esphome: !include common/keys.yaml diag: !include common/diag.yaml # Enable logging logger: web_server: port: 80 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 output: - platform: libretiny_pwm id: output_cold_white frequency: 500Hz pin: P24 - platform: libretiny_pwm id: output_warm_white frequency: 500Hz pin: P26 # Example configuration entry light: - platform: cwww name: ${friendly_devicename} id: the_light cold_white: output_cold_white warm_white: output_warm_white cold_white_color_temperature: 6500 K warm_white_color_temperature: 2700 K constant_brightness: true restore_mode: RESTORE_AND_ON 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; ## Blink the light if we aren't connected to WiFi. ## Uncomment below #interval: #- interval: 500ms # then: # - if: # condition: # not: # wifi.connected: # then: # - light.turn_on: # id: the_light # brightness: 50% # transition_length: 0s # - delay: 250ms # - light.turn_off: # id: the_light # transition_length: 250ms