Skip to content

Instantly share code, notes, and snippets.

@mattleiphamellis
Last active January 23, 2024 02:46
Show Gist options
  • Save mattleiphamellis/87136d48d6a22e179c60bae21f19a9d6 to your computer and use it in GitHub Desktop.
Save mattleiphamellis/87136d48d6a22e179c60bae21f19a9d6 to your computer and use it in GitHub Desktop.
blueprint:
name: Control Light with Zooz ZEN37 Wall Remote & Scene Controller
description: For Zooz ZEN37. Toggle a light with a single press, set it to max brightness with double-tap, night-light mode with hold.
domain: automation
input:
zooz_switch:
name: Zooz Switch
description: List of available Zooz ZEN37 switches.
selector:
device:
integration: zwave_js
# manufacturer: Zooz
# model: ZEN37
target_light:
name: Light
description: The light to link to button
selector:
target:
entity:
domain: light
scene_button:
name: Scene Button
description: The button to link to light
selector:
select:
mode: dropdown
options:
- label: Scene 1 (Upper Large)
value: '001'
- label: Scene 2 (Lower Large)
value: '002'
- label: Scene 3 (Bottom Left)
value: '003'
- label: Scene 4 (Bottom Right)
value: '004'
night_light_brightness:
name: Night Light Brightness
description: Brightness to set lights to when button is held (default 20%)
default: 20
selector:
number:
min: 0
max: 100
unit_of_measurement: "%"
mode: single
max_exceeded: silent
variables:
controller_id: !input 'zooz_switch'
light_id: !input 'target_light'
button_id: !input 'scene_button'
night_light_brightness: !input 'night_light_brightness'
trigger:
- platform: event
event_type: zwave_js_value_notification
condition: '{{ trigger.event.data.device_id == controller_id and trigger.event.data.property_key_name == button_id }}'
action:
- variables:
property_key_name: '{{ trigger.event.data.property_key_name }}'
label: '{{ trigger.event.data.label }}'
command_class_name: '{{ trigger.event.data.command_class_name }}'
value: '{{ trigger.event.data.value }}'
- service: logbook.log
data:
name: 'Z-Wave JS'
message: 'received event: {{ command_class_name }} - {{ value }} - {{ label }}'
- choose:
- conditions: '{{ value == ''KeyPressed'' }}'
sequence:
- service: light.toggle
data: {}
target: !input 'target_light'
- conditions: '{{ value == ''KeyPressed2x'' }}'
sequence:
- service: light.turn_on
data:
brightness_pct: 100
target: !input 'target_light'
- conditions: '{{ value == ''KeyHeldDown'' }}'
sequence:
- service: light.turn_on
data:
brightness_pct: '{{ night_light_brightness }}'
target: !input 'target_light'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment