Inovelli Red On/Off and Dimmer Actions

Tags: #<Tag:0x00007fc4111ba0d0> #<Tag:0x00007fc4111b9fb8> #<Tag:0x00007fc4111b9ea0> #<Tag:0x00007fc4111b9dd8>

Description

I created a Blueprint to easily map the various button actions (or “scenes” as Inovelli calls them) for both the Inovelli Red On/Off Switch (LZW30-SN) and Inovelli Red Dimmer Switch (LZW31-SN).

I couldn’t find an existing blueprint for these switches when using the stable zwave integration (not the OZW beta).

This supports all the actions the switches support: On/Off press, hold, release, x2, x3, x4, x5, and config button.

The Blueprint

Non-gist version:

blueprint:
  name: Inovelli Red On/Off or Dimmer Switch Scenes
  description:
    Perform actions on various scenes supported by the Inovelli Red On/Off or Dimmer Switches.
    Note that the x2, x3, x4, x5 variants DO NOT work if you have put your switch in 'Instant On' mode.
  domain: automation
  input:
    inovelli_switch:
      name: Inovelli Red On/Off Switch
      description: The Inovelli Red On/Off or Dimmer Switch to do actions on
      selector:
        entity:
          domain: zwave

    up_action:
      name: Press Up Once Action
      description: Action to perform when pressing up once
      default: []
      selector:
        action:
    down_action:
      name: Press Down Once Action
      description: Action to perform when pressing down once
      default: []
      selector:
        action:

    up_hold_action:
      name: Hold Up Action
      description: Action to perform when holding the up button
      default: []
      selector:
        action:
    up_release_action:
      name: Release Up Action
      description: Action to perform when releasing the up button
      default: []
      selector:
        action:

    down_hold_action:
      name: Hold Down Action
      description: Action to perform when holding the down button
      default: []
      selector:
        action:
    down_release_action:
      name: Release Down Action
      description: Action to perform when releasing the down button
      default: []
      selector:
        action:

    config_action:
      name: Config Button Action
      description: The action to perform when the config button is pressed once
      default: []
      selector:
        action:

    up_x2_action:
      name: Press Up Twice Action
      description: Action to perform when pressing up twice
      default: []
      selector:
        action:
    down_x2_action:
      name: Press Down Twice Action
      description: Action to perform when pressing down twice
      default: []
      selector:
        action:

    up_x3_action:
      name: Press Up 3 Times Action
      description: Action to perform on when pressing up 3 times
      default: []
      selector:
        action:
    down_x3_action:
      name: Press Down 3 Times Action
      description: Action to perform when pressing down 3 times
      default: []
      selector:
        action:

    up_x4_action:
      name: Press Up 4 Times Action
      description: Action to perform when pressing up 4 times
      default: []
      selector:
        action:
    down_x4_action:
      name: Press Down 4 Times Action
      description: Action to perform when pressing down 4 times
      default: []
      selector:
        action:

    up_x5_action:
      name: Press Up 5 Times Action
      description: Action to perform when pressing up 5 times
      default: []
      selector:
        action:
    down_x5_action:
      name: Press Down 5 Times Action
      description: Action to perform when pressing down 5 times
      default: []
      selector:
        action:

mode: parallel
max_exceeded: silent

variables:
  # Mappings from https://support.inovelli.com/portal/en/kb/articles/how-to-setting-up-scenes-in-home-assistant
  
  # Buttons (scene_id)
  down_button: 1
  up_button: 2
  config_button: 3

  # Action types (scene_data)
  press_x1: 7680
  press_x2: 7860
  press_x3: 7920
  press_x4: 7980
  press_x5: 8040
  hold: 7800
  release: 7740

  # Shorthand to access the trigger data
  button: "{{ trigger.event.data.scene_id }}"
  action_type: "{{ trigger.event.data.scene_data }}"

trigger:
  - platform: event
    event_type: zwave.scene_activated
    event_data:
      entity_id: !input inovelli_switch

