[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 single 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, or areas 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

  • Zigbee2MQTT
  • At least 1 Inovelli Blue Series switch added to Z2M and is controllable in Home Assistant
  • Supported Switches:
    • Inovelli 2-in-1 switch + dimmer (VZM31-SN)
    • Inovelli Fan Controller (VZM35-SN)
  • The device name (found in Settings > Devices > MQTT > DeviceName) of the switch entity needs to match the “friendly name” in Zigbee2MQTT
    • This can be overridden if needed
    • 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
    • Enter the entity_id of the light entity and the command_topic copied from the device and paste it into the “Command Path Map” field
      Example:
      light.west_light: "zigbee2mqtt/living_room/lights/west_light/set"
      light.east_light: "zigbee2mqtt/living_room/lights/east_light/set"
      

Changes

Expand to view

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. 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
  icon: mdi:led-on
  mode: parallel
  max: 100

(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

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

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

Direct Link to Blueprint

5 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.