diff --git a/packages/cc/src/cc/VersionCC.ts b/packages/cc/src/cc/VersionCC.ts index 105976913938..b41d6c99ae6e 100644 --- a/packages/cc/src/cc/VersionCC.ts +++ b/packages/cc/src/cc/VersionCC.ts @@ -680,7 +680,7 @@ export class VersionCCReport extends VersionCC { } else { if (!/^\d+\.\d+(\.\d+)?$/.test(options.protocolVersion)) { throw new ZWaveError( - `protocolVersion must be a string in the format "major.minor", received "${options.protocolVersion}"`, + `protocolVersion must be a string in the format "major.minor" or "major.minor.patch", received "${options.protocolVersion}"`, ZWaveErrorCodes.Argument_Invalid, ); } else if ( @@ -689,7 +689,7 @@ export class VersionCCReport extends VersionCC { ) ) { throw new ZWaveError( - `firmwareVersions must be an array of strings in the format "major.minor", received "${ + `firmwareVersions must be an array of strings in the format "major.minor" or "major.minor.patch", received "${ JSON.stringify( options.firmwareVersions, ) diff --git a/packages/zwave-js/src/lib/node/Node.ts b/packages/zwave-js/src/lib/node/Node.ts index e7e81d0c258c..db20f1cfd8bb 100644 --- a/packages/zwave-js/src/lib/node/Node.ts +++ b/packages/zwave-js/src/lib/node/Node.ts @@ -248,9 +248,10 @@ import { randomBytes } from "node:crypto"; import { EventEmitter } from "node:events"; import path from "node:path"; import { isDeepStrictEqual } from "node:util"; +import semver from "semver"; import { RemoveNodeReason } from "../controller/Inclusion"; import { determineNIF } from "../controller/NodeInformationFrame"; -import type { Driver } from "../driver/Driver"; +import { type Driver, libVersion } from "../driver/Driver"; import { cacheKeys } from "../driver/NetworkCache"; import { type Extended, interpretEx } from "../driver/StateMachineShared"; import type { StatisticsEventCallbacksWithSelf } from "../driver/Statistics"; @@ -4031,10 +4032,17 @@ protocol version: ${this.protocolVersion}`; & ~EncapsulationFlags.Supervision, }); + const firmwareVersion1 = semver.parse(libVersion, { loose: true })!; + await api.sendReport({ libraryType: ZWaveLibraryTypes["Static Controller"], protocolVersion: this.driver.controller.protocolVersion!, - firmwareVersions: [this.driver.controller.firmwareVersion!], + firmwareVersions: [ + // Firmware 0 is the Z-Wave chip firmware + this.driver.controller.firmwareVersion!, + // Firmware 1 is Z-Wave JS itself + `${firmwareVersion1.major}.${firmwareVersion1.minor}.${firmwareVersion1.patch}`, + ], hardwareVersion: this.driver.options.vendor?.hardwareVersion, }); }