Skip to content

Instantly share code, notes, and snippets.

@sammcewan
Last active December 21, 2021 05:05
Show Gist options
  • Save sammcewan/b64d6d925c94f17133d8f8384cf0c7b0 to your computer and use it in GitHub Desktop.
Save sammcewan/b64d6d925c94f17133d8f8384cf0c7b0 to your computer and use it in GitHub Desktop.
blueprint:
name: ZWaveJS - Aeotec WallMote Duo scene controller
description: |
Perform actions when Aeotec WallMote Duo buttons are interacted with.
The release action is equivalent to a long tap.
A release action is always triggered after a hold action, which makes
them a bit tricky to use. The hold action is repeated as long as the
button is held down.
domain: automation
input:
zwavejs_device:
name: ZWaveJS Device
description: The Aeotec WallMote Duo controller to listen for events on.
selector:
device:
integration: zwave_js
manufacturer: AEON Labs
model: ZW129
tap_left_actions:
name: Tap Left Actions
selector:
action:
default: []
tap_right_actions:
name: Tap Right Actions
selector:
action:
default: []
release_left_actions:
name: Release Left Actions
selector:
action:
default: []
release_right_actions:
name: Release Right Actions
selector:
action:
default: []
hold_left_actions:
name: Hold Left Actions
selector:
action:
default: []
hold_right_actions:
name: Hold Right Actions
selector:
action:
default: []
mode: single
# If you haven't upgraded to 2021.4.0 or newer yet, you'll need to use this trigger code instead
#trigger:
# - platform: event
# event_type: zwave_js_event
# event_data:
# type: value_notification
trigger:
- platform: event
event_type: zwave_js_value_notification
variables:
logger: blueprint.zwavejs_scene_activation
zwavejs_device: !input zwavejs_device
action:
- choose:
# IF triggered device_id is zwavejs_device id
- conditions:
- condition: template
value_template: "{{ trigger.event.data.device_id == zwavejs_device }}"
- condition: template
value_template: "{{ trigger.event.data.command_class_name == 'Central Scene' }}"
sequence:
- choose:
# IF tap left
- conditions:
- condition: template
value_template: "{{ trigger.event.data.label == 'Scene 001' and trigger.event.data.value == 'KeyPressed' }}"
sequence: !input tap_left_actions
# IF tap right
- conditions:
- condition: template
value_template: "{{ trigger.event.data.label == 'Scene 002' and trigger.event.data.value == 'KeyPressed' }}"
sequence: !input tap_right_actions
# IF release left
- conditions:
- condition: template
value_template: "{{ trigger.event.data.label == 'Scene 001' and trigger.event.data.value == 'KeyReleased' }}"
sequence: !input release_left_actions
# IF release right
- conditions:
- condition: template
value_template: "{{ trigger.event.data.label == 'Scene 002' and trigger.event.data.value == 'KeyReleased' }}"
sequence: !input release_right_actions
# IF hold left
- conditions:
- condition: template
value_template: "{{ trigger.event.data.label == 'Scene 001' and trigger.event.data.value == 'KeyHeldDown' }}"
sequence: !input hold_left_actions
# IF hold right
- conditions:
- condition: template
value_template: "{{ trigger.event.data.label == 'Scene 002' and trigger.event.data.value == 'KeyHeldDown' }}"
sequence: !input hold_right_actions
# ELSE: unhandled scene label/value
default:
- service: system_log.write
data:
level: debug
logger: "{{ logger }}"
message: "Activated scene '{{ trigger.event.data.label }}' with value '{{ trigger.event.data.value }}' for node '{{ zwavejs_device }}' ({{ trigger.event.data.node_id }})"
# ELSE: unhandled zwavejs event
default: []
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment