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!
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.
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.
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
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