From 989eb025f1c4ace9a2ab72596357fa556b05b5bd Mon Sep 17 00:00:00 2001 From: Raman Gupta <7243222+raman325@users.noreply.github.com> Date: Tue, 2 Feb 2021 09:26:12 -0600 Subject: [PATCH] Add docs for zwave_js notification event (#16385) --- source/_integrations/zwave_js.markdown | 45 ++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/source/_integrations/zwave_js.markdown b/source/_integrations/zwave_js.markdown index 5dcf8df897a..3017aa98594 100644 --- a/source/_integrations/zwave_js.markdown +++ b/source/_integrations/zwave_js.markdown @@ -93,3 +93,48 @@ Valid code slots are between 1-254. | ---------------------- | -------- | ------------------------------------------------------ | | `entity_id` | no | Lock entity or list of entities to clear the usercode. | | `code_slot` | yes | The code slot to clear the usercode from. | + +## Events + +### Event `zwave_js_event` + +This event is fired whenever a [notification](https://zwave-js.github.io/node-zwave-js/#/api/node?id=quotnotificationquot) or [value notification](https://zwave-js.github.io/node-zwave-js/#/api/node?id=quotvalue-notificationquot) event is received. + +#### Notifications + +Notifications are events sent using the Notification command class. The `parameters` attribute in the example below is optional, and when it is included, the keys in the attribute will vary depending on the event. + +Notification exapmle: +```json +{ + "type": "notification", + "domain": "zwave_js", + "node_id": 1, + "home_id": "974823419", + "device_id": "ad8098fe80980974", + "label": "Keypad lock operation", + "parameters": {"userId": 1} +} +``` + +#### Value Notifications + +Value Notifications are used for stateless values, like `Central Scenes`. + +Value Notification example: +```json +{ + "type": "value_notification", + "domain": "zwave_js", + "node_id": 1, + "home_id": "974823419", + "endpoint": 0, + "device_id": "ad8098fe80980974", + "command_class": 32, + "command_class_name": "Basic", + "label": "Event value", + "property_name": "event", + "property_key_name": "some value", + "value": 255, +} +```