Skip to content

Instantly share code, notes, and snippets.

@crkochan
Last active January 16, 2024 05:06
Show Gist options
  • Save crkochan/9509828318411a86871c7746a856efd6 to your computer and use it in GitHub Desktop.
Save crkochan/9509828318411a86871c7746a856efd6 to your computer and use it in GitHub Desktop.
blueprint:
name: Aeotec ZWA003 NanoMote Quad
description: Create automations for the Aeotec ZWA003 NanoMote Quad.
domain: automation
input:
aeotec_nanomote:
name: Aeotec NanoMote Quad
description: The NanoMote Quad to interact with.
selector:
device:
integration: zwave_js
manufacturer: Aeotec Ltd.
model: ZWA003
button_1_press:
name: Button One - Short press
description: Action when the button one is pressed.
default: []
selector:
action: {}
button_1_hold:
name: Button One - Long press
description: Action when the button one is held.
default: []
selector:
action: {}
button_1_release:
name: Button One - Release
description: Action when the button one is released.
default: []
selector:
action: {}
button_2_press:
name: Button Two - Short press
description: Action when the button two is pressed.
default: []
selector:
action: {}
button_2_hold:
name: Button Two - Long press
description: Action when the button two is held.
default: []
selector:
action: {}
button_2_release:
name: Button Two - Release
description: Action when the button two is released.
default: []
selector:
action: {}
button_3_press:
name: Button Three - Short press
description: Action when the button three is pressed.
default: []
selector:
action: {}
button_3_hold:
name: Button Three - Long press
description: Action when the button three is held.
default: []
selector:
action: {}
button_3_release:
name: Button Three - Released
description: Action when the button three is released.
default: []
selector:
action: {}
button_4_press:
name: Center Button - Short press
description: Action when the center button is pressed.
default: []
selector:
action: {}
button_4_hold:
name: Center Button - Long press
description: Action when the center button is held.
default: []
selector:
action: {}
button_4_release:
name: Center Button - Released
description: Action when the center button is released.
default: []
selector:
action: {}
mode: single
max_exceeded: silent
variables:
# Buttons (scene_id)
button_1: "001"
button_2: "002"
button_3: "003"
button_4: "004"
# Action types (scene_value_id)
press: "KeyPressed"
hold: "KeyHeldDown"
release: "KeyReleased"
# Shorthand to access the trigger data
button: '{{ trigger.event.data.property_key_name }}'
action_type: '{{ trigger.event.data.value }}'
device_id: '{{ trigger.event.data.device_id }}'
trigger:
- platform: event
event_type: zwave_js_value_notification
event_data:
command_class_name: Central Scene
device_id: !input aeotec_nanomote
action:
- variables:
button_is: "{{ button }}"
action_type_is: "{{ action_type }}"
device_id_is: "{{ device_id }}"
- choose:
- conditions: "{{ button == button_1 }}"
sequence:
- choose:
- conditions: "{{ action_type == press }}"
sequence: !input button_1_press
- conditions: "{{ action_type == hold }}"
sequence: !input button_1_hold
- conditions: "{{ action_type == release }}"
sequence: !input button_1_release
- conditions: "{{ button == button_2 }}"
sequence:
- choose:
- conditions: "{{ action_type == press }}"
sequence: !input button_2_press
- conditions: "{{ action_type == hold }}"
sequence: !input button_2_hold
- conditions: "{{ action_type == release }}"
sequence: !input button_2_release
- conditions: "{{ button == button_3 }}"
sequence:
- choose:
- conditions: "{{ action_type == press }}"
sequence: !input button_3_press
- conditions: "{{ action_type == hold }}"
sequence: !input button_3_hold
- conditions: "{{ action_type == release }}"
sequence: !input button_3_release
- conditions: "{{ button == button_4 }}"
sequence:
- choose:
- conditions: "{{ action_type == press }}"
sequence: !input button_4_press
- conditions: "{{ action_type == hold }}"
sequence: !input button_4_hold
- conditions: "{{ action_type == release }}"
sequence: !input button_4_release
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment