ZWave-JS - HANK SCN04 4-button remote

Please note that this Blueprint only works on HA versions above 2021.4.0


Blueprint for the HANK Electronics SCN04 4-button remote (more commonly known in Europe as the Technisat SCN04), using ZWave-JS

Designed to accommodate both “Press” and “Held” states of the remote and includes text descriptions of the buttons to make identifying them easier.

Credit goes to @Soccs for the idea in this post, and to @jei1965 for their minimote code which I used as a template

I’ve tested this with a couple of remotes, but if anyone finds any issues with this blueprint, please let me know.

Blueprint

blueprint:
  name: Hank Four-button Scene Controller
  description: Create automations for Hank Electronics / Technisat 4-button remote using the ZWave-JS integration
  domain: automation
  
  input:
    hank_scn04:
      name: Hank Four-button Controller
      selector:
        device:
          integration: zwave_js
          manufacturer: HANK Electronics Ltd.
          model: SCN04
          
    button_1_pressed:
      name: Button 1 (Sleep icon) Pressed
      description: Action to run when button is pressed
      default: []
      selector:
        action: 

    button_1_held:
      name: Button 1 (Sleep icon) Held Down
      description: Action to run when button is held
      default: []
      selector:
        action: 

    button_2_pressed:
      name: Button 2 (People icon) Pressed
      description: Action to run when button is pressed
      default: []
      selector:
        action: 

    button_2_held:
      name: Button 2 (People icon) Held Down
      description: Action to run when button is held
      default: []
      selector:
        action: 

    button_3_pressed:
      name: Button 3 (Centre button) Pressed
      description: Action to run when button is pressed
      default: []
      selector:
        action: 

    button_3_held:
      name: Button 3 (Centre button) Held Down
      description: Action to run when button is held
      default: []
      selector:
        action: 

    button_4_pressed:
      name: Button 4 (Power icon) Pressed
      description: Action to run when button is pressed
      default: []
      selector:
        action: 

    button_4_held:
      name: Button 4 (Power icon) Held Down
      description: Action to run when button is held
      default: []
      selector:
        action: 

mode: single
max_exceeded: silent

trigger:
  platform: event
  event_type: zwave_js_value_notification
  event_data:
    command_class_name: Central Scene
    device_id: !input hank_scn04

action:
  - variables:
      scene_id: "{{ trigger.event.data.property_key_name }}"
      key_state: "{{ trigger.event.data.value }}"
  - choose:
    - conditions: "{{ scene_id == '001' and key_state == 'KeyPressed' }}"
      sequence: !input button_1_pressed
    - conditions: "{{ scene_id == '001' and key_state == 'KeyHeldDown' }}"
      sequence: !input button_1_held
    - conditions: "{{ scene_id == '002' and key_state == 'KeyPressed' }}"
      sequence: !input button_2_pressed
    - conditions: "{{ scene_id == '002' and key_state == 'KeyHeldDown' }}"
      sequence: !input button_2_held
    - conditions: "{{ scene_id == '003' and key_state == 'KeyPressed' }}"
      sequence: !input button_3_pressed
    - conditions: "{{ scene_id == '003' and key_state == 'KeyHeldDown' }}"
      sequence: !input button_3_held
    - conditions: "{{ scene_id == '004' and key_state == 'KeyPressed' }}"
      sequence: !input button_4_pressed
    - conditions: "{{ scene_id == '004' and key_state == 'KeyHeldDown' }}"
      sequence: !input button_4_held

Blueprint Preview

4 Likes

Just what I was looking for! Thanks a alot.

Trying to get the Long Press action to dim up/down the lights, need to experiment a bit more.

amazing work! and amazing little control. no issues, just works!

@andreasm80 Is this of any use ?

I have a couple of LIFX Candle bulbs in 2 IKEA SYMFONISK lamps, and here’s the code from the actual automation to change between warm white (45% brightness), and cool white (100% brightness) in 7 seconds using the “power” button.

      button_4_pressed:
      - service: light.turn_on
        data:
          transition: 7
          kelvin: 2700
          brightness_pct: 45
        target:
          entity_id:
          - light.lamp_l
          - light.lamp_r
      button_4_held:
      - service: light.turn_on
        data:
          transition: 7
          kelvin: 6500
          brightness_pct: 100
        target:
          entity_id:
          - light.lamp_l
          - light.lamp_r

Thanks p4mr! Really appreciate your reply.
What I was hoping for was that I could use the long-press/hold button for just the dim function. Where the short-press turns on/off the light (toggle). With the long-press I would like to be able to dim up to 100% and then when it reaches 100% dim down again.

Don’t think that’s possible.

You’d need separate “dim up” and “dim down” buttons. See this link for a code example of how to do that.

1 Like

Thanks for clarification and pointing me in the right direction. Big thumbs up. Saves me a lot of time searching for an idea I have which is not possible. Thanks for taking your time to reply back p4mr!

1 Like

Hi all,

I think that last update broke the blueprint.

I’ve tried to set it up after upgrade and I have no trigger.

I saw in the “breaking change” section something about a split in two categories of the zwaveJS events. Maybe that’s the case.

If i find time I’ll try tommorow to update this thread wiith my findings on the matter.

Yup, it did. I’ve had to roll mine back to 2021.3.4 as it broke too many of my Zwave devices and automations to resolve in one go. I’ll edit the first post to indicate the blueprint only works up to that prior version.

It looks like the fix is simple enough. Line 76 should be updated to:

event_type: zwave_js_value_notification

There’s some more details in the breaking changes post for the release.

4 Likes

Thanks @shabazkilla, you are right.

Have updated the original post (and code) to reflect the change and noted this Blueprint now only works on version 2021.4.0 and above.

1 Like

Hi. Just found your blueprint while looking for my own HANK 4-button blueprint. I wish I’d found yours before working on my own. It was a good learning experience, regardless.

These scene controllers also support a KeyReleased event. Perhaps @andreasm80 could use that if the mode was restart? There used to be an example in the old Cookbook page but it looks like it’s been changed to highlight blueprints instead.

Cheers
Net Giant

1 Like

Hi,
Thanks for following up. I will try to investigate more. It would make the Hank buttons more clever.
I’ll update if I find something.
Thanks again

1 Like

I have the code in this gist. KeyRelease code

I’m a bit of a newbie and thought I’d pass this on about the blueprint in case other experience it. I noticed I need to create a action for each of the 8 button possibilities or else my Z-Wave JS integration has problems. I loose control of all my Z-Wave devices. At first I only entered actions for the push of the buttons and left the hold button values blank. As soon as I saved my Z-Wave locked up and I couldn’t edit the automation further to get back to square one. I was also unable to delete the automation. I had to restore a Snapshot to recover then recreate the automation from the blueprint and enter an action for each variable to get it working.

On Home Assistant OS core-2021.8.8 with Z-Wave JS 0.1.37, I found the key_state values to be numeric: 0 for pressed and 2 for held.

I’m using this fork.

As @normgr00 points out, you can indeed break all Automations if the actions fields are added but left blank. (Just don’t add an action and you’ll be okay). To recover, edit /config/automations.yaml with Terminal/SSH or filesystem access and remove the lines with empty actions.

Thanks for the blueprint!

Love this remote and blueprint! The newest one (HAOS 10.1) seems to have the labels for button 3 and button 4 reversed.