Last active
November 19, 2024 19:13
-
-
Save sle118/f4663622f210ecf6f11ba903d4e6aef9 to your computer and use it in GitHub Desktop.
Blueprint: Set Indicator on a ZEN32 Scene Controller button Based on Switch Status with on/off state overwrite
This file contains hidden or 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
blueprint: | |
name: Set Indicator Light for SWITCH on Scene Controller with State Overwrite | |
description: For Zooz ZEN32. Sets the indicator color when switch is off or on. | |
domain: automation | |
input: | |
zooz_switch: | |
name: Zooz Switch | |
description: List of available Zooz ZEN32 switches. | |
selector: | |
device: | |
filter: | |
- manufacturer: Zooz | |
model: ZEN32 | |
multiple: false | |
target_light: | |
name: Switch | |
description: The switch to link to button | |
selector: | |
entity: | |
filter: | |
- domain: | |
- switch | |
multiple: false | |
scene_button: | |
name: Scene Button | |
description: The button to link to light | |
selector: | |
select: | |
options: | |
- label: Scene 5 (Big Button) | |
value: '0' | |
- label: Scene 1 (Top Left) | |
value: '1' | |
- label: Scene 2 (Top Right) | |
value: '2' | |
- label: Scene 3 (Bottom Left) | |
value: '3' | |
- label: Scene 4 (Bottom Right) | |
value: '4' | |
custom_value: false | |
multiple: false | |
off_state: | |
name: Off State | |
description: Led state when light is off | |
default: Led On | |
selector: | |
select: | |
options: | |
- label: Led On | |
value: '3' | |
- label: Led Off | |
value: '2' | |
custom_value: false | |
multiple: false | |
off_color: | |
name: State Off Color | |
description: Color for led when switch is off (default white) | |
default: White | |
selector: | |
select: | |
options: | |
- label: White | |
value: '0' | |
- label: Blue | |
value: '1' | |
- label: Green | |
value: '2' | |
- label: Red | |
value: '3' | |
- label: Magenta | |
value: '4' | |
- label: Yellow | |
value: '5' | |
- label: Cyan | |
value: '6' | |
custom_value: false | |
multiple: false | |
on_state: | |
name: On State | |
description: Led state when light is On | |
default: Led On | |
selector: | |
select: | |
options: | |
- label: Led On | |
value: '3' | |
- label: Led Off | |
value: '2' | |
custom_value: false | |
multiple: false | |
on_color: | |
name: State On Color | |
description: Color for led when switch is on (default white) | |
default: White | |
selector: | |
select: | |
options: | |
- label: White | |
value: '0' | |
- label: Blue | |
value: '1' | |
- label: Green | |
value: '2' | |
- label: Red | |
value: '3' | |
- label: Magenta | |
value: '4' | |
- label: Yellow | |
value: '5' | |
- label: Cyan | |
value: '6' | |
custom_value: false | |
multiple: false | |
mode: restart | |
max_exceeded: silent | |
variables: | |
controller_id: !input zooz_switch | |
light_id: !input target_light | |
button_id: !input scene_button | |
toggle_offset: 1 | |
color_offset: 6 | |
on_state: !input on_state | |
on_color: !input on_color | |
off_state: !input off_state | |
off_color: !input off_color | |
trigger: | |
- trigger: state | |
entity_id: !input target_light | |
actions: | |
- delay: "00:00:01" | |
alias: Prevent flooding on dimming | |
- choose: | |
- conditions: '{{ is_state(light_id, ''off'') }}' | |
alias: Set Values for State off | |
sequence: | |
- action: zwave_js.set_config_parameter | |
data: | |
device_id: '{{ controller_id }}' | |
parameter: '{{ (button_id | int) + (color_offset | int) }}' | |
value: '{{ off_color }}' | |
- action: zwave_js.set_config_parameter | |
data: | |
parameter: '{{ (button_id | int) + (toggle_offset | int) }}' | |
value: '{{ off_state }}' | |
device_id: '{{ controller_id }}' | |
- conditions: '{{ is_state(light_id, ''on'') }}' | |
alias: Set Values for State on | |
sequence: | |
- parallel: | |
- action: zwave_js.set_config_parameter | |
data: | |
parameter: '{{ (button_id | int) + (color_offset | int) }}' | |
value: '{{ on_color }}' | |
device_id: '{{ controller_id }}' | |
- action: zwave_js.set_config_parameter | |
data: | |
parameter: '{{ (button_id | int) + (toggle_offset | int) }}' | |
value: '{{ on_state }}' | |
device_id: '{{ controller_id }}' |
Thank You so much for this -- I have been wanting to do this for a while. Wanted to share, that the latest firmware on the ZEN32 adds 3 more colors. I think that I modified your Blueprint accurately, but will have to figure out how to change the Automation I already created with it...as the new colors do not show. Below, I added the three new colors.
blueprint:
name: Set Indicator Light for SWITCH on Scene Controller with State Overwrite
description: For Zooz ZEN32. Sets the indicator color when switch is off or on.
domain: automation
input:
zooz_switch:
name: Zooz Switch
description: List of available Zooz ZEN32 switches.
selector:
device:
integration: zwave_js
manufacturer: Zooz
model: ZEN32
multiple: false
target_light:
name: Switch
description: The switch to link to button
selector:
entity:
domain:
- switch
multiple: false
scene_button:
name: Scene Button
description: The button to link to light
selector:
select:
mode: dropdown
options:
- label: Scene 5 (Big Button)
value: '0'
- label: Scene 1 (Top Left)
value: '1'
- label: Scene 2 (Top Right)
value: '2'
- label: Scene 3 (Bottom Left)
value: '3'
- label: Scene 4 (Bottom Right)
value: '4'
sort: false
custom_value: false
multiple: false
off_state:
name: Off State
description: Led state when light is off
default: Led On
selector:
select:
mode: dropdown
options:
- label: Led On
value: '3'
- label: Led Off
value: '2'
sort: false
custom_value: false
multiple: false
off_color:
name: State Off Color
description: Color for led when switch is off (default white)
default: White
selector:
select:
mode: dropdown
options:
- label: White
value: '0'
- label: Blue
value: '1'
- label: Green
value: '2'
- label: Red
value: '3'
- label: Magenta
value: '4'
- label: Yellow
value: '5'
- label: Cyan
value: '6'
sort: false
custom_value: false
multiple: false
on_state:
name: On State
description: Led state when light is On
default: Led On
selector:
select:
mode: dropdown
options:
- label: Led On
value: '3'
- label: Led Off
value: '2'
sort: false
custom_value: false
multiple: false
on_color:
name: State On Color
description: Color for led when switch is on (default white)
default: White
selector:
select:
mode: dropdown
options:
- label: White
value: '0'
- label: Blue
value: '1'
- label: Green
value: '2'
- label: Red
value: '3'
- label: Magenta
value: '4'
- label: Yellow
value: '5'
- label: Cyan
value: '6'
sort: false
custom_value: false
multiple: false
source_url: https://gist.github.com/sle118/f4663622f210ecf6f11ba903d4e6aef9
mode: single
max_exceeded: silent
variables:
controller_id: !input zooz_switch
light_id: !input target_light
button_id: !input scene_button
toggle_offset: 1
color_offset: 6
on_state: !input on_state
on_color: !input on_color
off_state: !input off_state
off_color: !input off_color
trigger:
- platform: state
entity_id: !input target_light
action:
- choose:
- conditions: '{{ is_state(light_id, ''off'') }}'
sequence:
- parallel:
- service: zwave_js.set_config_parameter
data:
parameter: '{{ (button_id | int) + (color_offset | int) }}'
value: '{{ off_color }}'
target:
device_id: '{{ controller_id }}'
- service: zwave_js.set_config_parameter
data:
parameter: '{{ (button_id | int) + (toggle_offset | int) }}'
value: '{{ off_state }}'
target:
device_id: '{{ controller_id }}'
- conditions: '{{ is_state(light_id, ''on'') }}'
sequence:
- parallel:
- service: zwave_js.set_config_parameter
data:
parameter: '{{ (button_id | int) + (color_offset | int) }}'
value: '{{ on_color }}'
target:
device_id: '{{ controller_id }}'
- service: zwave_js.set_config_parameter
data:
parameter: '{{ (button_id | int) + (toggle_offset | int) }}'
value: '{{ on_state }}'
target:
device_id: '{{ controller_id }}'
Thanks foy this! I updated my blueprint with the new colors, and also moved to the new yaml schema for blueprints
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you for creating this! I'm having an issue where if I set the relay button, for some reason it turns on the LED and makes the switch say it's On even if the switch isnt. This only happens for the relay button