Skip to content

Instantly share code, notes, and snippets.

@halomakes
Last active February 16, 2024 19:20
Show Gist options
  • Save halomakes/b546930b5732331ada31d9b1ae0d925a to your computer and use it in GitHub Desktop.
Save halomakes/b546930b5732331ada31d9b1ae0d925a to your computer and use it in GitHub Desktop.
Blueprint: Control a light with a button on a Zooz ZEN32 Scene Controller
blueprint:
name: Control Light with Scene Controller
description: For Zooz ZEN32. 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 ZEN32 switches.
selector:
device:
filter:
- integration: zwave_js
manufacturer: Zooz
model: ZEN32
- integration: zwave_js
manufacturer: Zooz
model: "ZEN32 800LR"
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 5 (Big Button)
value: '005'
- label: Scene 1 (Top Left)
value: '001'
- label: Scene 2 (Top Right)
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