HANK Electronics HKZW-SCN04 4 button scene controller for Z-Wave JS

Updated to work with HA 2021.4.0

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.

Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled.

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
2 Likes

Thank you so very very very much!

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… :slight_smile:
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.

Cheers

1 Like

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?

Buttons 1 and 2 are ok though.

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
2 Likes

I know I’m late to the party on this, but I just got my Hanks and wondering if this is “integration based” or add-on ? I’m using ZwaveJSUI

thanks

my two hanks stopped responding, vwave dbug shows the remote is transmitting:

2024-01-24T20:43:53.493Z CNTRLR « [Node 049] received CentralScene notification {
“nodeId”: 49,
“ccId”: “Central Scene”,
“ccCommand”: “0x03”,
“payload”: “0xb40003”

if i press the same button again there is a fifferent ‘payload’

2024-01-24T20:44:15.402Z CNTRLR « [Node 049] received CentralScene notification {
“nodeId”: 49,
“ccId”: “Central Scene”,
“ccCommand”: “0x03”,
“payload”: “0xb50003”

Is this the reason why the remote is not working anymore?