How to set a value for "customized" Color Power On Behavior in Zigbee2MQTT?

Newbie here, I’m trying to understand how to set the power-on-behavior for led lights I have configured under Z2M.

I understand that the expected value is one of initial | previous | customized and I’m looking for the way to set the actual values of the customized option.

{
    "brightness": 254,
    "color": {
        "h": 106,
        "hue": 106,
        "x": 0.5267,
        "y": 0.4133
    },
    "color_mode": "color_temp",
    "color_power_on_behavior": "customized",
    "color_temp": 500,
    "linkquality": 51,
    "state": "ON",
    "do_not_disturb": null
}

Since this is not available through the UI I wonder if there’s some MQTT command I need to run. If so - would someone please guide me on how this should be done?

Hi elzorro,

I Maybe a light_profile.csv file?

Find more about it using this string in your search engine:

site:home-assistant.io light_profile.csv

1 Like

Thank you @Sir_Goodenough that was an excellent lead. However I’m still not able to get the right color in my light when I turn it on.
Here’s what I did:

light_profiles.csv: (on each change to the file I restart HA)

id,x,y,brightness,transition
light.ceiling_light_living_room.default,0.175,0.743,100,1

(this should produce a strong green color)

  • When I choose initial I always get a strong white
  • When I choose previous it works as advertised (same color as before shut down)
  • When I choose customized I get the following un-explained values (which I see under developer tools > states):
supported_color_modes: color_temp, xy
color_mode: xy
brightness: 255
color_temp_kelvin: null
color_temp: null
hs_color: 308.125, 37.647
rgb_color: 255, 159, 242
xy_color: 0.371, 0.239
friendly_name: Ceiling light Living room

I have no idea why these values are chosen :frowning:

For reference: light_profiles.csv stopped working · Issue #107435 · home-assistant/core · GitHub

Currently it seems to me that the customize mode only works when toggling lights on/off from the UI (or calling a service I guess).
When simply turning the light on/off using the wall switch - it ignores the customized value.
This is not the same for previous and initial which react to switching the light using the wall switch (i.e. not via a HA service)

I saw your post in the other thread and decided to reply here because you revived a 2-year old topic.

Are you switching on/off a smart bulb using a dumb switch? If yes, I can confirm that the behaviour you’re experiencing is pretty normal.

Due to being mid-migration, I currently have smart lights connected to a dumb switch and can confirm that turning them off at the switch will indeed cause them to run at their defaults (in my case, full brightness).

Please look into smart switches with decoupled mode. There’s a few threads here.

1 Like

Thank you @ShadowFist , you are absolutely right:

switching on/off a smart bulb using a dumb switch

1 Like