plex-configs/home_assistant/blueprints/scripts/inovelli_vzm31-sn_notification_led_zha.yaml
nwithan8 6e1b69d80b - Add additional effects to Inovelli LED script
- Improve effect calculation (a lot cleaner code)
2023-08-10 14:46:28 -06:00

124 lines
3.0 KiB
YAML

# This blueprint will allow you to make one generic script, and pass in all variables, including target switch, effect, colors, etc. on each call.
# Users do NOT need to set up a per-device copy of this script.
blueprint:
name: Inovelli VZM31-SN Notification LED (ZHA)
description: >-
A script that sets the notification LED bar of an Inovelli light switch.
source_url: https://raw.githubusercontent.com/nwithan8/configs/main/home_assistant/blueprints/scripts/inovelli_vzm31-sn_notification_led_zha.yaml
domain: script
fields:
switch:
name: Inovelli VZM31-SN
description: Which light switch to program
required: true
selector:
device:
integration: zha
manufacturer: Inovelli
model: VZM31-SN
effect:
name: Effect
description: Effect to use
required: true
selector:
select:
# 'Chase' is legacy, but still supported (equates to 'Medium Chase')
options:
- "Off"
- "Clear"
- "Solid"
- "Slow Blink"
- "Medium Blink"
- "Fast Blink"
- "Pulse"
- "Aurora"
- "Slow Falling"
- "Medium Falling"
- "Fast Falling"
- "Slow Rising"
- "Medium Rising"
- "Fast Rising"
- "Slow Siren"
- "Fast Siren"
- "Chase"
- "Slow Chase"
- "Medium Chase"
- "Fast Chase"
- "Open-Close"
- "Small-Big"
duration:
name: Duration
description: How long the effect should last, in seconds (1-254, 255 for indefinite)
required: true
selector:
number:
min: 1
max: 255
level:
name: Intensity
description: How intense the light should be, percentage (0-100)
required: true
selector:
number:
min: 0
max: 100
color:
name: Color
description: The color the light should be, (0-254, 255 for white)
required: true
selector:
number:
min: 0
max: 255
variables:
# Main + legacy effects mapping
effect_values:
"off": 0
"clear": 255
"solid": 1
"slow blink": 3
"medium blink": 15
"fast blink": 2
"pulse": 4
"aurora": 8
"slow falling": 9
"medium falling": 10
"fast falling": 11
"slow rising": 12
"medium rising": 13
"fast rising": 14
"chase": 5
"slow chase": 16
"medium chase": 5
"fast chase": 17
"fast siren": 18
"slow siren": 19
"open-close": 6
"small-big": 7
effect: '{{ effect|default("clear") }}'
effect_value: >-
{{ effect_values[effect | lower] | int }}
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: 1
command_type: server
args:
- "{{ effect_value }}"
- "{{ color }}"
- "{{ level }}"
- "{{ duration }}"
manufacturer: 4655
mode: single
max_exceeded: silent