Skip to content

Instantly share code, notes, and snippets.

@ajsacco
Forked from philk/zen34-blueprint.yaml
Last active December 26, 2021 06:09
Show Gist options
  • Save ajsacco/5b6bf9e874bd9c1904e8d23fc4cfa470 to your computer and use it in GitHub Desktop.
Save ajsacco/5b6bf9e874bd9c1904e8d23fc4cfa470 to your computer and use it in GitHub Desktop.
Zooz Zen34 Home Assistant Blueprint
blueprint:
name: Zooz ZEN34
description: Zooz ZEN34 Switch using the ZWave-JS integration.
domain: automation
input:
zwave_device:
name: Zooz ZEN34
description: "List of available Zooz ZEN34 switch."
selector:
device:
integration: zwave_js
manufacturer: Zooz
model: ZEN34
KeyReleased_Up:
name: Up Released
description: "Action to run, when the button is released."
default: []
selector:
action: {}
KeyReleased_Down:
name: Down Released
description: "Action to run, when the button is released."
default: []
selector:
action: {}
KeyHeld_Up:
name: Up Held
description: "Action to run, when the button is held."
default: []
selector:
action: {}
KeyHeld_Down:
name: Down Held
description: "Action to run, when the button is held."
default: []
selector:
action: {}
KeyPressed_Up:
name: Up press 1x
description: "Action to run, when the button is pressed one time."
default: []
selector:
action: {}
KeyPressed_Down:
name: Down press 1x
description: "Action to run, when the button is pressed one time."
default: []
selector:
action: {}
KeyPressed2x_Up:
name: Up press 2x
description: "Action to run, when the button is pressed two time."
default: []
selector:
action: {}
KeyPressed2x_Down:
name: Down press 2x
description: "Action to run, when the button is pressed two time."
default: []
selector:
action: {}
KeyPressed3x_Up:
name: Up press 3x
description: "Action to run, when the button is pressed three time."
default: []
selector:
action: {}
KeyPressed3x_Down:
name: Down press 3x
description: "Action to run, when the button is pressed three time."
default: []
selector:
action: {}
KeyPressed4x_Up:
name: Up press 4x
description: "Action to run, when the button is pressed four time."
default: []
selector:
action: {}
KeyPressed4x_Down:
name: Down press 4x
description: "Action to run, when the button is pressed four time."
default: []
selector:
action: {}
KeyPressed5x_Up:
name: Up press 5x
description: "Action to run, when the button is pressed five time."
default: []
selector:
action: {}
KeyPressed5x_Down:
name: Down press 5x
description: "Action to run, when the button is pressed five time."
default: []
selector:
action: {}
mode: single
max_exceeded: silent
variables:
device_id: !input zwave_device
trigger:
- platform: event
event_type: zwave_js_value_notification
condition: "{{ trigger.event.data.device_id == device_id }}"
action:
- variables:
button_id: "{{ trigger.event.data.property_key_name }}"
press_count: "{{ trigger.event.data.value }}"
- service: "logbook.log"
data:
name: "Button Id"
message: "{{ button_id }}"
- service: "logbook.log"
data:
name: "Press Count"
message: "{{ press_count }}"
- service: "logbook.log"
data:
name: "Device"
message: "{{ zwave_device }}"
- choose:
- conditions: '{{ button_id == "002" and press_count == "KeyHeldDown" }}'
sequence: !input KeyHeld_Down
- conditions: '{{ button_id == "001" and press_count == "KeyHeldDown" }}'
sequence: !input KeyHeld_Up
- conditions: '{{ button_id == "002" and press_count == "KeyReleased" }}'
sequence: !input KeyReleased_Down
- conditions: '{{ button_id == "001" and press_count == "KeyReleased" }}'
sequence: !input KeyReleased_Up
- conditions: '{{ button_id == "002" and press_count == "KeyPressed" }}'
sequence: !input KeyPressed_Down
- conditions: '{{ button_id == "001" and press_count == "KeyPressed" }}'
sequence: !input KeyPressed_Up
- conditions: '{{ button_id == "002" and press_count == "KeyPressed2x" }}'
sequence: !input KeyPressed2x_Down
- conditions: '{{ button_id == "001" and press_count == "KeyPressed2x" }}'
sequence: !input KeyPressed2x_Up
- conditions: '{{ button_id == "002" and press_count == "KeyPressed3x" }}'
sequence: !input KeyPressed3x_Down
- conditions: '{{ button_id == "001" and press_count == "KeyPressed3x" }}'
sequence: !input KeyPressed3x_Up
- conditions: '{{ button_id == "002" and press_count == "KeyPressed4x" }}'
sequence: !input KeyPressed4x_Down
- conditions: '{{ button_id == "001" and press_count == "KeyPressed4x" }}'
sequence: !input KeyPressed4x_Up
- conditions: '{{ button_id == "002" and press_count == "KeyPressed5x" }}'
sequence: !input KeyPressed5x_Down
- conditions: '{{ button_id == "001" and press_count == "KeyPressed5x" }}'
sequence: !input KeyPressed5x_Up
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment