Setting Blue Series LED Color and Brightness (non-effect) in Home Assistant ZHA

I’m writing a script to configure the Blue Series LED on / off colors and brightness settings in Home Assistant using the ZHA integration. I have it working for the Red Series and for the Blue Series using Zigbee2MQTT. I’ve found the thread below which discusses setting the effects and I see that the LED on / off settings can be configured through exposed entities in Home Assistant but I’m looking for a more predictable way. Finding the entities through device_entities() is a bit of a pain and won’t work if the entities have been renamed or disabled.

Is there a way to set the Blue Series on / off colors and brightness levels through ZHA (i.e. the service: zha.issue_zigbee_cluster_command call)?

I use zigbee out in node red to set a notification.

image

Payload
{
    "led_effect": {
        "effect": "aurora",
        "level": 100,
        "duration": 10,
        "color": 80
    }
}

Thanks for the reply. I’m trying to use ZHA, not Zigbee2MQTT, and it’s the non-effect settings I’m trying to configure, like the on / off LED color.

:man_facepalming: Yes you should be able to set the on/off color by cluster.

0x005F: (“led_color_when_on”, t.uint8_t, True),
0x0060: (“led_color_when_off”, t.uint8_t, True),
0x000D: (“default_level_local”, t.uint8_t, True),
0x000E: (“default_level_remote”, t.uint8_t, True),

2 Likes

Are you trying to do this via automation or for the device? I haven’t messed with scripts much so there are a few ways of doing this in ZHA.

You can do a similar call to what stu1811 shared above too (noting this is in node-red’s formatting and would be slightly different in dev tools, and also it’s the individual led effect)

{
  "ieee": "deviceieeehere",
  "endpoint_id": 1,
  "cluster_id": 64561,
  "command": 3,
  "command_type": "server",
  "cluster_type": "in",
  "args": [
    4,
    8,
    43,
    100,
    100
  ],
  "manufacturer": 4655
}

This seems like the documentation I need. I just need to figure out how to set attributes, since it isn’t available as a server command. I think that gets me really close!

I’m trying to configure the non-effect on / off LEDs. The color and brightness it will return to after an effect is cleared.

Got it, so you’ll want this I think, just swap the attribute depending on the parameter.

service: zha.set_zigbee_cluster_attribute
data:
  ieee: yourdeviceieeehere
  endpoint_id: 1
  cluster_type: in
  cluster_id: 64561
  attribute: 65
  value: "100"
2 Likes

YES! I had to use the hex and chose to add the manufacturer, since the docs seemed to want it.

service: zha.set_zigbee_cluster_attribute
data: 
  ieee: "{{ (device_attr('light.blue_tester_light', 'identifiers')|list).0.1 }}"
  endpoint_id: 1
  cluster_id: 64561
  cluster_type: in
  attribute: 0x0060
  value: 1
  manufacturer: 4655
2 Likes

You guys are over complicating it.
Why not just manipulate the entity using the number.set_value service?

number.office_light_switch_ledcolorwhenoff
number.office_light_switch_ledcolorwhenon

EDIT: Ok, I see why you want to avoid the entities.