Skip to content

Instantly share code, notes, and snippets.

@claabs
Last active June 11, 2023 19:25
Show Gist options
  • Save claabs/cab00650d819651ff5ba27d5b3110c71 to your computer and use it in GitHub Desktop.
Save claabs/cab00650d819651ff5ba27d5b3110c71 to your computer and use it in GitHub Desktop.
blueprint:
name: Zooz ZEN30 + Bond Fan/Light v1.3
description: Makes double switch act a separate fan and light mode. Mode can be switched by pressing the relay button.
domain: automation
input:
zooz_zen30:
name: Zooz ZEN30
description: The ZEN30 Double Switch to interact with.
selector:
device:
integration: zwave_js
manufacturer: Zooz
model: ZEN30
dimmer_color_value_id:
name: Zooz ZEN30 Dimmer Color value_id
description: The ZEN30 Double Switch Node ID followed by the status value_id e.g. "${NodeId}-112-0-3"
selector:
text:
type: text
dimmer_entity:
name: ZEN30 Dimmer Control Entity
selector:
entity:
filter:
- integration: zwave_js
domain: light
fan_light:
name: Ceiling fan with light
description: The ceiling fan with light controlled through Bond
selector:
device:
integration: bond
increase_brightness_button:
name: Ceiling fan light increase brightness button entity
selector:
entity:
filter:
- integration: bond
domain: button
decrease_brightness_button:
name: Ceiling fan light decrease brightness button entity
selector:
entity:
filter:
- integration: bond
domain: button
stop_actions_button:
name: Ceiling fan light stop actions button entity
selector:
entity:
filter:
- integration: bond
domain: button
mode: single
max_exceeded: silent
trigger:
- platform: event
event_type: zwave_js_value_notification
event_data:
command_class: 91
device_id: !input zooz_zen30
action:
- variables:
scene_id: "{{ trigger.event.data.property_key }}"
keypress_type: "{{ trigger.event.data.value }}"
dimmer_entity: !input dimmer_entity
- choose:
- conditions:
- condition: device
device_id: !input zooz_zen30
domain: zwave_js
value_id: !input dimmer_color_value_id
type: config_parameter
subtype: 3 (LED Indicator Color for Dimmer) on endpoint 0
value: 0
# If the LED is white
sequence:
- choose:
- conditions: "{{ scene_id == '001' }}"
sequence:
- choose:
- conditions: "{{ keypress_type == 'KeyPressed' }}"
sequence:
- service: light.turn_on
data: {}
target:
device_id: !input fan_light
- conditions: "{{ keypress_type == 'KeyHeldDown' }}"
sequence:
- service: button.press
data: {}
target:
entity_id: !input increase_brightness_button
- conditions: "{{ keypress_type == 'KeyReleased' }}"
sequence:
- service: button.press
data: {}
target:
entity_id: !input stop_actions_button
- conditions: "{{ scene_id == '002' }}"
sequence:
- choose:
- conditions: "{{ keypress_type == 'KeyPressed' }}"
sequence:
- service: light.turn_off
data: {}
target:
device_id: !input fan_light
- conditions: "{{ keypress_type == 'KeyHeldDown' }}"
sequence:
- service: button.press
data: {}
target:
entity_id: !input decrease_brightness_button
- conditions: "{{ keypress_type == 'KeyReleased' }}"
sequence:
- service: button.press
data: {}
target:
entity_id: !input stop_actions_button
- conditions: "{{ scene_id == '003' }}"
sequence:
- choose:
- conditions: "{{ keypress_type == 'KeyPressed' }}"
sequence:
# Turn the LED blue
- device_id: !input zooz_zen30
domain: zwave_js
type: set_config_parameter
endpoint: 0
parameter: 3
bitmask: null
subtype: 3 (LED Indicator Color for Dimmer) on endpoint 0
value: 1
- conditions:
- condition: device
device_id: !input zooz_zen30
domain: zwave_js
value_id: !input dimmer_color_value_id
type: config_parameter
subtype: 3 (LED Indicator Color for Dimmer) on endpoint 0
value: 1
# If the LED is blue
sequence:
- choose:
- conditions: "{{ scene_id == '001' }}"
sequence:
- choose:
- conditions: "{{ keypress_type == 'KeyPressed' }}"
sequence:
- service: fan.turn_on
data: {}
target:
device_id: !input fan_light
- conditions: "{{ keypress_type == 'KeyReleased' }}"
sequence:
- service: fan.set_percentage
data:
percentage: "{{ state_attr(dimmer_entity, 'brightness') / 255 * 100 }}"
target:
device_id: !input fan_light
- conditions: "{{ scene_id == '002' }}"
sequence:
- choose:
- conditions: "{{ keypress_type == 'KeyPressed' }}"
sequence:
- service: fan.turn_off
data: {}
target:
device_id: !input fan_light
- conditions: "{{ keypress_type == 'KeyReleased' }}"
sequence:
- service: fan.set_percentage
data:
percentage: "{{ state_attr(dimmer_entity, 'brightness') / 255 * 100 }}"
target:
device_id: !input fan_light
- conditions: "{{ scene_id == '003' }}"
sequence:
- choose:
- conditions: "{{ keypress_type == 'KeyPressed' }}"
sequence:
# Turn the LED white
- device_id: !input zooz_zen30
domain: zwave_js
type: set_config_parameter
endpoint: 0
parameter: 3
bitmask: null
subtype: 3 (LED Indicator Color for Dimmer) on endpoint 0
value: 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment