[Z2M] Inovelli Blue Series Switch LED Notification Script (VZM31-SN, VZM35-SN)

A blueprint script to control the LED notification bar on the Inovelli Blue Series Switches. This is based on the Inovelli Z-Wave Red Series Notification LED script.

Features

  • Creates a script that can be reused for any supported Inovelli switch
    • All parameters are passed when calling the script rather than during configuration
  • Select one or multiple devices, entities, floors, areas, and/or labels with Inovelli switches
  • Selectors for LED Number, Color, Brightness Level, Effect, and Duration
  • LED Number, Color, Effect, and Duration can accept direct values or the “friendly name” listed in the dropdown
  • Debug info to diagnose issues
    • Warning: Debug mode will create a persistent notification for every entity called plus 1

Requirements

Changes

Follow Re-importing a blueprint to update

Expand to view

2024.10.0

Fix Area and Device Labels

  • Add area and device scanning for labels

2024.8.0

Payload Template Deprecation

  • Change payload_template to payload in mqtt.publish call

2024.4.0

Floor and Label Support

  • Add support for Floors and Labels
  • Use device identifier instead of device name for Z2M
    • This should fix needing to use command path map for oddly named devices
    • Command path map is still available if needed
  • Add Command base path
    • This is used when the base MQTT path for Z2M has been changed
  • Command base path and command path map are available as blueprint inputs
    • This allows setting a “default” value for these settings

2023.10.3

Model ID fix

  • Fix changing the model IDs in the last update that broke the script

2023.10.2

Update model filter to only model numbers

  • This fixes the fan switch not working with the latest Zigbee herdsman converters

2023.10.1

Add Fan Switch, Optimize Loop, Cleanup

  • Add support for the “Inovelli Fan Controller (VZM35-SN)”
  • Optimize looping over multiple entities
  • Remove entity_id from fields/parameters
    • Use target: entity_id: <entity> instead
  • Remove “Off” option from “Color” and “Duration”
    • Use “Effect” instead
    • “Off” values are still accepted, just not selectable from the fields
  • Change “Brightness level” default from 40 to 100
  • Sort the “Effect” to group similar effects together

2023.3.1

MQTT Path Override

  • Add Command Path Map
    • This is used to override the MQTT path for a specified entity

2022.11.2

Refactor and Fixes

  • Add target selector
    • Choose multiple areas, devices, and entities
    • The entity_id field still works
  • Default values changed
    • Effect - “Slow Blink” > “Clear”
    • Color - “Yellow” > “Red”
  • Fix the LED number
    • Zigbee2MQTT expects 0-6, not 1-7
    • All is now -1 (was 0)
  • Allow direct value for effect using the friendly name is no longer required
  • Force lowercase on the conversion of fields and parameters
  • Allow 100 parallel runs (was 10)
  • Update Debug info
    • Overall info: entity list, entity count, led, color, level, effect, duration
    • Each entity: entity, device name, topic, payload
    • Warning: Debug mode will create a persistent message for every entity called!

2022.11.1

  • Initial version

Add the Blueprint

Import Blueprint

Example

  • Click the “Import Blueprint” button above
    • Click Preview, then Import Blueprint
  • Click “Create Script” from the Blueprint
    1. Select an icon (ex. mdi:led-on)
    2. Choose Entity ID (ex. inovelli_blue_led_zigbee2mqtt)
      • This will automatically be created from the name if you don’t enter anything
    3. (Optional) Set defaults for Command base path and mapping if needed
      • These options will be used whenever the script is ran
    4. Save
  • The script should now be available to Home Assistant

When using the UI to create a script from the blueprint, ensure you have script.yaml included in your configuration.yaml

Adding Blueprint Without UI

You can add this script manually if you do not use the UI for scripts by using the following yaml

  • Click the “Import Blueprint” button above
    • Click Preview, then Import Blueprint
  • Add the following yaml to wherever you keep script yaml
inovelli_blue_led:
  alias: Inovelli Blue LED (Zigbee2MQTT)
  description: Set LED effects for Inovelli VZM31-SN Blue Series 2-1 Switches
  use_blueprint:
    path: zanix/inovelli_blue_led_zigbee2mqtt.yaml
    input:
      command_path_map: {}
  icon: mdi:led-on
  mode: parallel
  max: 100

Update the Blueprint

Follow the official instructions on Re-importing a blueprint

(Optional) Allow Parallel Runs

By default, Home Assistant creates a blueprint script with mode set to single and max will be defaulted to 10
You may want to change these so the script can run with more than a single instance
Alternatively, you can create multiple script instances from the blueprint, but I would not suggest this.

  1. Go to Settings > Automations & Scenes > Scripts
  2. Find the script “Inovelli Blue LED (Zigbee2MQTT)” if you didn’t change the name) and click on it
  3. Click the 3-dot menu and select “Edit YAML”
  4. Change mode: single to mode: parallel
  5. Add max: 100 below mode: parallel
  6. Save the Script

Using the Script

Instead of using the Blueprint inputs to set the LED values, you set the values whenever you call the script. This way you do not have to create a new script for every different set of values you want to set the LED to.

Testing with Developer Tools > Services

In Automations
  • Settings > Automations
    • Choose “Call Service” for the action and select “Inovelli Blue LED (Zigbee2MQTT)” or the name you gave the script

UI Action (Lovelace)
  • Add any element that can use “Action”
  • Choose “Call Service” for the action and select “Inovelli Blue LED (Zigbee2MQTT)” or the name you gave the script

Blueprint Settings

These options can be set when configuring the Blueprint and the script will use these values as “defaults” whenever the script is called.

  • Command base path
    • Set the base path for the MQTT command path. This is zigbee2mqtt by default.
    • This can be used to set the base MQTT path if it is changed in Zigbee2MQTT.
  • Command path map
    • Map of Entity IDs with a MQTT command path map when HA and Z2M do not match up.

    • Enter the entity_id of the light entity of the switch and the command_topic copied from the device and paste it into the “Command Path Map” field

      light.entity_name: "zigbee2mqtt/path/to/device/set"
      
    • How to find the command path

      • Settings > Devices > MQTT (click on “## Devices”) > DEVICE NAME
      • Click on “More Info” and expand “Payload”
      • Find command_topic and copy the value

Thanks

@BrianHanifin - Original “Inovelli Z-Wave Red Series Notification LED” script
@kschlichter - Logic for multiple areas, devices, and entities
@romamix - Idea to override MQTT command path
@diegomorales17 - Loop optimization ideas
@nmbgeek - Fix for payload_template deprecation

Direct Link to Blueprint

6 Likes

I am looking for something exactly like this but I neither know how to get it to work nor how it works. There is nowhere a way to configure the switch(es) and all the parameters.

Can you share how to use this blueprint? In “Blueprints” I select “CREATE SCRIPT”. Do I need to enter anything in “Entity ID”? What exactly?

Then in blueprint it just says “Set LED effects for Inovelli Blue 2-in-1 switches.” and “This blueprint doesn’t have any inputs.”.

Thanks!

When you create the script, you can enter anything for the Name, Icon, and Entity ID.
I suggest leaving the name as the default, mdi:led-on for LED, and inovelli_blue_led_zigbee2mqtt for the Entity ID.
Once you click save, this script should be available to call from Developer Tools > Services and from an automation.

I’ll update the post above with more detailed instructions.

1 Like

Aah now I see how that works. Thanks!

One small suggestion: It would be great if there would be a way to group multiple lights together. For example, to create a lights group with all Inovelli switches and use the group as entity (this doesn’t seem to work right now).

I am planning on using this script in many different locations and right now I have to enumerate all my 20 switches manually. If I were to add some I need to update many different places.

1 Like

Good idea, I think I could figure out how to iterate over a group.

3 Likes

You could use reuse my code based on functions like area_entities to iterate through areas. As devices are installed and assigned to areas they’re automatically picked up in existing automations.

2022.11.2

Refactor and Fixes

  • Add target selector
    • Choose multiple areas, devices, and/or entities
    • The entity_id field still works
  • Default values changed
    • Effect - “Slow Blink” > “Clear”
    • Color - “Yellow” > “Red”
  • Fix the LED number
    • Zigbee2MQTT expects 0-6, not 1-7
    • All is now -1 (was 0)
  • Allow direct value for effect, using the friendly name is no longer required
  • Force lowercase on the conversion of fields and parameters
  • Allow 100 parallel runs (was 10)
  • Update Debug info
    • Overall info: entity list, entity count, led, color, level, effect, duration
    • Each entity: entity, device name, topic, payload
    • Warning: Debug mode will create a persistent message for every entity called in the script!
3 Likes

Thanks, your script helped a ton!

1 Like

Good. I’m glad. :slight_smile:

Is anyone else experiencing 2-5 second delays with the Inoveli Blue and Scene Control?
This isn’t specifically related to this blueprint as the same behavior occurs using a manual automation.

My button press delay is set to 300ms and the button press registers as an action in z2m within that time period but my automation (toggling a light in this case) doesn’t happen until 3-5 seconds after the button press.

I have a handheld zigbee remote on my network and the delay is much faster, almost instant which makes me believe this is an issue with the Inoveli Blue itself?

I did when I had the defective batch of switches. Now that I got the replacements I’ve had no delay issues.

1 Like

Is there a chance you can add an optional MQTT topic target? I have custom friendly names which don’t match the MQTT topics, so unfortunately I can’t use the blueprint. As an example, zigbee2mqtt/living_room/lights/west_light is manually renamed to “West Light” to control it with Alexa. If I can type living_room/lights/west_light in a target manually, I think that may help :slight_smile:

I renamed my lights in Z2M instead so the MQTT topic would be zigbee2mqtt/Family Room
You could add an override to the path but then you would only be able to target a single switch per call.
What would be nice if I could get the value of command_topic from the device directly.

I would like to check something.

Could you go to:

  • Settings > Devices > MQTT (click on “## Devices”) > DEVICE (West Light in your case)
  • Click on “More Info” and expand “Payload”
  • Copy and paste the contents of “Payload” here

This is what mine looks like.

availability:
  - topic: zigbee2mqtt/bridge/state
    value_template: '{{ value_json.state }}'
  - topic: zigbee2mqtt/Family Room/availability
    value_template: '{{ value_json.state }}'
availability_mode: all
brightness: true
brightness_scale: 254
command_topic: zigbee2mqtt/Family Room/set
device:
  identifiers:
    - zigbee2mqtt_0x385000000000002d
  manufacturer: Inovelli
  model: Inovelli 2-in-1 switch + dimmer (VZM31-SN)
  name: Family Room
  sw_version: '2.08'
name: Family Room
schema: json
state_topic: zigbee2mqtt/Family Room
unique_id: 0x385000000000002d_light_zigbee2mqtt
platform: mqtt
2 Likes

Here it is:

availability:
  - topic: zigbee2mqtt/bridge/state
    value_template: '{{ value_json.state }}'
brightness: true
brightness_scale: 254
command_topic: zigbee2mqtt/living_room/lights/west_light/set
device:
  identifiers:
    - zigbee2mqtt_0x94deb8fffe4c1105
  manufacturer: Inovelli
  model: Inovelli 2-in-1 switch + dimmer (VZM31-SN)
  name: Living Room West Light
  sw_version: '2.08'
name: Living Room West Light
schema: json
state_topic: zigbee2mqtt/living_room/lights/west_light
unique_id: 0x94deb8fffe4c1105_light_zigbee2mqtt
platform: mqtt

Your command_topic is way different than mine. How did you change the path and add location and domain?

I think I can add a text area to create a custom map of light.switch: "z2m_path" that way the script can still control multiple switches at once.

1 Like

My whole device name consists of location/type/name, I don’t use the location field in Z2M. It allows me to use some wildcards based on the device type, like zigbee2mqtt/+/lights/+ (in my case I use it to make any light switch turn off all the lights in a selected room with a double tap down).

I primarily use it in Node-RED, but I guess I will have to further continue exploring it for the effects and if/then scenarios too :smiley:

image

Ah, good idea.

I have the blueprint updated on my Github. There is a new field called “Command Path Map”
You can enter the light entity and provide the mqtt path and the script should use it for the topic path.
Like this:

light.west_light: "zigbee2mqtt/living_room/lights/west_light/set"
light.east_light: "zigbee2mqtt/living_room/lights/east_light/set"
1 Like

Hmm, so now if I’m trying to create a script based on the blueprint, I can see the following:

Message malformed: extra keys not allowed @ data['fields']['enable_debug']['command_path_map']

Oops, I had an extra indentation there…dang yaml.
Redownload it the blueprint.