HANK One-key Scene Controller SCN01 - Zwave JS - Automation Builder

I found that the initial discovery of the device via zwavejs2mqtt did not quite bring everything in properly. I refreshed/re-interviewed the values for the Hank One Button scene controller via control panel, I had to do this several times. It seems to help if you hold the button down until the light goes from blue > green > yellow, do this several times while being interviewed. Finally, you should see zwave_js_event for the device in dev tools > events > listen to events: “zwave_js_event”.

blueprint:
  name: Scene controller button
  description: Create automations for any button using z-wave js integration.
  domain: automation
  input:
    hank_scene_controller:
      name: One-key Scene Controller
      description: The remote to interact with.
      selector:
        device:
          integration: zwave_js
          manufacturer: HANK Electronics Ltd.
          model: HKZW-SCN01
    button_press:
      name: Press Button One
      description: Action to run on button press.
      default: []
      selector:
        action: {}
    button_hold:
      name: Hold Button One
      description: Action to run on button hold.
      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_scene_controller

action:
  - variables:
      button_value: "{{ trigger.event.data.value }}"
  - choose:
      - conditions: "{{ button_value == 'KeyPressed' }}"
        sequence: !input button_press
      - conditions: "{{ button_value == 'KeyHeldDown' }}"
        sequence: !input button_hold  


Good luck!

Edit: I like Kyle’s below, lets go with that instead.
Edit: Looks like zwave-js just changed in the latest update. Fixing the event type, it is now: zwave_js_value_notification, also looks like the data button_value changed to just value. I need to test this.
Edit: Nope: button_value did not change, the new automation trace feature made this easy to spot!

Hey, thanks for posting this!

I made a few modifications to support the long press action with the scene control button. Here it is if you’re interested.

blueprint:
  name: Scene controller button
  description: Create automations for any button using z-wave js integration.
  domain: automation
  input:
    hank_scene_controller:
      name: One-key Scene Controller
      description: The remote to interact with.
      selector:
        device:
          integration: zwave_js
          manufacturer: HANK Electronics Ltd.
          model: SCN01
    button_press:
      name: Press Button One
      description: Action to run on button press.
      default: []
      selector:
        action: {}
    button_hold:
      name: Hold Button One
      description: Action to run on button hold.
      default: []
      selector:
        action: {}        

mode: single

max_exceeded: silent

trigger:
  platform: event
  event_type: zwave_js_event
  event_data:
    command_class_name: Central Scene
    device_id: !input hank_scene_controller

action:
  - variables:
      button_value: "{{ trigger.event.data.value }}"
  - choose:
      - conditions: "{{ button_value == 'KeyPressed' }}"
        sequence: !input button_press
      - conditions: "{{ button_value == 'KeyHeldDown' }}"
        sequence: !input button_hold  
1 Like

Thanks for getting me on the track to solving our issues with the SCN01 and SCN04. I did the re-interview trick from the zwave js interface and got a message that it succeeded. I still only have 2 entities for the controller, the battery level and a battery level alert.
I did not see any notifications for zwave_js_value_notification. The zwave js log shows the button presses, though:
2021-05-09T09:04:27.644Z CNTRLR « [Node 036] received CentralScene notification {
“nodeId”: 36,
“ccId”: “Central Scene”,
“ccCommand”: “0x03”,
“payload”: “0x1a0001”
}
2021-05-09T09:08:12.952Z CNTRLR « [Node 036] received CentralScene notification {
“nodeId”: 36,
“ccId”: “Central Scene”,
“ccCommand”: “0x03”,
“payload”: “0x1b0002”
}
2021-05-09T09:17:54.066Z CNTRLR « [Node 036] received CentralScene notification {
“nodeId”: 36,
“ccId”: “Central Scene”,
“ccCommand”: “0x03”,
“payload”: “0x1c0003”
}

So, how do I get hass to respond to these?

EDIT: NM. There is something funky with the event viewing tool.

I am still struggling with this. My Hank scn01 was working fine using this trigger:

event_data:
  entity_id: zwave.switch_living_room_lamps
  scene_data: 3
  scene_id: 1
event_type: zwave.scene_activated
platform: event

However, after moving to zwaveJS the automation stopped working. I know Zwave JS is seeing it correctly because I see this in the zwaveJS debug console when pressing the button:

2021-06-14 13:01:59.148 INFO ZWAVE: Node 19: value notification: 91-0-scene-001 0

Not sure if the Scene number or Scene_data has changed with zwaveJS, but the HA trigger above doesn’t pick up the scene change. Any thoughts would be appreciated.

EDIT: I should have also mentioned that I also tried the blueprint above and that didn’t work either.

Thanks.

Hi,
I monitored for messages of the type “zwave_js_value_notification” and copied the payload into the trigger portion of the automation that activates a scene. This causes the event to be fired based on the ‘raw’ data in zwave.
Every button produces a slightly different message, so you have to make events and scenes for each of the 4 buttons.
This works consistently and reliably, although I wouldn’t be surprised if it broke in an update in the near future :grinning:

See below for the event data in my system. Of course yours will be similar, but slightly different.
Good luck.

domain: zwave_js
node_id: 38
home_id: 4048395278
endpoint: 0
device_id: da59d0a47e9c5527dbce9f10bb4b244a
command_class: 91
command_class_name: Central Scene
label: Scene 001
property: scene
property_name: scene
property_key: '001'
property_key_name: '001'
value: KeyPressed
value_raw: 0

Thanks. I was able to get my event using your suggestion.

Now I am just confused about how to translate this into the YAML trigger format that I posted in my previous message above…

{
    "event_type": "zwave_js_value_notification",
    "data": {
        "domain": "zwave_js",
        "node_id": 19,
        "home_id": 4149126727,
        "endpoint": 0,
        "device_id": "3e2734503119fec990933d7e8ff318eb",
        "command_class": 91,
        "command_class_name": "Central Scene",
        "label": "Scene 001",
        "property": "scene",
        "property_name": "scene",
        "property_key": "001",
        "property_key_name": "001",
        "value": "KeyPressed",
        "value_raw": 0
    },
    "origin": "LOCAL",
    "time_fired": "2021-06-14T23:52:22.815882+00:00",
    "context": {
        "id": "a8004b671ceede033298e537066b26fb",
        "parent_id": null,
        "user_id": null
    }
}

Not sure which value is scene_data and which is scene_id. Are you able to paste the yaml of your automation?

Can anyone show an example of how to turn this event data into an automation trigger? I tried scene_id: 1 and scene_data: 0 but that didn’t work.

Figured it out (if anyone else has trouble).


event_data:
  node_id: 19
  property: scene
  property_key: '001'
  value: KeyPressed
platform: event
event_type: zwave_js_value_notification

2 Likes