Open pessorrusso opened 1 year ago
For those looking for a copy-paste fix, I have a mix of the LZW31 and VZW31 in my house and this worked:
`blueprint: name: Inovelli LED notification script description: >- A script that displays a notification on an Inovelli dimmer, switch, or fan combo switch. domain: script source_url: https://github.com/brianhanifin/home-assistant-config/blob/master/blueprints/script/brianhanifin/inovelli_led_notify.yaml
input: input_entity: name: Entity description: Inovelli devices to notify. selector: entity: domain:
Indefinitely variables:
debug: false
entity_list: !input input_entity color: !input input_color level: !input input_level effect: !input input_effect duration: !input input_duration
parameters: "dimmer": 16 "combo_light": 24 "combo_fan": 25 "switch": 8 "dimmer800": 99 colors: "Off": 0 "Red": 1 "Orange": 21 "Yellow": 42 "Green": 85 "Cyan": 127 "Teal": 145 "Blue": 170 "Purple": 195 "Light Pink": 220 "Pink": 234 "White": 255 durations: "Off": 0 "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 "10 Minutes": 70 "15 Minutes": 75 "30 Minutes": 90 "45 Minutes": 105 "1 Hour": 120 "2 Hours": 122 "Indefinitely": 255 effects_dimmer: "Off": 0 "Solid": 1 "Chase": 2 "Fast Blink": 3 "Slow Blink": 4 "Blink": 4 "Pulse": 5 "Breath": 5 effects_switch: "Off": 0 "Solid": 1 "Fast Blink": 2 "Slow Blink": 3 "Blink": 3 "Pulse": 4 "Breath": 4 mode: parallel sequence:
repeat: for_each: "{{ entity_list }}" sequence:
variables:
model_name: | {%- set model_name = device_attr(repeat.item, "model") %} {%- if "-" in model_name %} {{ model_name.split("-")[0] }} {%- else %} {{ model_name }} {%- endif %}
model_type: | {%- if model_name is string %} {%- if "LZW31" in model_name %} dimmer {%- elif "VZW31" in model_name %} dimmer800 {%- elif "LZW36" in model_name %} combo_light {%- else %} switch {%- endif %} {%- else %} dimmer {%- endif %} parameter: "{{ parameters[model_type|lower]|int(default=0) }}" effect: | {% if model_type == "switch" %} {{- effects_switch[effect|default("Blink")|title] }} {%- else %} {{- effects_dimmer[effect|default("Blink")|title] }} {% endif %} inovelli_math: | {%- if effect|int(default=0) > 0 %} {%- if model_type == "dimmer800" %} {{ (duration|int(default=0) + (level|int(default=0) 256) + color|int(default=0) 65536) + (effect|int(default=0) 16777216) }} {%- else %} {{ color|int(default=0) + (level|int(default=0) 256) + (duration|int(default=0) 65536) + (effect|int(default=0) 16777216) }} {%- endif %} {%- else %} 0 {% endif %}
conditions:
service: persistent_notification.create data: title: "DEBUG: script.inovelli_led" message: | input_entity: {{ input_entity }} input_color: {{ input_color }} input_level: {{ input_level }} input_effect: {{ input_effect }} input_duration: {{ input_duration }}
model_name: {{ model_name }}
model_type: {{ model_type }}
color: {{ color|title }}
level: {{ level }}
duration: {{ duration|title }}
effect: {{ effect|title }}'
parameter: {{ parameter }}
inovelli_math: {{ inovelli_math }}
The new 2-1 dimmer/switch (800 series) the parameter is different(99) and the math variables order is also different (duration/level/color/effect instead of color/duration/level/effect).
More details here.