Zooz light switch handler for the Z-Wave JS Integration. Requires scene control to be enabled on the switch. Supports all scene events from the switch, and both old and new scene IDs. If the top button is triggering the actions you have on the bottom button, toggle the Old Firmware switch. Optionally can send refresh commands to node IDs on single press and release events to support associated devices that don’t properly report their status back to the controller (now uses the native Z-Wave JS service). Supports pre and post 2021.4 events.
blueprint:
name: 'Zooz Light Switch'
description: Trigger actions from button presses
domain: automation
input:
light_switch:
name: Zooz Light Switch
description: The Zooz Light Switch that will trigger the actions
selector:
device:
integration: zwave_js
manufacturer: Zooz
associations:
name: Refresh Associated Z-Wave Devices
description: "Optional list of entities to refresh after switch is pressed. (Note: you must select an entity and not a device or area)"
default: {}
selector:
target:
entity:
integration: zwave_js
refresh_delay:
name: Refresh Delay
description: Number of seconds to wait after switch press to issue refresh
default: 5
selector:
number:
unit_of_measurement: seconds
mode: box
min: 0
max: 60
old_firmware:
name: Old Firmware
description: Enable if the Up and Down actions are reversed
default: false
selector:
boolean:
press_up_1x:
name: 1x Press Up
description: Pick an action for when the light switch UP button is pressed once.
default:
selector:
action:
press_up_2x:
name: 2x Press Up
description: Pick an action for when the light switch UP button is pressed twice.
default:
selector:
action:
press_up_3x:
name: 3x Press Up
description: Pick an action for when the light switch UP button is pressed three times.
default:
selector:
action:
press_up_4x:
name: 4x Press Up
description: Pick an action for when the light switch UP button is pressed four times.
default:
selector:
action:
press_up_5x:
name: 5x Press Up
description: Pick an action for when the light switch UP button is pressed five times.
default:
selector:
action:
up_held:
name: Up Held
description: Pick an action for when the light switch UP button is held.
default:
selector:
action:
up_released:
name: Up Released
description: Pick an action for when the light switch UP button is released.
default:
selector:
action:
press_down_1x:
name: 1x Press Down
description: Pick an action for when the light switch DOWN button is pressed once.
default:
selector:
action:
press_down_2x:
name: 2x Press Down
description: Pick an action for when the light switch DOWN button is pressed twice.
default:
selector:
action:
press_down_3x:
name: 3x Press Down
description: Pick an action for when the light switch DOWN button is pressed three times.
default:
selector:
action:
press_down_4x:
name: 4x Press Down
description: Pick an action for when the light switch DOWN button is pressed four times.
default:
selector:
action:
press_down_5x:
name: 5x Press Down
description: Pick an action for when the light switch DOWN button is pressed five times.
default:
selector:
action:
down_held:
name: Down Held
description: Pick an action for when the light switch DOWN button is held.
default:
selector:
action:
down_released:
name: Down Released
description: Pick an action for when the light switch DOWN button is released.
default:
selector:
action:
mode: parallel
max: 10
trigger:
- platform: event
event_type: zwave_js_value_notification
event_data:
command_class: 91
device_id: !input "light_switch"
- platform: event
event_type: zwave_js_event
event_data:
command_class: 91
device_id: !input "light_switch"
action:
- variables:
scene_id: "{{ trigger.event.data.property_key_name }}"
scene_value: "{{ trigger.event.data.value }}"
associations: !input associations
old_firmware: !input old_firmware
up_scene: "{% if old_firmware == true %} 002 {% else %} 001 {% endif %}"
down_scene: "{% if old_firmware == true %} 001 {% else %} 002 {% endif %}"
- choose:
- conditions:
- "{{ scene_id == up_scene }}"
- "{{ scene_value == 'KeyPressed' }}"
sequence: !input press_up_1x
- conditions:
- "{{ scene_id == up_scene }}"
- "{{ scene_value == 'KeyPressed2x' }}"
sequence: !input press_up_2x
- conditions:
- "{{ scene_id == up_scene }}"
- "{{ scene_value == 'KeyPressed3x' }}"
sequence: !input press_up_3x
- conditions:
- "{{ scene_id == up_scene }}"
- "{{ scene_value == 'KeyPressed4x' }}"
sequence: !input press_up_4x
- conditions:
- "{{ scene_id == up_scene }}"
- "{{ scene_value == 'KeyPressed5x' }}"
sequence: !input press_up_5x
- conditions:
- "{{ scene_id == up_scene }}"
- "{{ scene_value == 'KeyHeldDown' }}"
sequence: !input up_held
- conditions:
- "{{ scene_id == up_scene }}"
- "{{ scene_value == 'KeyReleased' }}"
sequence: !input up_released
- conditions:
- "{{ scene_id == down_scene }}"
- "{{ scene_value == 'KeyPressed' }}"
sequence: !input press_down_1x
- conditions:
- "{{ scene_id == down_scene }}"
- "{{ scene_value == 'KeyPressed2x' }}"
sequence: !input press_down_2x
- conditions:
- "{{ scene_id == down_scene }}"
- "{{ scene_value == 'KeyPressed3x' }}"
sequence: !input press_down_3x
- conditions:
- "{{ scene_id == down_scene }}"
- "{{ scene_value == 'KeyPressed4x' }}"
sequence: !input press_down_4x
- conditions:
- "{{ scene_id == down_scene }}"
- "{{ scene_value == 'KeyPressed5x' }}"
sequence: !input press_down_5x
- conditions:
- "{{ scene_id == down_scene }}"
- "{{ scene_value == 'KeyHeldDown' }}"
sequence: !input down_held
- conditions:
- "{{ scene_id == down_scene }}"
- "{{ scene_value == 'KeyReleased' }}"
sequence: !input down_released
- choose:
- conditions:
- "{{ (associations|length()) and ((scene_id == up_scene or scene_id == down_scene) and (scene_value == 'KeyPressed' or scene_value == 'KeyReleased'))}}"
sequence:
- delay:
seconds: !input refresh_delay
- service: zwave_js.refresh_value
target: !input associations