This is a re-write of the blueprint I published yesterday that targeted the depracated Z-Wave integration. This version has some improvements - removed an un-needed variable, improved the target of the event trigger by specifying the command class name, added the KeyReleased event.
blueprint:
name: "Z-Wave JS Scene Controller HANK Electronics SCN04"
description: Create automations for the HANK Electronics SCN04 4 button scene controller using the Z-WAVE JS integration.
domain: automation
input:
scn04:
name: HANK Electronics scene controller
description: "List of available HANK Electronics SCN04 scene controllers."
selector:
device:
integration: zwave_js
manufacturer: HANK Electronics Ltd.
model: SCN04
button_1_press:
name: Button 1 (Moon and Star) - Up/On press 1x
description: "Action to run, when the button is pressed one time."
default: []
selector:
action: {}
button_1_held:
name: Button 1 (Moon and Star) - Held down
description: "Action to run, when the button is held down."
default: []
selector:
action: {}
button_1_released:
name: Button 1 (Moon and Star) - Released
description: "Action to run, when the button is released."
default: []
selector:
action: {}
button_2_press:
name: Button 2 (People) - Up/On press 1x
description: "Action to run, when the button is pressed one time."
default: []
selector:
action: {}
button_2_held:
name: Button 2 (People) - Held down
description: "Action to run, when the button is held down."
default: []
selector:
action: {}
button_2_released:
name: Button 2 (People) - Released
description: "Action to run, when the button is released."
default: []
selector:
action: {}
button_3_press:
name: Button 3 (Circle with Line) - Up/On press 1x
description: "Action to run, when the button is pressed one time."
default: []
selector:
action: {}
button_3_held:
name: Button 3 (Circle with Line) - Held down
description: "Action to run, when the button is held down."
default: []
selector:
action: {}
button_3_released:
name: Button 3 (Circle with Line) - Released
description: "Action to run, when the button is released."
default: []
selector:
action: {}
button_4_press:
name: Button 4 (Circle) - Up/On press 1x
description: "Action to run, when the button is pressed one time."
default: []
selector:
action: {}
button_4_held:
name: Button 4 (Circle) - Held down
description: "Action to run, when/ the button is held down."
default: []
selector:
action: {}
button_4_released:
name: Button 4 (Circle) - Released
description: "Action to run, when/ the button is released."
default: []
selector:
action: {}
mode: single
max_exceeded: silent
trigger:
- platform: event
event_type: zwave_js_value_notification
event_data:
device_id: !input scn04
command_class_name: "Central Scene"
action:
- variables:
scene_id: "{{ trigger.event.data.property_key }}"
action_name: "{{ trigger.event.data.value }}"
- choose:
- conditions: "{{ scene_id == '001' and action_name == 'KeyPressed' }}"
sequence: !input button_1_press
- conditions: "{{ scene_id == '001' and action_name == 'KeyHeldDown' }}"
sequence: !input button_1_held
- conditions: "{{ scene_id == '001' and action_name == 'KeyReleased' }}"
sequence: !input button_1_released
- conditions: "{{ scene_id == '002' and action_name == 'KeyPressed' }}"
sequence: !input button_2_press
- conditions: "{{ scene_id == '002' and action_name == 'KeyHeldDown' }}"
sequence: !input button_2_held
- conditions: "{{ scene_id == '002' and action_name == 'KeyReleased' }}"
sequence: !input button_2_released
- conditions: "{{ scene_id == '003' and action_name == 'KeyPressed' }}"
sequence: !input button_3_press
- conditions: "{{ scene_id == '003' and action_name == 'KeyHeldDown' }}"
sequence: !input button_3_held
- conditions: "{{ scene_id == '003' and action_name == 'KeyReleased' }}"
sequence: !input button_3_released
- conditions: "{{ scene_id == '004' and action_name == 'KeyPressed' }}"
sequence: !input button_4_press
- conditions: "{{ scene_id == '004' and action_name == 'KeyHeldDown' }}"
sequence: !input button_4_held
- conditions: "{{ scene_id == '004' and action_name == 'KeyReleased' }}"
sequence: !input button_4_released
I’ve been hesitating the Z-wave migration to JS, because i could not find any info, how to configure these buttons after the migration. I remember, with the old Z-wave integration it was a pain in the ass editing files and so on.
Now I finally managed to migrate and using this blueprint it became a piece of cake…
Tell me, where can I buy you a beer?
You’re very welcome. This code is based heavily on other people’s work. There are other, older blueprints for this same device. Had I been a bit better at searching I would’ve found their code and not created this.
Blueprints are a great way to consolidate automations and make working with scene controllers a breeze.
Being able to copy a blueprint for another controller and alter it for the specifics of this controller was a great learning experience.
Thanks for this. Just got my Hank scene controller and this helped simplify everything. I have a question though, on my controller, buttons 3 and 4 are reversed, ie, the automation I place on button 3 works when I use button 4 and vice versa. Would you know why?
I just ran into this and corrected the reversed buttons. I just signed up to share my solution, so I am not sure how I would create a link to the Blueprint, but if you add a yaml file to /config/blueprints/automation/homeassistant/ you can copy and paste the script below. Hope it helps!
blueprint:
name: "Z-Wave JS Scene Controller HANK Electronics SCN04"
description: Create automations for the HANK Electronics SCN04 4 button scene controller using the Z-WAVE JS integration.
domain: automation
input:
scn04:
name: HANK Electronics scene controller
description: "List of available HANK Electronics SCN04 scene controllers."
selector:
device:
integration: zwave_js
manufacturer: HANK Electronics Ltd.
model: SCN04
button_1_press:
name: Button 1 (Moon and Star) - Up/On press 1x
description: "Action to run, when the button is pressed one time."
default: []
selector:
action: {}
button_1_held:
name: Button 1 (Moon and Star) - Held down
description: "Action to run, when the button is held down."
default: []
selector:
action: {}
button_1_released:
name: Button 1 (Moon and Star) - Released
description: "Action to run, when the button is released."
default: []
selector:
action: {}
button_2_press:
name: Button 2 (People) - Up/On press 1x
description: "Action to run, when the button is pressed one time."
default: []
selector:
action: {}
button_2_held:
name: Button 2 (People) - Held down
description: "Action to run, when the button is held down."
default: []
selector:
action: {}
button_2_released:
name: Button 2 (People) - Released
description: "Action to run, when the button is released."
default: []
selector:
action: {}
button_3_press:
name: Button 3 (Circle) - Up/On press 1x
description: "Action to run, when the button is pressed one time."
default: []
selector:
action: {}
button_3_held:
name: Button 3 (Circle) - Held down
description: "Action to run, when the button is held down."
default: []
selector:
action: {}
button_3_released:
name: Button 3 (Circle) - Released
description: "Action to run, when the button is released."
default: []
selector:
action: {}
button_4_press:
name: Button 4 (Circle with Line) - Up/On press 1x
description: "Action to run, when the button is pressed one time."
default: []
selector:
action: {}
button_4_held:
name: Button 4 (Circle with Line) - Held down
description: "Action to run, when/ the button is held down."
default: []
selector:
action: {}
button_4_released:
name: Button 4 (Circle with Line) - Released
description: "Action to run, when/ the button is released."
default: []
selector:
action: {}
mode: single
max_exceeded: silent
trigger:
- platform: event
event_type: zwave_js_value_notification
event_data:
device_id: !input scn04
command_class_name: "Central Scene"
action:
- variables:
scene_id: "{{ trigger.event.data.property_key }}"
action_name: "{{ trigger.event.data.value }}"
- choose:
- conditions: "{{ scene_id == '001' and action_name == 'KeyPressed' }}"
sequence: !input button_1_press
- conditions: "{{ scene_id == '001' and action_name == 'KeyHeldDown' }}"
sequence: !input button_1_held
- conditions: "{{ scene_id == '001' and action_name == 'KeyReleased' }}"
sequence: !input button_1_released
- conditions: "{{ scene_id == '002' and action_name == 'KeyPressed' }}"
sequence: !input button_2_press
- conditions: "{{ scene_id == '002' and action_name == 'KeyHeldDown' }}"
sequence: !input button_2_held
- conditions: "{{ scene_id == '002' and action_name == 'KeyReleased' }}"
sequence: !input button_2_released
- conditions: "{{ scene_id == '003' and action_name == 'KeyPressed' }}"
sequence: !input button_3_press
- conditions: "{{ scene_id == '003' and action_name == 'KeyHeldDown' }}"
sequence: !input button_3_held
- conditions: "{{ scene_id == '003' and action_name == 'KeyReleased' }}"
sequence: !input button_3_released
- conditions: "{{ scene_id == '004' and action_name == 'KeyPressed' }}"
sequence: !input button_4_press
- conditions: "{{ scene_id == '004' and action_name == 'KeyHeldDown' }}"
sequence: !input button_4_held
- conditions: "{{ scene_id == '004' and action_name == 'KeyReleased' }}"
sequence: !input button_4_released