Help with a CCT (CWWW) light

I have a Mirabella Genio CCT white downlight that requires a different light component setup.

This light runs a pwm on GPIO12 and 14 to a second chip to control the CW WW blend on one PWM and Brightness on the other. It also turns the light off at a duty cycle less than about 10%.

How would I set that up with esphome?

Cheers

@BennyB44, I think you are looking for something like this:

esphome:
  name: mirabella
  platform: ESP8266
  board: esp01_1m
  on_boot:
    priority: 100 # Highest priority, ensures light turns on without delay.
    then:
      - light.turn_on: light
wifi:
  ssid: 'your_ssid'
  password: 'your_password'
  ap:
    ssid: 'mirabella1'
    password: 'ap_password'
  domain: '.mydomain.com'
  
captive_portal:

# Enable logging
logger:

# Enable Home Assistant API
api:
  password: 'api_password'

ota:
  password: 'ota_password'

web_server:
  port: 80

sensor:
  - platform: wifi_signal
    name: "Mirabella Genio WiFi Signal"
    update_interval: 60s
    
    
output:
  - platform: esp8266_pwm
    id: output_warm_white
    pin: GPIO12
  - platform: esp8266_pwm
    id: output_daylight
    pin: GPIO14

light:
  - platform: cwww
    name: "Mirabella Genio"
    cold_white: output_daylight
    warm_white: output_warm_white
    cold_white_color_temperature: 6500 K
    warm_white_color_temperature: 2700 K

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

Thank you for the reply. That would work under normal circumstances but the Genio bulb doesn’t use the 2 pwm channels to control CW and WW individually. On 1 pwm at 0% duty cycle it is WW and 100% is CW. The other is a Brightness control that doesn’t operate below 10% duty cycle. So nothing on the slider till 10% and full on at 100%.

I found this out after the CWWW setup didn’t perform as you would expect so I set the channels up as 2 monochromatic lights and played with the brightness sliders to work out their function.

Hmmm, that sucks, sorry that didn’t help.

Hi, I don’t know if you solved this but this is what worked for me with a bulb that had the same properties.

genio.yaml

globals:
   - id: maxmireds
     type: float
     restore_value: no
     initial_value: '370'
   - id: minmireds
     type: float
     restore_value: no
     initial_value: '154'

substitutions:
  hostname: genio_1
  display_name: Mirabella Genio

esphome:
  name: $hostname
  platform: ESP8266
  board: esp01_1m
  includes:
    - genio_output.h

wifi:
  ssid: "Your SSID"
  password: "wifi_password"

ota:
  password: "ota_password"

api:
  password: "api_password"

# Enable logging
logger:


light:
  - platform: custom
    lambda: |-
      auto light_out = new GenioLightOutput(id(brightness), id(color_temperature));
      App.register_component(light_out);
      return {light_out};
    lights:
      - name: $display_name

output:
  - platform: esp8266_pwm
    id: brightness
    pin: GPIO12
  - platform: esp8266_pwm
    id: color_temperature
    pin: GPIO14

genio_output.h

#pragma once

#include "esphome.h"

class GenioLightOutput : public Component, public LightOutput {
    public:
    GenioLightOutput(FloatOutput *brightness, FloatOutput *color_temperature)
    {
	brightness_ = brightness;
        color_temperature_ = color_temperature;
    }

    LightTraits get_traits() override {
        auto traits = LightTraits();
        traits.set_supports_brightness(true);
        traits.set_supports_color_temperature(true);
        traits.set_max_mireds(id(maxmireds));
        traits.set_min_mireds(id(minmireds));
        return traits;
    }

    void write_state(LightState *state) override {
      float brightness, color_temperature;

	state->current_values_as_brightness(&brightness);

	color_temperature = (1 - (state->current_values.get_color_temperature() - id(minmireds)) / (id(maxmireds) - id(minmireds)));

	
        if (brightness == 0 )
        {
	    this->brightness_->set_level(0);
            this->color_temperature_->set_level(color_temperature);
	}
        else
        {
	    this->brightness_->set_level((brightness * 0.9) + 0.1);
            this->color_temperature_->set_level(color_temperature);
	}
    }

    protected:
    FloatOutput *brightness_;
    FloatOutput *color_temperature_;
};

You need the cwww2 custom component.

You can find it here:

And then your code should look something like this:

You have copied and pasted my code from GitHub.

It has an issue and the CWWW2 custom component works perfectly.

1 Like

Hello there,

I wanted to ask wether its possible to change the cct blending in esp home?

With a voltage meter I can measure that when both colours are at full brightness, there are actually 12V directly at the copper traces on the strip itself. I know, this is an error because it can’t measure the pwm correctly but it still seams like esp home dimms both the cw and the ww components respectively. Is there a way to get full output power on both channels?

Did you look at the Docs?

Its right there at the top…

I did read the documentation several times, yet I apparently have overseen the variable “constant_brightness” every time. Thanks for this