Set LED on Blue Switch using Home Assistant, ZHA, and Node Red

Hello all,

I’m not new to HA or Node Red, but I’m having a hard time sorting out how to set the LED on my Blue Series Switch. I have it connected via ZHA and I can control the LED in HA using automations, but in Node Red, the issue_all_led_effect that is used in the automation isn’t available as a ZHA action.

To clarify, I’m looking to set all LED’s on one switch the same color and effect. The action in automations to do this is “Issue effect for all LEDs”. I want to replicate that but in Node Red.

I’ve seen some threads on cluster commands, but I’m not sure if that is route I need to go or not. Any assistance would be much appreciated.

Thanks!

Cluster commands are a quick way to handle it and are all that action is doing in HA. Here’s an example using the clear effect -

image

Data -

{
  "ieee": "b4:3a:31:ff:fe:8e:3c:0e",
  "endpoint_id": 1,
  "cluster_id": 64561,
  "command": 1,
  "command_type": "server",
  "cluster_type": "in",
  "args": [
    0,
    0,
    100,
    1
  ],
  "manufacturer": 4655
}
2 Likes

Thank you!! I was working on it from researching other threads, but was just guessing as to what the data format should look like!! This worked perfectly.

1 Like

Absolutely, and as a heads up if you want to do individual LED effects in the future, you just need to change the command to 3 and add an arg for the LED# (0-6).

{
  "ieee": "b4:3a:31:ff:fe:8e:3c:0e",
  "endpoint_id": 1,
  "cluster_id": 64561,
  "command": 3,
  "command_type": "server",
  "cluster_type": "in",
  "args": [
    6,
    255,
    0,
    100,
    100
  ],
  "manufacturer": 4655
}
2 Likes

Perfect, just to make sure I understand, is this correct below? I added in what I believe each argument controls.

Also, I know I can find the effects in the ZHA source code, but they are in Hex and need converted to decimal, which isn’t a big deal, but is there documentation on what each effect number maps to?

All LED Control:

{
  "ieee": "e0:79:8d:ff:fe:c7:d1:8b",
  "endpoint_id": 1,
  "cluster_id": 64561,
  "cluster_type": "in",
  "command": 1,
  "command_type": "server",
  "args": [
    "led_effect": 1,
    "led_color": 0,
    "led_level": 0,
    "led_duration": 255
  ],
  "manufacturer": 4655
}

Individual LED Control:

{
  "ieee": "e0:79:8d:ff:fe:c7:d1:8b",
  "endpoint_id": 1,
  "cluster_id": 64561,
  "cluster_type": "in",
  "command": 3,
  "command_type": "server",
  "args": [
    "led_number": 0,
    "led_effect": 1,
    "led_color": 0,
    "led_level": 0,
    "led_duration": 255
  ],
  "manufacturer": 4655
}

The first configuration value is the notification type

2 Likes

image
^from @mamber’s Hubitat driver for an ordered list of the effects in decimal

1 Like

This seems overly complicated for the standard user.

I was forced to ditch node-red due to constant connection issues so I haven’t been following this project too closely. But I know he updated to support the blue’s at least for scene control and was going to start working on notifications, but he also didn’t have any blue series switches to test. Maybe if there’s anybody here who could chip in with the code for notifications?

ryanjohnsontv/node-red-contrib-ha-inovelli-manager: Nodes for easily managing scenes, parameters, and notifications of Inovelli switches paired through various Home Assistant integrations (github.com)

1 Like

Strange. I haven’t had any issues with NR. For z2m notifications aren’t as bad a ZHA but will be nice once he gets the library working. You can select a z2m node then pass in json to set a notification.

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

I noticed after I put this flow into my system I’m getting a warning in HA. I’m guessing I need to change the cluster command data, but I haven’t been able to figure out how to format it with the new method. Any ideas?

Logger: homeassistant.components.zha.core.device
Source: components/zha/core/device.py:802
Integration: Zigbee Home Automation (documentation, issues)
First occurred: 7:32:55 AM (4 occurrences)
Last logged: 7:32:58 AM

[0x1C69](VZM31-SN): args [[12, 200, 50, 255]] are deprecated and should be passed with the params key. The parameter names are: ['led_effect', 'led_color', 'led_level', 'led_duration']
[0xE868](VZM31-SN): args [[12, 200, 50, 255]] are deprecated and should be passed with the params key. The parameter names are: ['led_effect', 'led_color', 'led_level', 'led_duration']
[0x1C69](VZM31-SN): args [[12, 58, 50, 255]] are deprecated and should be passed with the params key. The parameter names are: ['led_effect', 'led_color', 'led_level', 'led_duration']
[0xE868](VZM31-SN): args [[12, 58, 50, 255]] are deprecated and should be passed with the params key. The parameter names are: ['led_effect', 'led_color', 'led_level', 'led_duration']
Logger: homeassistant.components.zha.websocket_api
Source: helpers/config_validation.py:867
Integration: Zigbee Home Automation (documentation, issues)
First occurred: 7:32:55 AM (4 occurrences)
Last logged: 7:32:58 AM

The 'args' option is deprecated, please remove it from your configuration

Sorry, been really busy and haven’t had time/access to HA to test. I think it’s just a matter of changing the syntax to match the new params instead of using args. Will try to get back to you soon on it.