Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save bcchenbc/104892e6e09e0798eb9c7d1e7d16e34a to your computer and use it in GitHub Desktop.
Save bcchenbc/104892e6e09e0798eb9c7d1e7d16e34a to your computer and use it in GitHub Desktop.
Blueprint: Set Indicator on a ZEN32 Scene Controller button Based on Light Status
blueprint:
name: Set Indicator Light on Scene Controller
description: For Zooz ZEN32. Sets the indicator color when light is off or dimmed.
domain: automation
input:
zooz_switch:
name: Zooz Switch
description: List of available Zooz ZEN32 switches.
selector:
device:
integration: zwave_js
manufacturer: Zooz
model: ZEN32
target_light:
name: Light
description: The light to link to button
selector:
entity:
domain: light
scene_button:
name: Scene Button
description: The button to link to light
selector:
select:
mode: dropdown
options:
- label: Scene 5 (Big Button)
value: '0' # param 1 for on/off, param 6 for color
- label: Scene 1 (Top Left)
value: '1' # param 2 for on/off, param 7 for color
- label: Scene 2 (Top Right)
value: '2' # param 3 for on/off, param 8 for color
- label: Scene 3 (Bottom Left)
value: '3' # param 4 for on/off, param 9 for color
- label: Scene 4 (Bottom Right)
value: '4' # param 5 for on/off, param 10 for color
off_color:
name: Off Color
description: Color to make indicator when light 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'
dimmed_color:
name: Dimmed Color
description: Color to make indicator when light is dimmed (default blue)
default: Blue
selector:
select:
mode: dropdown
options:
- label: White
value: '0'
- label: Blue
value: '1'
- label: Green
value: '2'
- label: Red
value: '3'
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_value: 3
off_value: 2
off_color: !input 'off_color'
dimmed_color: !input 'dimmed_color'
full_brightness: 255
trigger:
- platform: state
entity_id: !input 'target_light'
attribute: brightness
for:
hours: 0
minutes: 0
seconds: 5
- platform: state
entity_id: !input 'target_light'
action:
- choose:
- conditions: '{{ is_state(light_id, ''off'') }}' # light off, turn on indicator
sequence:
- parallel:
- service: zwave_js.set_config_parameter # set indicator color
data:
parameter: '{{ (button_id | int) + (color_offset | int) }}'
value: '{{ off_color }}'
target:
device_id: '{{ controller_id }}'
- service: zwave_js.set_config_parameter # turn on indicator
data:
parameter: '{{ (button_id | int) + (toggle_offset | int) }}'
value: '{{ on_value }}'
target:
device_id: '{{ controller_id }}'
- conditions: '{{ is_state(light_id, ''on'') and not is_state_attr(light_id, ''brightness'', full_brightness) }}' # light on but dim, show dimmed color
sequence:
- parallel:
- service: zwave_js.set_config_parameter # set indicator color
data:
parameter: '{{ (button_id | int) + (color_offset | int) }}'
value: '{{ dimmed_color }}'
target:
device_id: '{{ controller_id }}'
- service: zwave_js.set_config_parameter # turn on indicator
data:
parameter: '{{ (button_id | int) + (toggle_offset | int) }}'
value: '{{ on_value }}'
target:
device_id: '{{ controller_id }}'
- conditions: '{{ is_state(light_id, ''on'') and is_state_attr(light_id, ''brightness'', full_brightness) }}' # light on all the way, turn off indicator
sequence:
- service: zwave_js.set_config_parameter # turn off indicator
data:
parameter: '{{ (button_id | int) + (toggle_offset | int) }}'
value: '{{ off_value }}'
target:
device_id: '{{ controller_id }}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment