ZHA - Fan speed display on Inovelli Blue Series 2-1 Switch

An automation blueprint to display a fan speed on the LED notification bar on the Inovelli VZM31-SN or VZM35-SN Blue Series 2-1 Switch via ZHA.

The Inovelli VZM31-SN or VZM35-SN Blue Series 2-1 Switch comes with seven (7) LED lights in a strip on the right side of the faceplate (below the small config button). We can display a representation of a fan speed between a minimum and maximum value.

Features

  • Display a fan speed as a percentage between 0 and 100 percent.
  • Customize color (default: red), intensity (default: 50%) and duration (default: always on) of the LED display.

Requirements

  • ZHA
  • An Inovelli VZM31-SN (light) or VZM35-SN (fan) Blue Series 2-1 Switch added to your ZigBee network in Home Assistant
  • A fan in your Home Assistant to pull a speed from

Blueprint

Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled.

blueprint:
  name: Inovelli LED Fan Speed Display
  description: Display the fan speed on the LED strip of an Inovelli VZM35-SN light switch
  source_url: https://raw.githubusercontent.com/nwithan8/configs/main/home_assistant/blueprints/automations/inovelli_led_fan_speed.yaml
  domain: automation
  input:
    fan:
      name: Fan
      description: The fan to monitor
      selector:
        entity:
          domain:
            - fan
          multiple: false
    switch:
      name: Inovelli VZM35-SN
      description: Which light switch to program
      selector:
        device:
          integration: zha
          manufacturer: Inovelli
          model: VZM31-SN
    duration:
      name: Duration
      description: How long the effect should last, in seconds (1-254, 255 for indefinite)
      selector:
        number:
          min: 1
          max: 255
      default: 255
    level:
      name: Intensity
      description: How intense the light should be, percentage (0-100)
      selector:
        number:
          min: 0
          max: 100
      default: 50
    color:
      name: Color
      description: The color the light should be, (0-254, 255 for white)
      selector:
        number:
          min: 0
          max: 255
          mode: box
      default: 0

mode: single
max_exceeded: silent

variables:
  fan: !input fan
  speed: "{{ state_attr(fan, 'percentage') | float(0) | round(1) }}"
  solid_led_effect_code: 1
  off_led_effect_code: 0
  led_command: 3 # Set individual LED
  min_speed: 0
  max_speed: 100
  level: !input level
  duration: !input duration
  switch: !input switch
  color: !input color
  off_color: 255 # White
  speed_range: "{{ max_speed - min_speed }}"
  led_range: 7
  leds_to_turn_on: "{{ (speed - min_speed) / speed_range * led_range | round(0) | int }}"

trigger:
  platform: state
  entity_id: !input fan

action:
  - repeat:
      count: "{{ led_range }}"
      sequence:
        - service: zha.issue_zigbee_cluster_command
          data:
            ieee: >
              {{ (device_attr(switch, "identifiers")|list).0.1 }}
            endpoint_id: 1
            cluster_id: 64561
            cluster_type: in
            command: "{{ led_command }}"
            command_type: server
            # Index starts at 1 like an idiot
            params:
              "led_number": "{{ repeat.index - 1 }}"
              "led_effect": >
                {%- if leds_to_turn_on > 0 and repeat.index - 1 <= leds_to_turn_on -%}
                  {{ solid_led_effect_code }}
                {%- else -%}
                  {{ off_led_effect_code }}
                {%- endif -%}
              "led_color": >
                {%- if leds_to_turn_on > 0 and repeat.index - 1 <= leds_to_turn_on -%}
                  {{ color }}
                {%- else -%}
                  {{ off_color }}
                {%- endif -%}
              "led_level": "{{ level }}"
              "led_duration": "{{ duration }}"
            manufacturer: 4655

Install

  1. Click the “Import Blueprint” button above and follow the instructions to import the blueprint into your Home Assistant.
  2. Click “Create Automation” from the Blueprint.
  3. Select a Fan to monitor. The speed reported by this fan will determine the display on your light switch.
    • This automation will run every time the fan state is updated.
  4. Select a target Inovelli light switch to change the LEDs of.
  5. (Optional) Change the duration, in seconds, of the LED illuminance.
    • By default, the LEDs are always on (255)
  6. (Optional) Change the intensity of the LED illuminance.
    • By default, the LEDs illuminate to 50% brightness
  7. (Optional) Change the color of the LEDs
    • Use this calculator to determine color value.
    • By default, the LEDs are solid red (0)
  8. Click “Save” to save your automation.

Usage

When the speed reported by the selected fan changes, this automation will be triggered, illuminating some or all of the LEDs on the selected Inovelli light switch.

The LEDs illuminate in bottom-up order. The higher the speed, the more LEDs illuminated, and vice versa.

Changelog

  • April 27, 2024: Initial release