action:
  choose:
    - conditions: "{{ button == up_button }}"
      sequence:
        - choose:
            - conditions: "{{ action_type == press_x1 }}"
              sequence: !input up_action
            - conditions: "{{ action_type == press_x2 }}"
              sequence: !input up_x2_action
            - conditions: "{{ action_type == press_x3 }}"
              sequence: !input up_x3_action
            - conditions: "{{ action_type == press_x4 }}"
              sequence: !input up_x4_action
            - conditions: "{{ action_type == press_x5 }}"
              sequence: !input up_x5_action
            - conditions: "{{ action_type == hold }}"
              sequence: !input up_hold_action
            - conditions: "{{ action_type == release }}"
              sequence: !input up_release_action
    - conditions: "{{ button == down_button }}"
      sequence:
        - choose:
            - conditions: "{{ action_type == press_x1 }}"
              sequence: !input down_action
            - conditions: "{{ action_type == press_x2 }}"
              sequence: !input down_x2_action
            - conditions: "{{ action_type == press_x3 }}"
              sequence: !input down_x3_action
            - conditions: "{{ action_type == press_x4 }}"
              sequence: !input down_x4_action
            - conditions: "{{ action_type == press_x5 }}"
              sequence: !input down_x5_action
            - conditions: "{{ action_type == hold }}"
              sequence: !input down_hold_action
            - conditions: "{{ action_type == release }}"
              sequence: !input down_release_action
    - conditions: "{{ button == config_button and action_type == press_x1 }}"
      sequence: !input config_action

I’m happy to take any feedback or suggestions on this blueprint.

Usage

Inputs

The Switch

  • inovelli_switch (Note, this is the zwave domain entity for your switch, not the switch entity)

Actions

  • up_action
  • down_action
  • up_hold_action
  • up_release_action
  • down_hold_action
  • down_release_action
  • config_action
  • up_x2_action
  • down_x2_action
  • up_x3_action
  • down_x3_action
  • up_x4_action
  • down_x4_action
  • up_x5_action
  • down_x5_action

Example

- alias: Front Switch Leave House
  use_blueprint:
    path: inovelli_red_on_off_or_dimmer_scenes.yaml
    input:
      inovelli_switch: zwave.front_yard_switch
      config_action:
        - service: script.turn_on
          entity_id: script.leaving_house
      down_hold_action:
        - service: script.turn_on
          entity_id: script.leaving_house
1 Like

For some reason I’m not able to import this from the URL of this post.

I included backtick x3 yaml and the formatting looks good, but it won’t import and I get this error:

while scanning a simple key in "<unicode string>", line 182, column 1: </code></pre> ^ could not find expected ':' in "<unicode string>", line 183, column 1: <h1>Usage</h1> ^

Any ideas?

For now, I’ve edited to use a gist instead.

For those who are on OZW instead of zwave integration, just change line 14 to “light”:

Thanks for this @Khalos

Forgive me as I am still new to Home Assistant and learning the language.
I was using Hubitat before and had different scenes setup for different taps on the switch.

I have followed this blueprint, but not able to get it to execute.

Here is a copy of my YAML File - Any suggestions on what I can change to get this to work ?

alias: Inovelli Red On/Off or Dimmer Switch Scenes
description: ‘’
use_blueprint:
path: kylezimmerman/inovelli_red_on_off_or_dimmer_scenes.yaml
input:
inovelli_switch: zwave.inovelli_unknown_type_0001_id_0001
up_x2_action:
- type: turn_on
device_id: 03130ed177cfffae4d70bd23eb2abc35
entity_id: light.inovelli_unknown_type_0001_id_0001_level
domain: light
brightness_pct: 35
- type: turn_on
device_id: 387cbb42d4d8a9afbbade80c6d16432c
entity_id: light.inovelli_unknown_type_0001_id_0001_level_3
domain: light
brightness_pct: 35
- type: turn_on
device_id: 387cbb42d4d8a9afbbade80c6d16432c
entity_id: light.inovelli_unknown_type_0001_id_0001_level_3
domain: light
brightness_pct: 35

Looks promising - but my LZW30-SNs don’t show up in the Entity drop-down (no entities found). I’m on HassOS running the ‘native’ ZWaveJS integration/add-on. I tried hopping over to the ZWaveJS2MQTT add-on but still no luck (didn’t uninstall/reinstall the integration - might have been an issue). Are there any add-on etc. dependencies required to get this to discover the switches?

@badmin,

This was originally meant for the original built in zwave integration (that’s now “deprecated”). It’s also compatible with the OpenZWave addon (that’s now abandoned I guess?) with a small tweak.

I haven’t had a chance to play around with the new ZWaveJS integration yet, it didn’t support all of my devices when it was first announced so I was going to wait for it to be more stable before moving over. The “deprecated” Z-Wave integration is the only one that’s been totally solid for me, so I’ve had no reason to change it.

That said, I’d really like to modify this blueprint to support all of the 3 official ways to run z-wave on HA. If anyone who is running ZWaveJS would like to contribute I’d be more than happy, otherwise I can take a look when I have some time myself.

1 Like

Nice, @Khalos, appreciate the (duh) clarification. I’m a recent "Smart"Things convert (2ish months) - started on OZW but quickly moved to ZWaveJS before I got in too deep. Imo, JS is ‘ready’ - super fast, stable, and now covers my bases (simple environment = mostly switches, a few outlets, and a Linear garage door). Main gap for me is the lack of config UI - pending (this team is moving crazy-fast), and the JS2MQTT add-on solves that gap in the interim if you’re so inclined.

I’m betting @kylerw’s OZW->JS blueprint provides a nice head start - seems the primary difference is mapping text identifiers (e.g. “KeyPressed”) instead of scene_data identifiers (e.g. 7680). Add the long-press identifier and you’re there. That and aligning the switch-name ZwaveJS identifier. These blueprints are still ‘foreign territory’ for me, but as with all things HASS I’m sure it just takes a few cycles to get familiar / proficient. Will see if I can burn a weekend cycle or two in the near future.

Oh man after a couple day long struggle I finally have my new Inovelli switches working the way that I want.

I was able too update this blueprint for ZwaveJS entirely, and I also added the button configs for holding the up or down button down.

If anyone has any other requests reply to me here and I’ll try and update it!

Github Gist

blueprint:
  name: Inovelli Red Series LZW30-SN Switch (ZWave-JS)
  description: Create automations for the Inovelli Red Series LZW30-SN Switch using the ZWave-JS integration.
  domain: automation
  input:
    zwave_device:
      name: Inovelli Switch
      description: "List of available inovelli LZW30-SN switch."
      selector:
        device:
          integration: zwave_js
          manufacturer: Inovelli
    ## Config Press 1 time
    config_button:
      name: Button C - Config press 1x
      description: "Action to run, when the config button is pressed one time."
      default: []
      selector:
        action:
    ### Up Button Actions###
    ## Paddle Press 1 time
    button_a:
      name: Button A - Up/On press 1x
      description: "Action to run, when the button is pressed one time."
      default: []
      selector:
        action:
    ## Paddle Press 2 times
    button_a2:
      name: Button A - Up/On press 2x
      description: "Action to run, when the button is pressed two times."
      default: []
      selector:
        action:
    ## Paddle Press 3 times
    button_a3:
      name: Button A - Up/On press 3x
      description: "Action to run, when the button is pressed three times."
      default: []
      selector:
        action:
    ## Paddle Press 4 times
    button_a4:
      name: Button A - Up/On press 4x
      description: "Action to run, when the button is pressed four times."
      default: []
      selector:
        action:
    ## Paddle Press 5 times
    button_a5:
      name: Button A - Up/On press 5x
      description: "Action to run, when the button is pressed five times."
      default: []
      selector:
        action:
    ## Paddle Hold
    button_a6:
      name: Button A - Up/On Hold
      description: "Action to run, when the button is held down."
      default: []
      selector:
        action:

    ### Down Button Actions ###
    ## Paddle Press 1 time
    button_b:
      name: Button B - Down/Off press 1x
      description: "Action to run, when the button is pressed one time."
      default: []
      selector:
        action:
    ## Paddle Press 2 times
    button_b2:
      name: Button B - Down/Off press 2x
      description: "Action to run, when the button is pressed two times."
      default: []
      selector:
        action:
    ## Paddle Press 3 times
    button_b3:
      name: Button B - Down/Off press 3x
      description: "Action to run, when the button is pressed three times."
      default: []
      selector:
        action:
    ## Paddle Press 4 times
    button_b4:
      name: Button B - Down/Off press 4x
      description: "Action to run, when the button is pressed four times."
      default: []
      selector:
        action:
    ## Paddle Press 5 times
    button_b5:
      name: Button B - Down/Off press 5x
      description: "Action to run, when the button is pressed five times."
      default: []
      selector:
        action:
    ## Paddle Hold
    button_b6:
      name: Button B - Down/Off Hold
      description: "Action to run, when the button is held down."
      default: []
      selector:
        action:
