I have recently created a Home Assistant automation Blueprint to change the LED color of multiple Z-Wave switches that are setup using Z-WaveJS. Hopefully this can help someone else who like me like to change colors often. Any feedback is encourages and appreciated!
I have multiple Inovelli Red/Black Series switches that I like to periodically change the color of the LEDs. I got tired of having to go into the Z-Wave configuration of each switch to change them individually and created this automation to change them all at once. This currently supports the following switches:
LZW30 - Black On/Off
LZW30-SN - Red On/Off
LZW31 - Black Dimmer
LZW31-SN - Red Dimmer
LZW36 - Light/Fan Combo
VZW31-SN - Red 2-in-1
VZM31-SN - Blue 2-in-1
Disclaimer: I only own the Black On/Off, Red Dimmer and On/Off, and Blue 2-in-1. I have not been able to verify this works with the other switch’s but they are set up the same so there shouldn’t be any issue. Please let me know if you have one of these switches and can validate they function properly.
name: Inovelli LED Color Change
description: Create automations for Inovelli dimmers and switches to set their LED color. Specific to Z-Wave devices using Z-Wave JS and Zigbee devices using ZHA.
domain: automation
input:
inovelli_dimmer:
name: Inovelli Dimmer
description: List of available Inovelli dimmers.
default: {}
selector:
target:
device:
- integration: zwave_js
manufacturer: Inovelli
model: LZW31-SN
- integration: zwave_js
manufacturer: Inovelli
model: LZW31
inovelli_switch:
name: Inovelli On/Off Switch
description: List of available Inovelli On/Off switches.
default: {}
selector:
target:
device:
- integration: zwave_js
manufacturer: Inovelli
model: LZW30-SN
- integration: zwave_js
manufacturer: Inovelli
model: LZW30
inovelli_fan_light_combo:
name: Inovelli Fan/Light Combo
description: List of available Inovelli fan/fight combo switches.
default: {}
selector:
target:
device:
integration: zwave_js
manufacturer: Inovelli
model: LZW36
inovelli_red_2_in_1:
name: Inovelli Red 2-in-1 Switch
description: List of available Inovelli Red 2-in-1 switches.
default: {}
selector:
target:
device:
integration: zwave_js
manufacturer: Inovelli
model: VZW31-SN
inovelli_blue_2_in_1:
name: Inovelli Blue 2-in-1 Switch
description: List of available Inovelli Blue 2-in-1 switches.
default: []
selector:
target:
device:
integration: zha
manufacturer: Inovelli
model: VZM31-SN
color:
name: Color
description:
"Select the LED Color -
Off: 0 |
Red: 1 |
Orange: 21 |
Yellow: 42 |
Green: 85 |
Cyan: 127 |
Teal: 145 |
Blue: 170 |
Purple: 195 |
Light Pink: 220 |
Pink: 234 |
White: 255"
selector:
number:
min: 0
max: 255
variables:
color: !input color
inovelli_dimmer: !input inovelli_dimmer
inovelli_switch: !input inovelli_switch
inovelli_fan_light_combo: !input inovelli_fan_light_combo
inovelli_red_2_in_1: !input inovelli_red_2_in_1
inovelli_blue_2_in_1: !input inovelli_blue_2_in_1
trigger: []
action:
- choose:
- conditions:
- condition: template
value_template: 'True'
sequence:
repeat:
for_each:
- inovelli_switch
- inovelli_dimmer
- inovelli_fan_light_combo
- inovelli_red_2_in_1
- inovelli_blue_2_in_1
sequence:
choose:
- conditions: "{{ inovelli_dimmer|length > 0 and repeat.item == 'inovelli_dimmer' }}"
sequence:
# Set color for dimmers
- service: zwave_js.multicast_set_value
data:
command_class: '112'
property: '13'
value: "{{ color }}"
target: !input inovelli_dimmer
- conditions: "{{ inovelli_switch|length > 0 and repeat.item == 'inovelli_switch' }}"
sequence:
# Set color for switches
- service: zwave_js.multicast_set_value
data:
command_class: '112'
property: '5'
value: "{{ color }}"
target: !input inovelli_switch
- conditions: "{{ inovelli_fan_light_combo|length > 0 and repeat.item == 'inovelli_fan_light_combo' }}"
sequence:
# Set color for Fan/Light combo light
- service: zwave_js.multicast_set_value
data:
command_class: '112'
property: '18'
value: "{{ color }}"
target: !input inovelli_fan_light_combo
- conditions: "{{ inovelli_fan_light_combo|length > 0 and repeat.item == 'inovelli_fan_light_combo' }}"
sequence:
# Set color for Fan/Light combo fan
- service: zwave_js.multicast_set_value
data:
command_class: '112'
property: '20'
value: "{{ color }}"
target: !input inovelli_fan_light_combo
- conditions: "{{ inovelli_red_2_in_1|length > 0 and repeat.item == 'inovelli_red_2_in_1' }}"
sequence:
# Set color for Red 2-in-1 on
- service: zwave_js.multicast_set_value
data:
command_class: '112'
property: '95'
value: "{{ color }}"
target: !input inovelli_red_2_in_1
# Set color for Red 2-in-1 off
- service: zwave_js.multicast_set_value
data:
command_class: '112'
property: '96'
value: "{{ color }}"
target: !input inovelli_red_2_in_1
- conditions: "{{ inovelli_blue_2_in_1|length > 0 and repeat.item == 'inovelli_blue_2_in_1' }}"
sequence:
- repeat:
for_each: "{{ inovelli_blue_2_in_1.device_id }}"
sequence:
# Set color for Blue 2-in-1 off
- service: zha.set_zigbee_cluster_attribute
data:
cluster_type: in
endpoint_id: 1
cluster_id: 64561
attribute: 96
manufacturer: "4655"
ieee: >
{{ (device_attr(repeat.item, "identifiers")|list).0.1 }}
value: "{{ color }}"
# Set color for Blue 2-in-1 on
- service: zha.set_zigbee_cluster_attribute
data:
cluster_type: in
endpoint_id: 1
cluster_id: 64561
attribute: 95
manufacturer: "4655"
ieee: >
{{ (device_attr(repeat.item, "identifiers")|list).0.1 }}
value: "{{ color }}"
EDIT
I’ve added support for the Blue 2-in-1 Switches using ZHA and fixed the Red’s not updating the ON state. I’ve preserved the ZWaveJS blueprint and uploaded a new blueprint containing both ZWaveJS and ZHA which is linked here. Both files are located on my github.
Neat! Is it possible to do something like this to change multiple configuration parameters at once on multiple switches? I would love some way to not have to manually make changes on every switch.
It absolutely is. The LED colors are set using various Z-Wave Configuration items depending on the switch. This could easily be modified to set a different configuration value.
I appreciate the suggestion. I may look into that route in the future but at this moment I think having to jump through the extra hoops of getting the multicast parameter added to the devices and the additional configuration that is involved complicates this a it too much. The purpose of this was to make bulk changing the LED colors as easy as possible.
But thank you for providing that link. I found the information very informative and it’s definitely planted some seeds for future projects! I can see it being very useful for more frequent calls that what this project is intended for.
I don’t think you actually need to change too much (certainly not adding any of the parameters to the devices anymore). Roughly speaking (I’ve not tested this, but copied from my notes), you should be able to convert each of your service calls like this:
You’ll also want to update it to pass in the list of entities/devices directly rather than iterating through them. Totally doesn’t make sense for a one off bulk update, but adding the example here since it may help someone else in the future.
The reason I needed to iterate through them is because if a variable was blank the automation would stop at that line and wouldn’t proceed to the next group. So for example if you only have 2-in1 switches when it went to update the first set of switches in the code, the dimmers, it would stop because inovelli_dimmer was blank.
I admittedly didn’t finish reading the entire thread and wasn’t aware you didn’t need parameter 16 that was mentioned and used earlier on. I’ll test this out and see if I can get it to work. Thanks!
Oops sorry, I copy and pasted incorrectly. This time I actually tested my work and added some comments.
service: zwave_js.multicast_set_value
data:
command_class: "112" // tells it that you are changing a configuration property
property: "13" // configuration property id number
value: 170 // color to set the property to
target:
entity_id: light.office_lights // list of entities goes here
Is the command class a universal item value? Meaning its the same value between different devices? As opposed to the config property that is a different value depending on the device.
I will second the suggestion for using multicast, it makes a MASSIVE difference in speed.
One other suggestion I would make is to make this a script blueprint instead of an automation blueprint. All the other blueprints for Inovelli LED’s are scripts. And with many people having blues along side their reds, it would be much easier to create an automation with whatever trigger wanted, and then call this script + blue script to change all of them at once.