Default Light Temperature

Hey guys -

I am using a light flashed w/ ESPHome and I wanted to know if there was a way to set a default color temperature when i power it on as on the rare instances it loses power, it powers up to a super hash daylight white. Thanks


output:
  - platform: esp8266_pwm
    id: output_red
    pin: GPIO4
  - platform: esp8266_pwm
    id: output_green
    pin: GPIO12
  - platform: esp8266_pwm
    id: output_blue
    pin: GPIO14
  - platform: esp8266_pwm
    id: output_warm_white
    pin: GPIO13
  - platform: esp8266_pwm
    id: output_cold_white
    pin: GPIO5

light:
  - platform: cwww
    name: $device_name
    id: $device_name
    cold_white: output_cold_white
    warm_white: output_warm_white
    cold_white_color_temperature: 6536 K
    warm_white_color_temperature: 2000 K
    default_transition_length: 0.5s

    # Ensure the light turns on by default if the physical switch is actuated.
    restore_mode: RESTORE_DEFAULT_OFF

on_boot: - see the esphome docs :slight_smile:

EDIT: here https://esphome.io/components/esphome.html?highlight=on_boot#on-boot

Hmm. Not sure I follow how this could solve my problem. If I understand how this works, I would have to have this trigger a light on event with the temperature set. That’s not what I want. I want the light to be off after a reboot (think power outage) but the next time it gets called to turn on have a specified temp. Part of the problem is that I call this light through the toggle service and using the hass UI.

Edit: feel free to tell me I don’t understand and that I should re-read the docs :wink: but my understanding of what I read is that it wouldn’t solve this.

I think I found the solution: “on_turn_on” from https://esphome.io/components/light/index.html#config-light. Somehow I missed this last time I checked as I was focussing on the cwww docs. Thanks

1 Like

Here’s a blueprint I created to solve this for my Sengled zigbee bulbs. They only turn on to the previous state and don’t have a default turn-on value. If you need a default brightness/color (not color temperature then Default Turn-on Value is what you need.