mode: single
max_exceeded: silent
variables:
  device_id: !input zwave_device
trigger:
  - platform: event
    event_type: zwave_js_value_notification
condition: "{{ trigger.event.data.device_id == device_id }}"
action:
  - variables:
      button_id: "{{ trigger.event.data.property_key_name }}"
      press_count: "{{ trigger.event.data.value }}"
  - service: "logbook.log"
    data:
      name: "Button Id"
      message: "{{ button_id }}"
  - service: "logbook.log"
    data:
      name: "Press Count"
      message: "{{ press_count }}"
  - service: "logbook.log"
    data:
      name: "Device"
      message: "{{ zwave_device }}"
  - choose:
      - conditions: '{{ button_id == "003" and press_count == "KeyPressed" }}'
        sequence: !input config_button
      - conditions: '{{ button_id == "002" and press_count == "KeyPressed" }}'
        sequence: !input button_a
      - conditions: '{{ button_id == "001" and press_count == "KeyPressed" }}'
        sequence: !input button_b
      - conditions: '{{ button_id == "002" and press_count == "KeyPressed2x" }}'
        sequence: !input button_a2
      - conditions: '{{ button_id == "001" and press_count == "KeyPressed2x" }}'
        sequence: !input button_b2
      - conditions: '{{ button_id == "002" and press_count == "KeyPressed3x" }}'
        sequence: !input button_a3
      - conditions: '{{ button_id == "001" and press_count == "KeyPressed3x" }}'
        sequence: !input button_b3
      - conditions: '{{ button_id == "002" and press_count == "KeyPressed4x" }}'
        sequence: !input button_a4
      - conditions: '{{ button_id == "001" and press_count == "KeyPressed4x" }}'
        sequence: !input button_b4
      - conditions: '{{ button_id == "002" and press_count == "KeyPressed5x" }}'
        sequence: !input button_a5
      - conditions: '{{ button_id == "001" and press_count == "KeyPressed5x" }}'
        sequence: !input button_b5
      - conditions: '{{ button_id == "002" and press_count == "KeyHeldDown" }}'
        sequence: !input button_a6
      - conditions: '{{ button_id == "001" and press_count == "KeyHeldDown" }}'
        sequence: !input button_b6

This looks nice. Does anyone know how to use this to Dim lights when held up or down?

This is actually the next thing on my to-do list.

I think you have to create a scene that translations the brightness to your desired value (0 or 255) over a set amount of time. Then activate the scene whenever the button is held down.

If anyone has any more direction on how to accomplish this let me know! Otherwise Ill start messing with it in the coming week.