Inovelli Z-Wave Red Series Notification LED

Also managed to extend my first script, which is yours, @BrianHanifin :slight_smile: I added a random colour.

Here’s my working script that anyone can paste into the YAML script editor inside the HA UI.

Scripts > New Script > Click the Kebab (three dots) > Edit as YAML
data_template:
  node_id: '{{ state_attr(entity_id,"node_id") }}'
  parameter: >
    {%- set dimmer = dimmer|default('true') %} {{ "16" if dimmer == "true" else
    "8" }}
  size: 4
  value: >
    {# Skip the calculations for effect = "off". #} {% if effect|title == "Off"
    %}
      0
    {% else %}
      {# Set default values if any needed values are missing. #}
      {% set color = color|default("Yellow") %}
      {% set level = level|default(4) %}{# 1-10 #}
      {% set duration = duration|default("Indefinitely") %}
      {% set effect = effect|default("Pulse") %}
      {# Let's make things easy by using descriptive text instead of hard to understand numbers. #}
      {% set colors = {
        "Red": 1,
        "Orange": 21,
        "Green": 85,
        "Blue": 170,
        "Pink": 234,
        "Yellow": 42,
        "Cyan": 127,
        "Purple": 195,
        "Random": range(1, 255) | random
      } %}
      {% set durations = {
        "1 Second": 1,
        "2 Seconds": 2,
        "3 Seconds": 3,
        "4 Seconds": 4,
        "5 Seconds": 5,
        "6 Seconds": 6,
        "7 Seconds": 7,
        "8 Seconds": 8,
        "9 Seconds": 9,
        "10 Seconds": 10,
        "15 Seconds": 15,
        "20 Seconds": 20,
        "25 Seconds": 25,
        "30 Seconds": 30,
        "35 Seconds": 35,
        "40 Seconds": 40,
        "45 Seconds": 45,
        "50 Seconds": 50,
        "55 Seconds": 55,
        "60 Seconds": 60,
        "2 Minutes": 62,
        "3 Minutes": 63,
        "4 Minutes": 64,
        "15 Minutes": 75,
        "30 Minutes": 90,
        "45 Minutes": 105,
        "1 Hour": 120,
        "2 Hours": 122,
        "Indefinitely": 255
      } %}
      {% set effects = {
        "Off": 0,
        "Solid": 1,
        "Chase": 2,
        "Fast Blink": 3,
        "Slow Blink": 4,
        "Blink": 4,
        "Pulse": 5,
        "Breath": 5
      } %}
      {# Preform the Inovelli mind bending mathmatics automatically for us! :) #}
      {{ colors[color|title] + (level * 256) + (durations[duration|title] * 65536) + (effects[effect|title] * 16777216) }}
    {% endif %}
service: zwave.set_config_parameter

1 Like

Heads up this script won’t work with OZW because the model name is not an attribute on the entity, it’s on the device. I’m not sure if there’s a way to get that data from the script.

Did you just do this recently? I think the recent update to 113 moved the folders around. Now it’s python 3.8 but the /site-packages/ folder is no longer there. Also searching using find / -type d -iname ozw_config doesn’t find anything either…
Anyone know where it got moved so i can add the config there?

Are you using docker, or something else? In the 113.3 image I’m running I have:

bash-5.0# ls -lh /usr/local/lib/python3.8/site-packages/python_openzwave/ozw_config/manufacturer_specific.xml 
-rw-r--r--    1 root     root      138.9K Aug  1 06:44 /usr/local/lib/python3.8/site-packages/python_openzwave/ozw_config/manufacturer_specific.xml

It’s docker on top of pi4. The standard install with hassio etc:

pi@raspberrypi:~ $ sudo docker exec -it hassio_supervisor /bin/bash
bash-5.0# ls -lh /usr/local/lib/python3.8/site-packages/python_openzwave/ozw_config/manufacturer_specific.xml
ls: /usr/local/lib/python3.8/site-packages/python_openzwave/ozw_config/manufacturer_specific.xml: No such file or directory
bash-5.0#

I have /usr/local/lib/python3.8/site-packages but i don’t have python_openzwave in there. I remember doing these steps a few versions back, when it was on 3.7 still and it did work.

I just migrated my Z-Wave devices to the new OZW integration. The revisions to the original script required are fairly simple. Change service: zwave.set_config_parameter to service: ozw.set_config_parameter and remark out the size: 4 line (e.g. #size: 4). Oh, and instead of passing an entity_id that begins with zwave., just pass the light. entity instead as OZW doesn’t provide zwave. entities.

Below is my current version of the script, including a couple of ideas from @ kschlichter’s version. However, the Product name is not

1 Like

Frankly, I’m just guessing now. I don’t have a pi4 I can put hassio on, but instead of ‘find / -type d -iname ozw_config’ try ‘find / -iname manufacturer_specific.xml’ and that might provide a clue. If python_openzwave isn’t in /usr/local/lib/python3.8/site-packages, what is? Maybe it’s named differently in hassio?

That’s the funny thing I tried that, Inovelli, ozw, python_openzwave nothing comes up

So I wanted to try this out… but I’m having trouble getting this to work consistently. In y’all’s experience, is there some sort of timeout feature on this where you can’t call the service more than once in a certain amount of time?

I feel like I can get it to work once for a duration and then when I try to get it to work to test a second time, there’s no response. Any ideas?

Thank You! Works great on my LZW30-SN Red Switch!

1 Like

There doesn’t seem to be one that I’ve encountered. I haven’t tested rapid updates to a single switch though. For me there’s generally 10 seconds or more before updating the same switch.

That’s interesting. When I test the notification light (i.e. 5 second duration) with the services tab under dev tools, I am unable to replicate 10 seconds after unless I change a variable. Same thing with automations. For instance, if I have the light blink for 5 seconds after, say the door sensor is activated, I’ll wait 5 minutes or so, and try to repeat the process, and it won’t work. :confused:

That should work. Are there any errors in the logs? Which version of the script are you using? What does your automation look like?

No errors showing up in the logs. Just if I hit “call service” consecutively, nothing happens. I’m using @BrianHanifin’s latest version of the OZW script. I had tried using the one posted on your git, but I kept getting this argument of type 'NoneType is not iterable error when calling the service.

My automation was just a super simple one I created in the UI to test the functionality.

- alias: Door OPEN after 10pm
  description: ''
  trigger:
  - device_id: 1c2fbe13fc0c47afa4367cc2dd81a20c
    domain: binary_sensor
    entity_id: binary_sensor.aeotec_back_sensor_backdoor
    for:
      hours: 0
      minutes: 10
      seconds: 0
    platform: device
    type: turned_on
  condition:
  - after: '22:00:00'
    before: '6:00:00'
    condition: time
  action:
  - data:
      color: Red
      duration: Indefinitely
      effect: Chase
      entity_id: switch.living_room_light
      level: 10
    service: script.inovelli_led
  mode: restart

I had gotten rid of all the conditions and set the duration to like 10s at one point, but I seemingly can’t get it to work multiple times in a row.


Even when I use Devtools > Services and script.inovelli_led

color: Green
duration: 10 Seconds
effect: Chase
entity_id: switch.office_light
level: 10

I’ll call the service once and it will work, but unless I change say “green” to “red,” I can’t get it to work a consecutive time after the green stops blinking. It’s really odd.

*Forgot to mention, this is on my LZW30-SN on/off

Kind of a dumb question, I havent worked with scripts much, can I just drop script.inovellie_led.yaml into my config folder and have it show up as a callable service or do I need to add anything to my configuration.yaml? Do i need to restart HA after dropping it in?

It’s not a dumb question. In comment 37 RarelyComplete made one that you can past into the UI editor. To keep it in its own file, I put mine in scripts/inovelli_switch_leds.yaml and then in my configuration.yaml I have the line “script: !include_dir_named scripts” as per https://www.home-assistant.io/docs/configuration/splitting_configuration/

2 Likes

The chase effect should look something like the light bar on the front of Knight Rider, if you’re as old as I am, or the eyes on the Cylon soldiers in the Battlestar Galactica reboot. Play with the Inovelli toolbox (link below) to see it on the LZW31-SN. The LZW30-SN on/off switch only has a single LED, not the LED bar, so the chase effect is invalid. Take a look at my spreadsheet (below). If you send Red, Indefinitely, Chase, 10 to an LZW30-SN I believe it should be interpreted as a fast blink, since that seems to hold the value “2” for effects in the math. Is that what it’s doing for you? You might also try adding “mode: parallel” to your script and automation, in case it’s defaulting to one of the other modes (script modes linked below). That might be why your script isn’t running a second time, but if my understanding is correct, your script (or service call) would also have to still be running which means something else has gone wrong. This doesn’t sound like what’s happening, but it’s worth playing with just to be sure.

If you’re using BrianHanifin’s latest version, I guess you’re on the new OZW beta, which is an added layer of unfamiliarity for me. I haven’t moved to the beta, and I don’t know how that might impact things. Sorry I don’t have an answer, but maybe something here will get you going in the right direction.

Inovelli toolbox: https://nathanfiscus.github.io/inovelli-notification-calc/

Inovelli math with LZW30-SN:

LZW31-SN and LZW36 Dimmers Color Level Duration Effect
Red 10 Indefinitely Chase Config Value
1 2560 16711680 33554432 50268673
LZW30-SN Switch Color Level Duration Effect
Red 10 Indefinitely Fast Blink Config Value
1 2560 16711680 33554432 50268673

Script modes: https://www.home-assistant.io/integrations/script/#script-modes

Does it flash green for 10 seconds and then turn back to the default color, or does it keep flashing?

Yes, essentially Chase shows up as a fast blink on the LZW30 switches. If I call a “color: green” service, the light will flash green for 10 seconds and then change back to the default color. When I look at my logbook, it looks like it shows the correct on/off sequence.

10:44:54 AM
inovelli_led turned off (Jen)
10:44:54 AM
inovelli_led turned on (Jen)
10:44:54 AM
inovelli_led started (Jen)

I’ve tried adding mode: parallel and also mode: restart in the past with no difference. It will 100% work consecutive times IF I change a variable. So I can call a green flash and then a red flash and then a green flash again with no problems. :woman_shrugging:

Kevin, I was looking at this code again, and I figured out a way we could choose the correct service call depending on the entity_id passed. If an entity_id that beings with zwave. is passed, then use zwave.set_config_parameter. However, if a different entity_id type is passed (e.g. light.family_room) then use ozw.set_config_parameter.

  - service_template: |
      {% if entity_id.split(".")[0] == "zwave" %}
        zwave.set_config_parameter
      {% else %}
        ozw.set_config_parameter
      {% endif %}

However, ozw.set_config_parameter does not support the size parameter. So, unless that is optional for the zwave.set_config_parameter command you’d have create a second script to call, which uses a - choose: to call both commands (one with a size, and one without). But it is doable. :slight_smile:

Oh, and for some reason effect #5 “Pulse” doesn’t seem to work since I switched to OZW.

1 Like