Skip to content

Instantly share code, notes, and snippets.

@Pharylon
Last active April 13, 2022 00:18
Show Gist options
  • Save Pharylon/79d651858062b593dcef0564ce3dec8e to your computer and use it in GitHub Desktop.
Save Pharylon/79d651858062b593dcef0564ce3dec8e to your computer and use it in GitHub Desktop.
Zooz ZEN34
blueprint:
name: Zooz ZEN34 Remote scene control
description: |
Use the Zooz ZEN34 remote to trigger Scenes and control devices based on varying scenes.
This Blueprint is currently configured for the zwaveJS platform.
domain: automation
input:
zwave_device:
name: Zooz Zen34
description: "List of available Zooz ZEN34 switch."
selector:
device:
integration: zwave_js
manufacturer: Zooz
model: ZEN34
1x_tap_up:
name: Tap up 1x
selector:
action:
default: []
1x_tap_down:
name: Tap down 1x
selector:
action:
default: []
2x_tap_up:
name: Tap up 2x
selector:
action:
default: []
2x_tap_down:
name: Tap down 2x
selector:
action:
default: []
3x_tap_up:
name: Tap up 3x
selector:
action:
default: []
3x_tap_down:
name: Tap down 3x
selector:
action:
default: []
4x_tap_up:
name: Tap up 4x
selector:
action:
default: []
4x_tap_down:
name: Tap down 4x
selector:
action:
default: []
5x_tap_up:
name: Tap up 5x
selector:
action:
default: []
5x_tap_down:
name: Tap down 5x
selector:
action:
default: []
hold_up:
name: Hold up
selector:
action:
default: []
hold_down:
name: Hold down
selector:
action:
default: []
mode: single
variables:
logger: blueprint.zwave_scene_activation
device_id: !input zwave_device
trigger:
- platform: event
event_type: zwave_js_value_notification
action:
- choose:
# IF triggered node_id is zwave_nodeid
- conditions:
- condition: template
value_template: "{{ trigger.event.data.device_id == device_id }}"
sequence:
- choose:
# IF 1x tap up
- conditions:
- condition: template
value_template: "{{ trigger.event.data.label == 'Scene 001' and trigger.event.data.value == 'KeyPressed' }}"
sequence: !input 1x_tap_up
# IF 1x tap down
- conditions:
- condition: template
value_template: "{{ trigger.event.data.label == 'Scene 002' and trigger.event.data.value == 'KeyPressed' }}"
sequence: !input 1x_tap_down
# IF 2x tap up
- conditions:
- condition: template
value_template: "{{ trigger.event.data.label == 'Scene 001' and trigger.event.data.value == 'KeyPressed2x' }}"
sequence: !input 2x_tap_up
# IF 2x tap down
- conditions:
- condition: template
value_template: "{{ trigger.event.data.label == 'Scene 002' and trigger.event.data.value == 'KeyPressed2x' }}"
sequence: !input 2x_tap_down
# IF 3x tap up
- conditions:
- condition: template
value_template: "{{ trigger.event.data.label == 'Scene 001' and trigger.event.data.value == 'KeyPressed3x' }}"
sequence: !input 3x_tap_up
# IF 3x tap down
- conditions:
- condition: template
value_template: "{{ trigger.event.data.label == 'Scene 002' and trigger.event.data.value == 'KeyPressed3x' }}"
sequence: !input 3x_tap_down
# IF 4x tap up
- conditions:
- condition: template
value_template: "{{ trigger.event.data.label == 'Scene 001' and trigger.event.data.value == 'KeyPressed4x' }}"
sequence: !input 4x_tap_up
# IF 4x tap down
- conditions:
- condition: template
value_template: "{{ trigger.event.data.label == 'Scene 002' and trigger.event.data.value == 'KeyPressed4x' }}"
sequence: !input 4x_tap_down
# IF 5x tap up
- conditions:
- condition: template
value_template: "{{ trigger.event.data.label == 'Scene 001' and trigger.event.data.value == 'KeyPressed5x' }}"
sequence: !input 5x_tap_up
# IF 5x tap down
- conditions:
- condition: template
value_template: "{{ trigger.event.data.label == 'Scene 002' and trigger.event.data.value == 'KeyPressed5x' }}"
sequence: !input 5x_tap_down
# IF hold up
- conditions:
- condition: template
value_template: "{{ trigger.event.data.label == 'Scene 001' and trigger.event.data.value == 'KeyHeld' }}"
sequence: !input hold_up
# IF hold down
- conditions:
- condition: template
value_template: "{{ trigger.event.data.label == 'Scene 002' and trigger.event.data.value == 'KeyHeld' }}"
sequence: !input hold_down
# ELSE: unhandled label/value
default:
- service: system_log.write
data:
level: debug
logger: "{{ logger }}"
message: "Activated scene '{{ trigger.event.data.scene_label }}' ({{ trigger.event.data.label }}) with value '{{ trigger.event.data.scene_value_label }}' ({{ trigger.event.data.value }}) for node '{{ zwave_nodeid }}' ({{ trigger.event.data.node_id }})"
# ELSE: unhandled zwave event
default: []
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment