Last active
April 4, 2021 00:13
-
-
Save mattsch/b2bee64fc08f8c7c49628d35197e2c80 to your computer and use it in GitHub Desktop.
Invovelli LED Effects for Z-Wave JS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This requires the updated configs from node-zwave-js v6.6.3 or greater which | |
# is in zwavejs2mqtt v2.4.0 and addon-zwavejs2mqtt v0.8.0. | |
inovelli_led_control: | |
alias: Inovelli LED Control | |
description: Sets the LED effects for the Inovelli Red series of switches, dimmers, | |
and fan combo controllers. To turn off the effect, set the model to the proper | |
device type and the effect variable to 'off'. | |
fields: | |
duration: | |
description: Duration, from 1-255. Defaults to 255 which is indefinite. | |
example: '255' | |
combo_target: | |
description: For the fan/light combo switch (lzw36). Can be light or fan, | |
only needed if the device is a combo switch. | |
example: fan | |
color: | |
description: Color for the LED. Can be red (default), orange, yellow, green, | |
cyan, teal, blue, purple, light pink, pink, or white. | |
example: red | |
effect: | |
description: LED effect. Varies based on the device type. All support off (default), | |
solid, fast blink, slow blink, and pulse. Dimmer and combo also support chase. | |
example: pulse | |
brightness: | |
description: LED brightness, from 1-10 with 3 as the default. (optional) | |
example: '3' | |
entities: | |
description: One or more entities to control. | |
example: switch.dining_room,light.porch | |
variables: | |
duration: '255' | |
brightness: '3' | |
color: red | |
effect: 'off' | |
param_prefix: >- | |
{% if combo_target == "light" %} | |
Light LED Effect | |
{% elif combo_target == "fan" %} | |
Fan LED Effect | |
{% else %} | |
LED Effect | |
{% endif %} | |
sequence: | |
- service: zwave_js.set_config_parameter | |
data: | |
parameter: '{{ param_prefix }} Type' | |
value: '{{ effect | title }}' | |
target: | |
entity_id: '{{ entities }}' | |
- condition: template | |
value_template: '{{ (effect | lower) != "off" }}' | |
- service: zwave_js.set_config_parameter | |
target: | |
entity_id: '{{ entities }}' | |
data: | |
parameter: '{{ param_prefix }} Brightness' | |
value: '{{ brightness }}' | |
- service: zwave_js.set_config_parameter | |
data: | |
parameter: '{{ param_prefix }} Color' | |
value: '{{ color | title }}' | |
target: | |
entity_id: '{{ entities }}' | |
- service: zwave_js.set_config_parameter | |
data: | |
parameter: '{{ param_prefix }} Duration' | |
value: '{{ duration }}' | |
target: | |
entity_id: '{{ entities }}' | |
mode: parallel | |
max: 20 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This requires creating the input_number helper, range should be 1-254 since 255 means indefinate. | |
- platform: template | |
sensors: | |
inovelli_duration_calc: | |
friendly_name: Inovelli Duration | |
value_template: >- | |
{% set dur = states('input_number.inovelli_duration') | int %} | |
{% if dur <= 60 %} | |
{{ dur }}s | |
{% elif 60 < dur <= 120 %} | |
{{ dur - 60 }}m | |
{% elif 120 < dur <= 144 %} | |
{{ dur - 120 }}h | |
{% elif dur > 144 %} | |
{% set d = dur - 120 %} | |
{% set days = (d / 24) | int %} | |
{% set hours = (d % 24) | int %} | |
{{ days }}d, {{ hours}}h | |
{% endif %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment