From 200f2a3f08ab6d529d45da42037abe9b29aa540b Mon Sep 17 00:00:00 2001 From: Marcus Davies <55892693+marcus-j-davies@users.noreply.github.com> Date: Fri, 14 May 2021 11:33:03 +0100 Subject: [PATCH 01/18] 3.5.0 --- CHANGELOG.md | 6 ++ README.md | 6 +- managed.md | 27 +++++++-- zwave-js/FunctionMaps.json | 113 ++++++++++++++++++++++++++++++++++++- zwave-js/zwave-js.js | 6 ++ 5 files changed, 148 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6df4a793..0e41c50e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,10 @@ # node-red-contrib-zwave-js Change Log + + - 3.5.0 + - Added support for **User Code** CC to Managed mode + - Added support for **Alarm Sensor** CC to Managed mode + - Added support for **Barrier Operator** CC to Managed mode + - Fixed Meter Optional param - 3.4.0 **Deprecation Warnings** - Added a **PollValue** method to the Unmanaged class diff --git a/README.md b/README.md index f33a8da1..2e451a80 100644 --- a/README.md +++ b/README.md @@ -189,14 +189,14 @@ let Message = { return Message; ``` -## Notes on StartInclusion +## Notes on Controller -> StartInclusion By default, the include process will only include secure devices, if you want to include non-secure devices, provide a **true** value -## Notes on HardReset +## Notes on Controller -> HardReset A one-way ticket for wiping out all the configuration on the controller. Once you call this method, there is no going back - you are hearby **WARNED of the consequences**. -## Notes on ProprietaryFunc +## Notes on Controller -> ProprietaryFunc The **Data** argument, must ONLY contain the data portion of the request As an example, this byte array **[0x01, 0x08, 0x00, 0xF2, 0x51, 0x01, 0x00, 0x05, 0x01, 0x51]** disables the LED on the GEN 5 Z-Stick, breaking it down we have: diff --git a/managed.md b/managed.md index 3e278dbf..6a428df5 100644 --- a/managed.md +++ b/managed.md @@ -27,6 +27,21 @@ Currently, the supported command classes are (when using Managed mode). | Association (Deprecated) | RemoveNodesFromAllGroups | [NodeIDs: Number[]] | | Association (Deprecated) | GetGroupCount | | | AssociationGroupInfo (Deprecated) | GetGroupName | [Group ID: Number] | +| AlarmSensor | Get | [**AlarmSensorType**: Enum (Optional)] | +| AlarmSensor | GetSupportedSensorTypes | | +| BarrierOperator | Set | [**BarrierState**: Enum] | +| BarrierOperator | Get | | +| BarrierOperator | GetSignalingCapabilities | | +| BarrierOperator | GetEventSignaling | [**SubsystemType**: Enum] | +| BarrierOperator | SetEventSignaling | [**SubsystemType**: Enum, **SubsystemState**: Enum] | +| UserCode | Set | [UserID: Number, **UserIDStatus**: Enum, UserCode: String] | +| UserCode | GetUsersCount | | +| UserCode | Get | [UserID: Number, Multiple: Bool (Optional)] | +| UserCode | Clear (see notes) | [UserID: Number] | +| UserCode | GetKeypadMode | | +| UserCode | SetKeypadMode | [**KeypadMode**: Enum] | +| UserCode | GetMasterCode | | +| UserCode | SetMasterCode | [Code: String] | | Basic | Set | [Number] | | Basic | Get | | | Battery | Get | | @@ -46,7 +61,7 @@ Currently, the supported command classes are (when using Managed mode). | Lock | Get | | | Indicator | Set | [Value: Number] \| [**Indicator**[]: Object] | | Indicator | Get | [Indicator: Number (Optional)] | -| Meter | Get | [**MeterOptions**: Object] | +| Meter | Get | [**MeterOptions**: Object (Optional)] | | Meter | GetAll | | | Meter | Reset | [**MeterResetOptions**: Object] | | MultiLevelSwitch | Set | [Number, **Duration**: Object (Optional)] | @@ -67,7 +82,7 @@ Currently, the supported command classes are (when using Managed mode). | ThermostatSetPoint | Set | [**SetPointType**: Enum, Value: Number, Scale: Number] | | ThermostatSetPoint | Get | [**SetPointType**: Enum] | | ThermostatOperatingState | Get | | -| ThermostatSetback | Set (See Notes) | [**SetbackType**: Enum, Set Back State: String \| Number] | +| ThermostatSetback | Set (See Notes) | [**SetbackType**: Enum, Set Back State: String \| Number] | | ThermostatSetback | Get | | | WakeInterval | Set (See Notes) | [Seconds: Number, Controller Node ID:Number] | | WakeInterval | Get | | @@ -175,15 +190,17 @@ Please see the [🔗Associations](./README.md#controllerdriver-and-associat - RemoveAssociations - RemoveNodeFromAllAssociations +## Notes on UserCode -> Clear +Specifying 0, will clear all User Codes. -## Notes on WakeInterval +## Notes on WakeInterval -> Set When setting the interval, the **Controller Node ID** parameter will almost certainly be 1 - unless you have multiple controllers, and you want the wake up to be recieved by a different controller. -## Notes on GetSupportedKeys +## Notes on EntryControl -> GetSupportedKeys This will return an array of ASCII codes - representing the keys that are supported on the device -## Notes on ThermostatSetback +## Notes on ThermostatSetback -> Set If specifing a string, the valid values are: **Frost Protection** | **Energy Saving** | **Unused** ## Object Structures diff --git a/zwave-js/FunctionMaps.json b/zwave-js/FunctionMaps.json index daae52a9..d0159395 100644 --- a/zwave-js/FunctionMaps.json +++ b/zwave-js/FunctionMaps.json @@ -1,4 +1,113 @@ { + "UserCode": { + "MapsToClass": "User Code", + "Operations": { + "GetUsersCount": { + "MapsToFunc": "getUsersCount", + "ParamsOptional": 0, + "ParamsRequired": 0 + }, + "Get": { + "MapsToFunc": "get", + "ParamsOptional": 1, + "ParamsRequired": 1 + }, + "Set": { + "MapsToFunc": "set", + "ParamsOptional": 0, + "ParamsRequired": 3, + "ParamEnumDependency": { + "1": "UserIDStatus" + } + }, + "Clear": { + "MapsToFunc": "clear", + "ParamsOptional": 0, + "ParamsRequired": 1 + }, + "GetKeypadMode": { + "MapsToFunc": "getKeypadMode", + "ParamsOptional": 0, + "ParamsRequired": 0 + }, + "SetKeypadMode": { + "MapsToFunc": "setKeypadMode", + "ParamsOptional": 0, + "ParamsRequired": 1, + "ParamEnumDependency": { + "0": "KeypadMode" + } + }, + "GetMasterCode": { + "MapsToFunc": "getMasterCode", + "ParamsOptional": 0, + "ParamsRequired": 0 + }, + "SetMasterCode": { + "MapsToFunc": "setMasterCode", + "ParamsOptional": 0, + "ParamsRequired": 1 + } + } + }, + "AlarmSensor": { + "MapsToClass": "Alarm Sensor", + "Operations": { + "Get": { + "MapsToFunc": "get", + "ParamsOptional": 1, + "ParamsRequired": 0, + "ParamEnumDependency": { + "0": "AlarmSensorType" + } + }, + "GetSupportedSensorTypes": { + "MapsToFunc": "getSupportedSensorTypes", + "ParamsOptional": 0, + "ParamsRequired": 0 + } + } + }, + "BarrierOperator": { + "MapsToClass": "Barrier Operator", + "Operations": { + "Get": { + "MapsToFunc": "get", + "ParamsOptional": 0, + "ParamsRequired": 0 + }, + "Set": { + "MapsToFunc": "set", + "ParamsOptional": 0, + "ParamsRequired": 1, + "ParamEnumDependency": { + "0": "BarrierState" + } + }, + "GetSignalingCapabilities": { + "MapsToFunc": "getSignalingCapabilities", + "ParamsOptional": 0, + "ParamsRequired": 0 + }, + "GetEventSignaling": { + "MapsToFunc": "getEventSignaling", + "ParamsOptional": 1, + "ParamsRequired": 0, + "ParamEnumDependency": { + "0": "SubsystemType" + } + }, + "SetEventSignaling": { + "MapsToFunc": "setEventSignaling", + "ParamsOptional": 0, + "ParamsRequired": 2, + "ParamEnumDependency": { + "0": "SubsystemType", + "1": "SubsystemState" + } + } + } + }, "MultilevelSensor": { "MapsToClass": "Multilevel Sensor", "Operations": { @@ -85,8 +194,8 @@ "Operations": { "Get": { "MapsToFunc": "get", - "ParamsRequired": 1, - "ParamsOptional": 0 + "ParamsRequired": 0, + "ParamsOptional": 1 }, "GetAll": { "MapsToFunc": "getAll", diff --git a/zwave-js/zwave-js.js b/zwave-js/zwave-js.js index bc3a4b77..81b8d6b3 100644 --- a/zwave-js/zwave-js.js +++ b/zwave-js/zwave-js.js @@ -21,6 +21,12 @@ module.exports = function (RED) { ThermostatMode: ZWaveJS.ThermostatMode, SetPointType: ZWaveJS.ThermostatSetpointType, DoorLockMode: ZWaveJS.DoorLockMode, + AlarmSensorType: ZWaveJS.AlarmSensorType, + BarrierState:ZWaveJS.BarrierState, + SubsystemType:ZWaveJS.SubsystemType, + SubsystemState:ZWaveJS.SubsystemState, + UserIDStatus:ZWaveJS.UserIDStatus, + KeypadMode:ZWaveJS.KeypadMode, // node enums InterviewStage: ZWaveJS.InterviewStage, From 87a78e6165999663ff9d26b9fc9d79648a30398e Mon Sep 17 00:00:00 2001 From: Marcus Davies <55892693+marcus-j-davies@users.noreply.github.com> Date: Fri, 14 May 2021 11:33:52 +0100 Subject: [PATCH 02/18] Update CHANGELOG.md --- CHANGELOG.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0e41c50e..b1a89ed6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10 +1,10 @@ # node-red-contrib-zwave-js Change Log - 3.5.0 - - Added support for **User Code** CC to Managed mode - - Added support for **Alarm Sensor** CC to Managed mode - - Added support for **Barrier Operator** CC to Managed mode - - Fixed Meter Optional param + - Added support for **User Code** CC to Managed mode + - Added support for **Alarm Sensor** CC to Managed mode + - Added support for **Barrier Operator** CC to Managed mode + - Fixed Meter Optional param - 3.4.0 **Deprecation Warnings** - Added a **PollValue** method to the Unmanaged class From d55c7ffc84d96b1f57c2174be3dab9a213f6a403 Mon Sep 17 00:00:00 2001 From: Marcus Davies <55892693+marcus-j-davies@users.noreply.github.com> Date: Fri, 14 May 2021 11:34:07 +0100 Subject: [PATCH 03/18] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b1a89ed6..a7afe96b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # node-red-contrib-zwave-js Change Log - - 3.5.0 + - 3.5.0 - Added support for **User Code** CC to Managed mode - Added support for **Alarm Sensor** CC to Managed mode - Added support for **Barrier Operator** CC to Managed mode From 5e774c597420f3f29616bf6efc50906330f2c770 Mon Sep 17 00:00:00 2001 From: Marcus Davies <55892693+marcus-j-davies@users.noreply.github.com> Date: Fri, 14 May 2021 11:34:34 +0100 Subject: [PATCH 04/18] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a7afe96b..119cb10e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # node-red-contrib-zwave-js Change Log - - 3.5.0 + - 3.5.0 - Added support for **User Code** CC to Managed mode - Added support for **Alarm Sensor** CC to Managed mode - Added support for **Barrier Operator** CC to Managed mode From 764a51cdb121c2358f318aef037a21bcecd58376 Mon Sep 17 00:00:00 2001 From: Marcus Davies <55892693+marcus-j-davies@users.noreply.github.com> Date: Fri, 14 May 2021 11:36:21 +0100 Subject: [PATCH 05/18] Update managed.md --- managed.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/managed.md b/managed.md index 6a428df5..96a14839 100644 --- a/managed.md +++ b/managed.md @@ -34,14 +34,6 @@ Currently, the supported command classes are (when using Managed mode). | BarrierOperator | GetSignalingCapabilities | | | BarrierOperator | GetEventSignaling | [**SubsystemType**: Enum] | | BarrierOperator | SetEventSignaling | [**SubsystemType**: Enum, **SubsystemState**: Enum] | -| UserCode | Set | [UserID: Number, **UserIDStatus**: Enum, UserCode: String] | -| UserCode | GetUsersCount | | -| UserCode | Get | [UserID: Number, Multiple: Bool (Optional)] | -| UserCode | Clear (see notes) | [UserID: Number] | -| UserCode | GetKeypadMode | | -| UserCode | SetKeypadMode | [**KeypadMode**: Enum] | -| UserCode | GetMasterCode | | -| UserCode | SetMasterCode | [Code: String] | | Basic | Set | [Number] | | Basic | Get | | | Battery | Get | | @@ -84,6 +76,14 @@ Currently, the supported command classes are (when using Managed mode). | ThermostatOperatingState | Get | | | ThermostatSetback | Set (See Notes) | [**SetbackType**: Enum, Set Back State: String \| Number] | | ThermostatSetback | Get | | +| UserCode | Set | [UserID: Number, **UserIDStatus**: Enum, UserCode: String] | +| UserCode | GetUsersCount | | +| UserCode | Get | [UserID: Number, Multiple: Bool (Optional)] | +| UserCode | Clear (see notes) | [UserID: Number] | +| UserCode | GetKeypadMode | | +| UserCode | SetKeypadMode | [**KeypadMode**: Enum] | +| UserCode | GetMasterCode | | +| UserCode | SetMasterCode | [Code: String] | | WakeInterval | Set (See Notes) | [Seconds: Number, Controller Node ID:Number] | | WakeInterval | Get | | From 62293817c175a67308a96addc3f37b91fd249007 Mon Sep 17 00:00:00 2001 From: Marcus Davies <55892693+marcus-j-davies@users.noreply.github.com> Date: Fri, 14 May 2021 11:49:56 +0100 Subject: [PATCH 06/18] Update README.md --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 2e451a80..736b1d5d 100644 --- a/README.md +++ b/README.md @@ -3,13 +3,14 @@ # node-red-contrib-zwave-js An extremely easy to use, zero dependency and feature rich Z-Wave node for Node Red, based on Z-Wave JS. The implementation is 100% javascript. it is therefore: - - Very fast + - Extremely fast - Does not require a build of any static library - Stable Install this node via the Node Red palette menu (See [Home Assistant Install](#home-assistant-install) if this applies to you), and you have Z-Wave support in Node Red. - + +It offers a massive amount of flexibility and is packed full of features. The node is straightforward to use, and removes all the complexities that you would otherwise need to deal with. - Add the node into your flow From b9606399f76d5ee0ec5141039fa90678686efaf8 Mon Sep 17 00:00:00 2001 From: Marcus Davies <55892693+marcus-j-davies@users.noreply.github.com> Date: Fri, 14 May 2021 11:54:11 +0100 Subject: [PATCH 07/18] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 736b1d5d..8e50a4a5 100644 --- a/README.md +++ b/README.md @@ -26,8 +26,8 @@ The node is straightforward to use, and removes all the complexities that you wo Z-Wave JS is actively maintained, fast and supports the security command class. ## Home Assistant Install -Please note: This is a self contained Z-Wave driver for Node Red, it will not work along side the Z-Wave plugin for Home Assistant. -if this isn't your setup, then please refer to the below guide to install into the Node Red instance that HA provides. +Please note: This is a self contained Z-Wave driver for Node Red, it will not work along side the Z-Wave add-on for Home Assistant. +If however, you use the Node Red add-on, and want Z-Wave to be managed from with-in Node Red, see below for instructions. - Do not attempt to install this node, via the palette menu - it will likely not install some serial port stuff. - Edit the Node Red add-on configuration as below (specifically **system_packages** and **npm_packages**) From 052b9a187c6c9cf9d0362ec2b67e93dbd0a26582 Mon Sep 17 00:00:00 2001 From: Marcus Davies <55892693+marcus-j-davies@users.noreply.github.com> Date: Sun, 16 May 2021 07:30:44 +0100 Subject: [PATCH 08/18] Update README.md --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 8e50a4a5..e701888f 100644 --- a/README.md +++ b/README.md @@ -49,7 +49,8 @@ npm_packages: ## Node config (Advanced Driver Settings) **Custom CFG Dir** Z-Wave JS allows a custom directory, that will be used to search for additonal Device configuration files. -Note: if an internal device config is found to have the same identifiers, the one in the custom folder will take priority. +Note: if an internal device config is found to have the same identifiers, the one in the directory folder will take priority. +Please also note, the specified directory will be recursively scanned. **Disk IO Throttle** If using **Unmanaged** Mode (see further down), the values received from **GetValue**, will be from a cache. From a9950f08336504f1ee35b35b8ebf4c0b1c0e8bde Mon Sep 17 00:00:00 2001 From: Marcus Davies <55892693+marcus-j-davies@users.noreply.github.com> Date: Tue, 18 May 2021 17:10:54 +0100 Subject: [PATCH 09/18] 3.5.0 --- CHANGELOG.md | 7 ++++++- package.json | 4 ++-- zwave-js/zwave-js.js | 17 +++++------------ 3 files changed, 13 insertions(+), 15 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 119cb10e..feb27882 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10 +1,15 @@ # node-red-contrib-zwave-js Change Log - - 3.5.0 + - 3.5.0 **Possible Breaking Change** - Added support for **User Code** CC to Managed mode - Added support for **Alarm Sensor** CC to Managed mode - Added support for **Barrier Operator** CC to Managed mode - Fixed Meter Optional param + - Removed a temporary work around captruing the mismatched **endPoint** property + **endpoint** is now the required property (no longer a capital P) if specifying the endpoint. + See change log for 1.3.0. + - Optimisations to **Duration** porcessing + - Bump Z-Wave JS to 7.5.0 - 3.4.0 **Deprecation Warnings** - Added a **PollValue** method to the Unmanaged class diff --git a/package.json b/package.json index 6a286686..902191a4 100644 --- a/package.json +++ b/package.json @@ -1,11 +1,11 @@ { "name": "node-red-contrib-zwave-js", - "version": "3.4.0", + "version": "3.5.0", "license": "MIT", "description": "An extremely easy to use, zero dependency and feature rich Z-Wave node for Node Red, based on Z-Wave JS.", "dependencies": { "serialport": "9.0.7", - "zwave-js": "7.4.0", + "zwave-js": "7.5.0", "winston": "3.3.3" }, "keywords": [ diff --git a/zwave-js/zwave-js.js b/zwave-js/zwave-js.js index 81b8d6b3..8ca6f9c4 100644 --- a/zwave-js/zwave-js.js +++ b/zwave-js/zwave-js.js @@ -526,8 +526,6 @@ module.exports = function (RED) { if (msg.payload.hasOwnProperty("endpoint")) { EP = parseInt(msg.payload.endpoint) - } else if (msg.payload.hasOwnProperty("endPoint")) { - EP = parseInt(msg.payload.endPoint) } if (Func.hasOwnProperty("ParamEnumDependency")) { @@ -1085,16 +1083,11 @@ module.exports = function (RED) { // Duration Fix function ProcessDurationClass(Class, Operation, Params) { if (Params.length > 0) { - for (let i = 0; i < Params.length; i++) { - if (typeof Params[i] === "object") { - let Keys = Object.keys(Params[i]); - if (Keys.length === 1) { - if (Keys[0] === "Duration") { - let D = new Duration(Params[i].Duration.value, Params[i].Duration.unit) - Params[i] = D; - - } - } + if (typeof Params[1] === "object") { + let Keys = Object.keys(Params[1]); + if (Keys.length === 1 && Keys[0] === "Duration") { + let D = new Duration(Params[i].Duration.value, Params[i].Duration.unit) + Params[1] = D; } } } From 93c7d36cfeb1a00dcb4558746b8a389b00318361 Mon Sep 17 00:00:00 2001 From: Marcus Davies <55892693+marcus-j-davies@users.noreply.github.com> Date: Tue, 18 May 2021 17:16:51 +0100 Subject: [PATCH 10/18] Update CHANGELOG.md --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index feb27882..51daa444 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,9 +5,9 @@ - Added support for **Alarm Sensor** CC to Managed mode - Added support for **Barrier Operator** CC to Managed mode - Fixed Meter Optional param - - Removed a temporary work around captruing the mismatched **endPoint** property + - Removed a temporary work around capturing the mismatched **endPoint** property **endpoint** is now the required property (no longer a capital P) if specifying the endpoint. - See change log for 1.3.0. + See change log for **1.3.0**. - Optimisations to **Duration** porcessing - Bump Z-Wave JS to 7.5.0 From 187e7ad9725f28ce48a4f6aa8d67f1614abec8be Mon Sep 17 00:00:00 2001 From: Marcus Davies <55892693+marcus-j-davies@users.noreply.github.com> Date: Tue, 18 May 2021 20:04:04 +0100 Subject: [PATCH 11/18] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 51daa444..abbba03f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ See change log for **1.3.0**. - Optimisations to **Duration** porcessing - Bump Z-Wave JS to 7.5.0 + - Node Red UI performance improvements (i.e fetching values for a node, is now completed with 1 call, as apposed for each property) - 3.4.0 **Deprecation Warnings** - Added a **PollValue** method to the Unmanaged class From 92e4faaa7a4e1185a5f94b27422ac5c0d9e9d90e Mon Sep 17 00:00:00 2001 From: Marcus Davies <55892693+marcus-j-davies@users.noreply.github.com> Date: Sun, 23 May 2021 18:28:13 +0100 Subject: [PATCH 12/18] Update CHANGELOG.md --- CHANGELOG.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index abbba03f..019622db 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,8 +9,7 @@ **endpoint** is now the required property (no longer a capital P) if specifying the endpoint. See change log for **1.3.0**. - Optimisations to **Duration** porcessing - - Bump Z-Wave JS to 7.5.0 - - Node Red UI performance improvements (i.e fetching values for a node, is now completed with 1 call, as apposed for each property) + - Bump Z-Wave JS to 7.5.1 - 3.4.0 **Deprecation Warnings** - Added a **PollValue** method to the Unmanaged class From 9c013cdce82c95465f74a7ee2a1b3b4c5239b342 Mon Sep 17 00:00:00 2001 From: Marcus Davies <55892693+marcus-j-davies@users.noreply.github.com> Date: Mon, 24 May 2021 19:40:07 +0100 Subject: [PATCH 13/18] 3.5.0 --- CHANGELOG.md | 1 + managed.md | 2 ++ zwave-js/FunctionMaps.json | 18 ++++++++++++++++++ zwave-js/zwave-js.js | 1 + 4 files changed, 22 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 019622db..ee0e2fe7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ - Added support for **User Code** CC to Managed mode - Added support for **Alarm Sensor** CC to Managed mode - Added support for **Barrier Operator** CC to Managed mode + - Added support for **Clock** CC to Managed mode - Fixed Meter Optional param - Removed a temporary work around capturing the mismatched **endPoint** property **endpoint** is now the required property (no longer a capital P) if specifying the endpoint. diff --git a/managed.md b/managed.md index 96a14839..e03a0f17 100644 --- a/managed.md +++ b/managed.md @@ -40,6 +40,8 @@ Currently, the supported command classes are (when using Managed mode). | BinarySensor | Get | [**BinarySensorType**: Enum] | | BinarySwitch | Set | [Bool, **Duration**: Object (Optional)] | | BinarySwitch | Get | | +| Clock | Set | [Hour: Number, Minute: Number, **Weekday**: Enum (Optional)] | +| Clock | Get | | | Configuration | Set | [ParamID: Number, Value: Number, Value Length: Number]| | Configuration | Get | [ParamID: Number] | | ColorSwitch | Set | [**Color**: Object] | diff --git a/zwave-js/FunctionMaps.json b/zwave-js/FunctionMaps.json index d0159395..4852dda1 100644 --- a/zwave-js/FunctionMaps.json +++ b/zwave-js/FunctionMaps.json @@ -1,4 +1,22 @@ { + "Clock": { + "MapsToClass": "Clock", + "Operations": { + "Get": { + "MapsToFunc": "get", + "ParamsOptional": 0, + "ParamsRequired": 0 + }, + "Set": { + "MapsToFunc": "set", + "ParamsOptional": 1, + "ParamsRequired": 2, + "ParamEnumDependency": { + "2": "Weekday" + } + } + } + }, "UserCode": { "MapsToClass": "User Code", "Operations": { diff --git a/zwave-js/zwave-js.js b/zwave-js/zwave-js.js index 8ca6f9c4..8b79734a 100644 --- a/zwave-js/zwave-js.js +++ b/zwave-js/zwave-js.js @@ -27,6 +27,7 @@ module.exports = function (RED) { SubsystemState:ZWaveJS.SubsystemState, UserIDStatus:ZWaveJS.UserIDStatus, KeypadMode:ZWaveJS.KeypadMode, + Weekday:ZWaveJS.Weekday, // node enums InterviewStage: ZWaveJS.InterviewStage, From 825adac63c1ee44259f168548c740000d95ad7a0 Mon Sep 17 00:00:00 2001 From: Marcus Davies <55892693+marcus-j-davies@users.noreply.github.com> Date: Tue, 25 May 2021 16:40:08 +0100 Subject: [PATCH 14/18] 3.5.0 --- CHANGELOG.md | 5 ++++- package.json | 4 ++-- zwave-js/zwave-js.js | 11 +++++------ 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ee0e2fe7..7ab887ab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,7 +10,10 @@ **endpoint** is now the required property (no longer a capital P) if specifying the endpoint. See change log for **1.3.0**. - Optimisations to **Duration** porcessing - - Bump Z-Wave JS to 7.5.1 + - The **forceUpdate** object for Managed access, can now contain any property normally found in the ValueID interface. + Including overwriting the **endpoint** property - which will normally be provided for you. + - Bump Z-Wave JS to 7.5.2 + - Bump Serial Ports - 3.4.0 **Deprecation Warnings** - Added a **PollValue** method to the Unmanaged class diff --git a/package.json b/package.json index 902191a4..ab5d16ec 100644 --- a/package.json +++ b/package.json @@ -4,8 +4,8 @@ "license": "MIT", "description": "An extremely easy to use, zero dependency and feature rich Z-Wave node for Node Red, based on Z-Wave JS.", "dependencies": { - "serialport": "9.0.7", - "zwave-js": "7.5.0", + "serialport": "9.0.8", + "zwave-js": "7.5.2", "winston": "3.3.3" }, "keywords": [ diff --git a/zwave-js/zwave-js.js b/zwave-js/zwave-js.js index 8b79734a..7e2ff3dd 100644 --- a/zwave-js/zwave-js.js +++ b/zwave-js/zwave-js.js @@ -564,13 +564,12 @@ module.exports = function (RED) { if(forceUpdate !== undefined){ let VID = { - commandClass:Map.MapsToClass, - endpoint:EP, - property:forceUpdate.property, - } - if(forceUpdate.propertyKey !== undefined){ - VID.propertyKey = forceUpdate.propertyKey + commandClass:CommandClasses[Map.MapsToClass], + endpoint:EP } + Object.keys(forceUpdate).forEach((VIDK) =>{ + VID[VIDK] = forceUpdate[VIDK] + }) Log("debug", "REDCTL", "OUT", "[FORCE-UPDATE]", printForceUpdate(Node, VID)) await Driver.controller.nodes.get(Node).pollValue(VID) } From 74820b8565a7a4d86a814b9c5d63d498d6f13a08 Mon Sep 17 00:00:00 2001 From: Marcus Davies <55892693+marcus-j-davies@users.noreply.github.com> Date: Tue, 25 May 2021 17:01:39 +0100 Subject: [PATCH 15/18] Update zwave-js.js --- zwave-js/zwave-js.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zwave-js/zwave-js.js b/zwave-js/zwave-js.js index 7e2ff3dd..cf77af5d 100644 --- a/zwave-js/zwave-js.js +++ b/zwave-js/zwave-js.js @@ -1082,11 +1082,11 @@ module.exports = function (RED) { // Duration Fix function ProcessDurationClass(Class, Operation, Params) { - if (Params.length > 0) { + if (Params.length > 1) { if (typeof Params[1] === "object") { let Keys = Object.keys(Params[1]); if (Keys.length === 1 && Keys[0] === "Duration") { - let D = new Duration(Params[i].Duration.value, Params[i].Duration.unit) + let D = new Duration(Params[1].Duration.value, Params[1].Duration.unit) Params[1] = D; } } From b3cb86f144c7c96f10511bf1959434d16f64f0e6 Mon Sep 17 00:00:00 2001 From: Marcus Davies <55892693+marcus-j-davies@users.noreply.github.com> Date: Tue, 25 May 2021 17:23:23 +0100 Subject: [PATCH 16/18] Update managed.md --- managed.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/managed.md b/managed.md index e03a0f17..0dffa95a 100644 --- a/managed.md +++ b/managed.md @@ -159,9 +159,12 @@ return Message ``` ## Forcing Updates -If you prefer Managed Mode, but have devices (or endpoints), that do not report back updated values, +If you prefer Managed Mode, but have devices (or endpoints), that do not report back updated values, you can enforce an update by suppplying a **forceUpdate** object, and providing -a **property** and optionally **propertyKey** - both of which are avalable in VALUE_UPDATED events. +properties normally found in **VALUE_UPDATED** events, namely **property** and sometimes **propertyKey**. + +Whilst you can overwrite the force update request and set **endpoint** and **commandClass**, +Unless there is a specfic reason to do so, it's best to allow the system to take care of this for you. This will cause extra traffic in your network, so only use this if needed. From b664affc18568625c1bf799999da173ef505e40e Mon Sep 17 00:00:00 2001 From: Marcus Davies <55892693+marcus-j-davies@users.noreply.github.com> Date: Tue, 25 May 2021 17:25:12 +0100 Subject: [PATCH 17/18] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7ab887ab..a4ab30e4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,7 +10,7 @@ **endpoint** is now the required property (no longer a capital P) if specifying the endpoint. See change log for **1.3.0**. - Optimisations to **Duration** porcessing - - The **forceUpdate** object for Managed access, can now contain any property normally found in the ValueID interface. + - The **forceUpdate** object for Managed access, can now contain any property normally found in the ValueID interface. Including overwriting the **endpoint** property - which will normally be provided for you. - Bump Z-Wave JS to 7.5.2 - Bump Serial Ports From 9a835d9378d5b6e7c3118447892cb49c5e0d5d31 Mon Sep 17 00:00:00 2001 From: Marcus Davies <55892693+marcus-j-davies@users.noreply.github.com> Date: Tue, 25 May 2021 17:26:37 +0100 Subject: [PATCH 18/18] Update managed.md --- managed.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/managed.md b/managed.md index 0dffa95a..889de78c 100644 --- a/managed.md +++ b/managed.md @@ -164,7 +164,7 @@ you can enforce an update by suppplying a **forceUpdate** object, and providing properties normally found in **VALUE_UPDATED** events, namely **property** and sometimes **propertyKey**. Whilst you can overwrite the force update request and set **endpoint** and **commandClass**, -Unless there is a specfic reason to do so, it's best to allow the system to take care of this for you. +Unless there is a specific reason to do so, it's best to allow the system to take care of this for you. This will cause extra traffic in your network, so only use this if needed.