OpenZWave and HA 0.113 Can Now Change Parameter Values for Automating Light Strip on Red Series

The general guides for automating the LED strip on the red series switches has been to use the service zwave.set_config_parameter. Unfortunately, that service equivalent has been missing from OpenZWave…until now. HA 0.113 has added ozw.set_config_parameter which allows for scripted manipulation of the switch parameters.

The typical method is to creat a script with action type Call Service.
The service is now ozw.set_config_parameter.
And I the script I found from others (I’ll try to update with the source) is: (sorry for formatting, I’m on mobile)
1
data_template:
2
node_id: ‘{{node_id}}’
3
parameter: 8
4
size: 4
5
value: |
6
{% if color is number and color >= 0 and color <= 255 %}
7
{% set hx=color %}
8
{% elif color==“red” %}
9
{% set hx=1 %}
10
{% elif color==“orange” %}
11
{% set hx=21 %}
12
{% elif color==“green” %}
13
{% set hx=85 %}
14
{% elif color==“blue” %}
15
{% set hx=170 %}
16
{% elif color==“pink” %}
17
{% set hx=234 %}
18
{% elif color==“yellow” %}
19
{% set hx=42 %}
20
{% else %}
21
{% set hx=127 %}
22
{% endif %} {% if level is number and level >= 0 and level <= 10 %}
23
{% set lx=level256 %}
24
{% else %}
25
{% set lx = 10
256 %}
26
{% endif %} {% if duration is number %}
27
{% if duration >= 0 and duration <= 255 %}
28
{% set dx = duration65536 %}
29
{% else %}
30
{% set dx = 10
65536 %}
31
{% endif %}
32
{% elif duration == “on” %}
33
{% set dx = 25565536 %}
34
{% else %}
35
{% set dx = 10
65536 %}
36
{% endif %} {% if effect is number and effect >= 0 and effect <= 4 %}
37
{% set ex = effect * 16777216 %}
38
{% elif effect==“off” %}
39
{% set ex = 0 %}
40
{% elif effect==“solid” %}
41
{% set ex = 1 * 16777216 %}
42
{% elif effect==“fast_blink” %}
43
{% set ex = 2 * 16777216 %}
44
{% elif effect==“strobe” %}
45
{% set ex = 2 * 16777216 %}
46
{% elif effect==“slow_blink” %}
47
{% set ex = 3 * 16777216 %}
48
{% else %}
49
{% set ex = 4 * 16777216 %}
50
{% endif %} {{(hx+lx+dx+ex) | int}}

Thanks for posting my Reddit friend!

Good to know! Are there any limitations to setting config parameters too many times?

I was thinking of setting the light strip color instead of using notifications for different scenes but was concerned that this would wear out the switch faster. I was also thinking of setting the default levels depending on the time of day so when the wife gets up at midnight the default is different than if it’s in the middle of the day.

Maybe I am just being paranoid… if config parameters were stored on an internal flash chip in the switch that only had some many writes and I change a config parameter say 2000 times a year, will that be a problem down the road?

This is the approach I’ve been using on Hubitat almost since day 1. I actually control the default led color through Node Red running on HA with my switches on Hubitat.

At first it was out of necessity since the LED notification wouldn’t stick if anybody manipulated the switch. That’s since been fixed through a firmware update but I still prefer this method over the notifications. Using notifications it comes on, then when somebody manipulates the switch it goes back to the default LED colour, then the notification turns on again. That switch from red to fading blue, to solid blue, back to red… drives my OCD insane lol

This is just for the Open Z-Wave 1.6 beta; right?

I’m using the Open Z-Wave 1.4 (Home Assistant’s default integrated Z-Wave) with 113.0 and ‘zwave.set_config_parameter’ still works. I’ve modified BrianHanifin’s script to support the two LED strips on LZW36. I could modify the service to a service_template and pick between zwave.set_config_parameter and ozw.set_config_parameter if there’s a way to detect which is being used.

I haven’t tried out the code myself, but I cleaned it up.

data_template:
node_id: ‘{{node_id}}’
parameter: 8
size: 4
value: |
{% if color is number and color >= 0 and color <= 255 %}
{% set hx=color %}
{% elif color==“red” %}
{% set hx=1 %}
{% elif color==“orange” %}
{% set hx=21 %}
{% elif color==“green” %}
{% set hx=85 %}
{% elif color==“blue” %}
{% set hx=170 %}
{% elif color==“pink” %}
{% set hx=234 %}
{% elif color==“yellow” %}
{% set hx=42 %}
{% else %}
{% set hx=127 %}
{% endif %} {% if level is number and level >= 0 and level <= 10 %}
{% set lx=level256 %}
{% else %}
{% set lx = 10256 %}
{% endif %} {% if duration is number %}
{% if duration >= 0 and duration <= 255 %}
{% set dx = duration65536 %}
{% else %}
{% set dx = 1065536 %}
{% endif %}
{% elif duration == “on” %}
{% set dx = 25565536 %}
{% else %}
{% set dx = 1065536 %}
{% endif %} {% if effect is number and effect >= 0 and effect <= 4 %}
{% set ex = effect * 16777216 %}
{% elif effect==“off” %}
{% set ex = 0 %}
{% elif effect==“solid” %}
{% set ex = 1 * 16777216 %}
{% elif effect==“fast_blink” %}
{% set ex = 2 * 16777216 %}
{% elif effect==“strobe” %}
{% set ex = 2 * 16777216 %}
{% elif effect==“slow_blink” %}
{% set ex = 3 * 16777216 %}
{% else %}
{% set ex = 4 * 16777216 %}
{% endif %} {{(hx+lx+dx+ex) | int}}