Skip to content

Commit

Permalink
Merge branch 'master' into ts-eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
AlCalzone committed Sep 25, 2024
2 parents b02f68b + ff25b5e commit 71ecc54
Show file tree
Hide file tree
Showing 107 changed files with 6,326 additions and 32,708 deletions.
13 changes: 13 additions & 0 deletions .github/DISCUSSION_TEMPLATE/request-support-investigate-issue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,19 @@ body:
If you are using something non-standard, tell us here: ...
- type: textarea
id: controller
attributes:
label: Z-Wave Controller (Stick/Dongle/...)
description: |
Some issues are known to be caused by the Z-Wave controller.
Please let us know which controller and firmware you are using:
value: |
Manufacturer: ...
Model name: ...
Firmware version: ...
- type: textarea
id: devices
attributes:
Expand Down
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@
<!--
Add placeholder for next release with `wip` snippet
-->
## 13.4.0 (2024-09-24)
### Features
* Added `Controller.nvm` property to enable incremental modification of NVM contents on the fly (#7153)
* When the `NODE_ENV` env variable is set to `development`, debugging information for S0 encryption is included in logs (#7181)
* Add driver preset `NO_WATCHDOG` to disable watchdog (#7188)

### Config file changes
* Update Z-Wave SDK warnings to mention recommended versions (#7187)
* Update Zooz devices (#7186)

## 13.3.1 (2024-09-17)
### Bugfixes
* Fixed the identification of the primary controller role on some older controllers (#7174)
Expand Down
14 changes: 11 additions & 3 deletions docs/getting-started/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,20 @@

## Does Z-Wave JS support secondary controllers?

Yes and no.
Mostly.

Z-Wave JS expects to **be the primary controller** in the network and it will try to assume that role when started. It will not work correctly as a secondary controller.
Slightly longer answer:\
On startup, Z-Wave JS detects whether the Z-Wave module it controls is a primary controller or a secondary/inclusion controller.

It does however support **having secondary controllers in the network**. This includes:
Its default operation mode is acting as a **primary controller**, or assuming that role if there is none in the network. In this mode, it supports **having secondary controllers in the network**. This includes:

- Including/excluding a secondary controller
- Letting secondary controllers (inclusion controllers) include and exclude devices
- Perform network key exchange with devices included by a secondary controller

Z-Wave JS also supports joining other networks as a **secondary controller**. This mode is not meant for controlling a smart home, because reports are sent to the primary controller.

> [!WARNING] Secondary controller support is still experimental and has some limitations:
>
> - Including devices on behalf of the primary controller does not work
> - Devices won't be interviewed by default. Triggering an interview manually may set up the lifelines incorrectly.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@zwave-js/repo",
"version": "13.3.1",
"version": "13.4.0",
"private": true,
"description": "Z-Wave driver written entirely in JavaScript/TypeScript",
"keywords": [],
Expand Down
2 changes: 1 addition & 1 deletion packages/cc/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@zwave-js/cc",
"version": "13.3.1",
"version": "13.4.0",
"description": "zwave-js: Command Classes",
"keywords": [],
"publishConfig": {
Expand Down
37 changes: 37 additions & 0 deletions packages/cc/src/cc/SecurityCC.ts
Original file line number Diff line number Diff line change
Expand Up @@ -656,6 +656,11 @@ export class SecurityCCCommandEncapsulation extends SecurityCC {
this.secondFrame = !!(frameControl & 0b10_0000);

this.decryptedCCBytes = frameControlAndDecryptedCC.subarray(1);

// Remember for debugging purposes
this.authData = authData;
this.authCode = authCode;
this.iv = iv;
} else {
this.encapsulated = options.encapsulated;
options.encapsulated.encapsulatingCC = this as any;
Expand Down Expand Up @@ -687,6 +692,12 @@ export class SecurityCCCommandEncapsulation extends SecurityCC {
}
public nonce: Buffer | undefined;

// Only used testing/for debugging purposes
private iv?: Buffer;
private authData?: Buffer;
private authCode?: Buffer;
private ciphertext?: Buffer;

public getPartialCCSessionId(): Record<string, any> | undefined {
if (this.sequenced) {
return {
Expand Down Expand Up @@ -750,6 +761,12 @@ export class SecurityCCCommandEncapsulation extends SecurityCC {
);
const authCode = computeMAC(authData, this.authKey);

// Remember for debugging purposes
this.iv = iv;
this.authData = authData;
this.authCode = authCode;
this.ciphertext = ciphertext;

this.payload = Buffer.concat([
senderNonce,
ciphertext,
Expand Down Expand Up @@ -780,6 +797,26 @@ export class SecurityCCCommandEncapsulation extends SecurityCC {
}
}
}
// Log the plaintext in integration tests and development mode
if (
process.env.NODE_ENV === "test"
|| process.env.NODE_ENV === "development"
) {
if (this.iv) {
message.IV = buffer2hex(this.iv);
}
if (this.ciphertext) {
message.ciphertext = buffer2hex(this.ciphertext);
} else if (this.decryptedCCBytes) {
message.plaintext = buffer2hex(this.decryptedCCBytes);
}
if (this.authData) {
message["auth data"] = buffer2hex(this.authData);
}
if (this.authCode) {
message["auth code"] = buffer2hex(this.authCode);
}
}
return {
...super.toLogEntry(host),
message,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,14 @@
"$import": "~/templates/master_template.json#7xx_firmware_bug_pre_7_17_2"
},
{
"$if": "firmwareVersion === 7.19.1",
"$import": "~/templates/master_template.json#7xx_firmware_bug_7_19_1"
// Not sure if this is a 700 or 800 series controller. Show the generic warning
"$if": "firmwareVersion >= 7.19.1 && firmwareVersion <= 7.21.3",
"$import": "~/templates/master_template.json#7xx_8xx_firmware_bug_7_19_to_7_21_3_or_7_22_1"
},
{
"$if": "firmwareVersion === 7.19.3",
"$import": "~/templates/master_template.json#7xx_firmware_bug_7_19_3"
// 7.22.x is limited to 800 series
"$if": "firmwareVersion === 7.22.0",
"$import": "~/templates/master_template.json#8xx_firmware_bug_pre_7_22_1"
}
]
}
Expand Down
9 changes: 3 additions & 6 deletions packages/config/config/devices/0x027a/zac93.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,10 @@
// 700/800 series firmware bugs that affect multiple controllers
"comments": [
// https://www.support.getzooz.com/kb/article/1158-zooz-ota-firmware-files/
// These controllers started shipping with 7.18.1:
// 1.1 = 7.18.1
// (1.3 = 1.4 = 1.10) = 7.18.3
// 1.20 = 7.19.3
// 1.40 = SDK 7.22.0. No fixed version available yet.
{
"$if": "firmwareVersion === 1.20",
"$import": "~/templates/master_template.json#7xx_firmware_bug_7_19_3"
"$if": "firmwareVersion <= 1.40",
"$import": "~/templates/master_template.json#8xx_firmware_bug_pre_7_22_1"
}
]
}
Expand Down
3 changes: 2 additions & 1 deletion packages/config/config/devices/0x027a/zen14.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
// 800 series (LR) starting with firmware 2.0
{
"manufacturer": "Zooz",
"manufacturerId": "0x027a",
"label": "ZEN14",
"description": "700 Series Outdoor Double Plug",
"description": "Outdoor Double Plug",
"devices": [
{
"productType": "0x7000",
Expand Down
12 changes: 3 additions & 9 deletions packages/config/config/devices/0x027a/zen30.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,8 @@
{
"manufacturer": "Zooz",
"manufacturerId": "0x027a",
"label": [
{
"$if": "firmwareVersion >= 4.10",
"value": "ZEN30 800LR"
},
"ZEN30"
],
"description": "Dimmer & Dry Contact Relay",
"label": "ZEN30",
"description": "Double Switch",
"devices": [
{
"productType": "0xa000",
Expand Down Expand Up @@ -316,7 +310,7 @@
{
// This device exposes a Multilevel Switch (Dimmer) on endpoint 0, and a Binary Switch (Relay) on endpoint 1
// Our heuristic currently detects endpoint 1 as unnecessary and hides it from the user.
// This problem is fixed in firmare 3.20 and higher
// This problem is fixed in firmware 3.20 and higher
"$if": "firmwareVersion < 3.20",
"preserveEndpoints": "*",
"preserveRootApplicationCCValueIDs": true
Expand Down
8 changes: 1 addition & 7 deletions packages/config/config/devices/0x027a/zen32.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,7 @@
{
"manufacturer": "Zooz",
"manufacturerId": "0x027a",
"label": [
{
"$if": "firmwareVersion >= 2.10 && firmwareVersion < 10.0",
"value": "ZEN32 800LR"
},
"ZEN32"
],
"label": "ZEN32",
"description": "Scene Controller",
"devices": [
{
Expand Down
3 changes: 2 additions & 1 deletion packages/config/config/devices/0x027a/zen34.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
// 800 series (LR) starting with firmware 2.0
{
"manufacturer": "Zooz",
"manufacturerId": "0x027a",
"label": "ZEN34",
"description": "Z-Wave Plus 700 Series Remote Switch",
"description": "Remote Switch",
"devices": [
{
"productType": "0x0004",
Expand Down
12 changes: 3 additions & 9 deletions packages/config/config/devices/0x027a/zen51.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
{
"manufacturer": "Zooz",
"manufacturerId": "0x027a",
"label": [
{
"$if": "productType === 0x0904",
"value": "ZEN51 LR"
},
"ZEN51"
],
"description": "700 Series Dry Contact Relay",
"label": "ZEN51",
"description": "Dry Contact Relay",
"devices": [
{
// Regular Z-Wave version:
Expand All @@ -17,7 +11,7 @@
"zwaveAllianceId": 4610
},
{
// Long Range capable version:
// Long Range capable version (firmware 1.50+):
"productType": "0x0904",
"productId": "0x0201"
}
Expand Down
12 changes: 3 additions & 9 deletions packages/config/config/devices/0x027a/zen52.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
{
"manufacturer": "Zooz",
"manufacturerId": "0x027a",
"label": [
{
"$if": "productType === 0x0904",
"value": "ZEN52 LR"
},
"ZEN52"
],
"description": "700 Series Double Relay",
"label": "ZEN52",
"description": "Double Relay",
"devices": [
{
// Regular Z-Wave version:
Expand All @@ -17,7 +11,7 @@
"zwaveAllianceId": 4609
},
{
// Long Range capable version:
// Long Range capable version (firmware 1.50+):
"productType": "0x0904",
"productId": "0x0202"
}
Expand Down
10 changes: 2 additions & 8 deletions packages/config/config/devices/0x027a/zen71.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,8 @@
{
"manufacturer": "Zooz",
"manufacturerId": "0x027a",
"label": [
{
"$if": "firmwareVersion >= 3.10 && firmwareVersion < 10.0",
"value": "ZEN71 800LR"
},
"ZEN71"
],
"description": "ON/OFF Switch",
"label": "ZEN71",
"description": "On/Off Switch",
"devices": [
{
"productType": "0x7000",
Expand Down
10 changes: 2 additions & 8 deletions packages/config/config/devices/0x027a/zen72.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,8 @@
{
"manufacturer": "Zooz",
"manufacturerId": "0x027a",
"label": [
{
"$if": "firmwareVersion >= 3.10 && firmwareVersion < 10.0",
"value": "ZEN72 800LR"
},
"ZEN72"
],
"description": "Dimmer Switch",
"label": "ZEN72",
"description": "Dimmer",
"devices": [
{
"productType": "0x7000",
Expand Down
3 changes: 2 additions & 1 deletion packages/config/config/devices/0x027a/zen73.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
// 800 series (LR) starting with firmware 2.10
{
"manufacturer": "Zooz",
"manufacturerId": "0x027a",
"label": "ZEN73",
"description": "700 Toggle Switch",
"description": "Toggle Switch",
"devices": [
{
"productType": "0x7000",
Expand Down
3 changes: 2 additions & 1 deletion packages/config/config/devices/0x027a/zen74.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
// 800 series (LR) starting with firmware 2.10
{
"manufacturer": "Zooz",
"manufacturerId": "0x027a",
"label": "ZEN74",
"description": "700 Toggle Dimmer",
"description": "Toggle Dimmer",
"devices": [
{
"productType": "0x7000",
Expand Down
10 changes: 2 additions & 8 deletions packages/config/config/devices/0x027a/zen76.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,8 @@
{
"manufacturer": "Zooz",
"manufacturerId": "0x027a",
"label": [
{
"$if": "firmwareVersion >= 3.10 && firmwareVersion < 10.0",
"value": "ZEN76 800LR"
},
"ZEN76"
],
"description": "S2 ON/OFF Switch",
"label": "ZEN76",
"description": "S2 On/Off Switch",
"devices": [
{
"productType": "0x7000",
Expand Down
10 changes: 2 additions & 8 deletions packages/config/config/devices/0x027a/zen77.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,8 @@
{
"manufacturer": "Zooz",
"manufacturerId": "0x027a",
"label": [
{
"$if": "firmwareVersion >= 4.10 && firmwareVersion < 10.0",
"value": "ZEN77 800LR"
},
"ZEN77"
],
"description": "S2 Dimmer Switch",
"label": "ZEN77",
"description": "S2 Dimmer",
"devices": [
{
"productType": "0x7000",
Expand Down
Loading

0 comments on commit 71ecc54

Please sign in to comment.