From 8d1a35158cf23d87844e4a230edc3647d4f4e6d0 Mon Sep 17 00:00:00 2001 From: Raman Gupta <7243222+raman325@users.noreply.github.com> Date: Fri, 6 Oct 2023 16:04:31 -0400 Subject: [PATCH 01/20] Add zwave configuration options for timeouts and attempts --- zwave_js/config.yaml | 18 +++++++++++++++++- zwave_js/rootfs/etc/cont-init.d/config.sh | 7 ++++++- .../rootfs/usr/share/tempio/zwave_config.conf | 2 ++ zwave_js/translations/en.yaml | 13 +++++++++++++ 4 files changed, 38 insertions(+), 2 deletions(-) diff --git a/zwave_js/config.yaml b/zwave_js/config.yaml index e122e72f194..24a21c8b7a4 100644 --- a/zwave_js/config.yaml +++ b/zwave_js/config.yaml @@ -35,8 +35,24 @@ schema: s2_access_control_key: match(|[0-9a-fA-F]{32,32})? s2_authenticated_key: match(|[0-9a-fA-F]{32,32})? s2_unauthenticated_key: match(|[0-9a-fA-F]{32,32})? - emulate_hardware: bool? network_key: match(|[0-9a-fA-F]{32,32})? + emulate_hardware: bool? + timeouts: + ack: int(1,)? + byte: int(1,)? + response: int(500,20000)? + sendDataCallback: int(10000,)? + report: int(500,10000)? + nonce: int(3000,20000)? + retryJammed: int(10,5000)? + sendToSleep: int(10,5000)? + serialAPIStarted: int(1000,30000)? + attempts: + openSerialPort: int(500,20000)? + controller: int(1,3)? + sendData: int(1,5)? + sendDataJammed: int(1,10)? + nodeInterview: int(1,10)? stage: stable startup: services timeout: 30 diff --git a/zwave_js/rootfs/etc/cont-init.d/config.sh b/zwave_js/rootfs/etc/cont-init.d/config.sh index 8b4a6b25ac6..1133699a4b8 100755 --- a/zwave_js/rootfs/etc/cont-init.d/config.sh +++ b/zwave_js/rootfs/etc/cont-init.d/config.sh @@ -119,6 +119,9 @@ else bashio::log.info "Soft-reset disabled by user" fi +timeouts=$(bashio::config 'timeouts' '{}') +attempts=$(bashio::config 'attempts' '{}') + # Generate config bashio::var.json \ s0_legacy "${s0_legacy}" \ @@ -126,7 +129,9 @@ bashio::var.json \ s2_authenticated "${s2_authenticated}" \ s2_unauthenticated "${s2_unauthenticated}" \ log_level "${log_level}" \ - soft_reset "^${soft_reset}" | + soft_reset "^${soft_reset}" \ + timeouts "${timeouts}" \ + attempts "${attempts}" | tempio \ -template /usr/share/tempio/zwave_config.conf \ -out /etc/zwave_config.json diff --git a/zwave_js/rootfs/usr/share/tempio/zwave_config.conf b/zwave_js/rootfs/usr/share/tempio/zwave_config.conf index 1d17a3491dc..a1c193c9280 100644 --- a/zwave_js/rootfs/usr/share/tempio/zwave_config.conf +++ b/zwave_js/rootfs/usr/share/tempio/zwave_config.conf @@ -14,5 +14,7 @@ "S2_Authenticated": "{{ .s2_authenticated }}", "S2_Unauthenticated": "{{ .s2_unauthenticated }}" }, + "timeouts": {{ .timeouts }}, + "attempts": {{ .attempts }}, "enableSoftReset": {{ .soft_reset }} } diff --git a/zwave_js/translations/en.yaml b/zwave_js/translations/en.yaml index ea37c149263..076604eba84 100644 --- a/zwave_js/translations/en.yaml +++ b/zwave_js/translations/en.yaml @@ -45,5 +45,18 @@ configuration: automatically detect whether or not this needs to be enabled. The default setting should work for most users, so only change this setting if you know what you are doing and/or you are asked to. + timeouts: + name: Timeouts in milliseconds + description: >- + This section overrides the various default timeouts. The defaults should + work for most users, so only change these if you know what you if you + know what you are doing and/or you are asked to. + attempts: + name: Attempts + description: >- + This section overrides the various default number of attempts to retry + before the driver gives up. The defaults should work for most users, so + only change these if you know what you if you know what you are doing + and/or you are asked to. network: 3000/tcp: Z-Wave JS communication From d808ca47db97ce8ad751945f90faa450aca6a45c Mon Sep 17 00:00:00 2001 From: Raman Gupta <7243222+raman325@users.noreply.github.com> Date: Fri, 6 Oct 2023 16:08:46 -0400 Subject: [PATCH 02/20] Add release notes --- zwave_js/CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/zwave_js/CHANGELOG.md b/zwave_js/CHANGELOG.md index e8ab49f03e9..145228d924f 100644 --- a/zwave_js/CHANGELOG.md +++ b/zwave_js/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## 0.1.99 + +### Features + +- Add-on: Add `timeouts` and `attempts` configuration options to adjust the defaults for the corresponding Z-Wave driver options. These are advanced configuration options that should not be adjusted in most cases and have therefore been hidden from the default view. + ## 0.1.98 ### Bug fixes From a238aecb88e9f6e9860b7a6cb55177f26459b401 Mon Sep 17 00:00:00 2001 From: Raman Gupta <7243222+raman325@users.noreply.github.com> Date: Tue, 10 Oct 2023 07:41:45 -0400 Subject: [PATCH 03/20] Update config.yaml Co-authored-by: AlCalzone --- zwave_js/config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zwave_js/config.yaml b/zwave_js/config.yaml index 24a21c8b7a4..16a39281ca9 100644 --- a/zwave_js/config.yaml +++ b/zwave_js/config.yaml @@ -40,7 +40,7 @@ schema: timeouts: ack: int(1,)? byte: int(1,)? - response: int(500,20000)? + response: int(500,60000)? sendDataCallback: int(10000,)? report: int(500,10000)? nonce: int(3000,20000)? From a7e0961c78ec608adb496cdb082b28002ce92496 Mon Sep 17 00:00:00 2001 From: Raman Gupta <7243222+raman325@users.noreply.github.com> Date: Fri, 13 Oct 2023 11:09:58 -0400 Subject: [PATCH 04/20] Switch approach to having a safe mode option --- zwave_js/CHANGELOG.md | 2 +- zwave_js/DOCS.md | 18 ++++++++---- zwave_js/config.yaml | 17 +---------- zwave_js/rootfs/etc/cont-init.d/config.sh | 28 ++++++++++++++++--- .../rootfs/usr/share/tempio/zwave_config.conf | 4 +-- zwave_js/translations/en.yaml | 21 ++++++-------- 6 files changed, 48 insertions(+), 42 deletions(-) diff --git a/zwave_js/CHANGELOG.md b/zwave_js/CHANGELOG.md index 145228d924f..748e0bf7af5 100644 --- a/zwave_js/CHANGELOG.md +++ b/zwave_js/CHANGELOG.md @@ -4,7 +4,7 @@ ### Features -- Add-on: Add `timeouts` and `attempts` configuration options to adjust the defaults for the corresponding Z-Wave driver options. These are advanced configuration options that should not be adjusted in most cases and have therefore been hidden from the default view. +- Add-on: Add `safe_mode` configuration option to put Z-Wave network in safe mode. This can be help with troubleshooting network issues and getting access to logs that you otherwise wouldn't be able to. This is an advanced configuration option that should not be adjusted in most cases and is therefore hidden from the default view. ## 0.1.98 diff --git a/zwave_js/DOCS.md b/zwave_js/DOCS.md index 684cd57457d..5a6f83d2644 100644 --- a/zwave_js/DOCS.md +++ b/zwave_js/DOCS.md @@ -138,11 +138,6 @@ This option sets the log level of Z-Wave JS. Valid options are: If no `log_level` is specified, the log level will be set to the level set in the Supervisor. -### Option `emulate_hardware` (optional) - -If you don't have a USB stick, you can use a fake stick for testing purposes. -It will not be able to control any real devices. - ### Option `soft_reset` This setting tells the add-on how to handle soft-resets for 500 series controllers: @@ -150,6 +145,19 @@ This setting tells the add-on how to handle soft-resets for 500 series controlle 2. Enabled - Soft-reset will be explicitly enabled for 500 series controllers. 3. Disabled - Soft-reset will be explicitly disabled for 500 series controllers. +### Option `emulate_hardware` (optional) + +If you don't have a USB stick, you can use a fake stick for testing purposes. +It will not be able to control any real devices. + +### Option `safe_mode` (optional) + +This setting puts your network in safe mode, which could significantly decrease +the performance of your network but may also help get the network up and running +so that you can troubleshoot issues, grab logs, etc. In most cases, users will +never need to use this feature, so only change this setting if you know what you +are doing and/or you are asked to. + ### Option `network_key` (deprecated) In previous versions of the addon, this was the only key that was needed. With diff --git a/zwave_js/config.yaml b/zwave_js/config.yaml index 16a39281ca9..1351f977790 100644 --- a/zwave_js/config.yaml +++ b/zwave_js/config.yaml @@ -37,22 +37,7 @@ schema: s2_unauthenticated_key: match(|[0-9a-fA-F]{32,32})? network_key: match(|[0-9a-fA-F]{32,32})? emulate_hardware: bool? - timeouts: - ack: int(1,)? - byte: int(1,)? - response: int(500,60000)? - sendDataCallback: int(10000,)? - report: int(500,10000)? - nonce: int(3000,20000)? - retryJammed: int(10,5000)? - sendToSleep: int(10,5000)? - serialAPIStarted: int(1000,30000)? - attempts: - openSerialPort: int(500,20000)? - controller: int(1,3)? - sendData: int(1,5)? - sendDataJammed: int(1,10)? - nodeInterview: int(1,10)? + safe_mode: bool? stage: stable startup: services timeout: 30 diff --git a/zwave_js/rootfs/etc/cont-init.d/config.sh b/zwave_js/rootfs/etc/cont-init.d/config.sh index 1133699a4b8..0d9bde35981 100755 --- a/zwave_js/rootfs/etc/cont-init.d/config.sh +++ b/zwave_js/rootfs/etc/cont-init.d/config.sh @@ -119,8 +119,29 @@ else bashio::log.info "Soft-reset disabled by user" fi -timeouts=$(bashio::config 'timeouts' '{}') -attempts=$(bashio::config 'attempts' '{}') +timeouts_and_attempts="" + +if bashio::config.true 'safe_mode'; then + timeouts_and_attempts=", + \"timeouts\": { + \"ack\": 10000, + \"byte\": 10000, + \"response\": 60000, + \"sendDataCallback\": 650000, + \"report\": 10000, + \"nonce\": 20000, + \"retryJammed\": 5000, + \"sendToSleep\": 5000, + \"serialAPIStarted\": 30000 + }, + \"attempts\": { + \"openSerialPort\": 20000, + \"controller\": 3, + \"sendData\": 5, + \"sendDataJammed\": 10, + \"nodeInterview\": 10 + }" +fi # Generate config bashio::var.json \ @@ -130,8 +151,7 @@ bashio::var.json \ s2_unauthenticated "${s2_unauthenticated}" \ log_level "${log_level}" \ soft_reset "^${soft_reset}" \ - timeouts "${timeouts}" \ - attempts "${attempts}" | + timeouts_and_attempts "${timeouts_and_attempts}" | tempio \ -template /usr/share/tempio/zwave_config.conf \ -out /etc/zwave_config.json diff --git a/zwave_js/rootfs/usr/share/tempio/zwave_config.conf b/zwave_js/rootfs/usr/share/tempio/zwave_config.conf index a1c193c9280..3b04a5cd973 100644 --- a/zwave_js/rootfs/usr/share/tempio/zwave_config.conf +++ b/zwave_js/rootfs/usr/share/tempio/zwave_config.conf @@ -14,7 +14,5 @@ "S2_Authenticated": "{{ .s2_authenticated }}", "S2_Unauthenticated": "{{ .s2_unauthenticated }}" }, - "timeouts": {{ .timeouts }}, - "attempts": {{ .attempts }}, - "enableSoftReset": {{ .soft_reset }} + "enableSoftReset": {{ .soft_reset }}{{ .timeouts_and_attempts }} } diff --git a/zwave_js/translations/en.yaml b/zwave_js/translations/en.yaml index 076604eba84..ad0926d4d0a 100644 --- a/zwave_js/translations/en.yaml +++ b/zwave_js/translations/en.yaml @@ -45,18 +45,13 @@ configuration: automatically detect whether or not this needs to be enabled. The default setting should work for most users, so only change this setting if you know what you are doing and/or you are asked to. - timeouts: - name: Timeouts in milliseconds - description: >- - This section overrides the various default timeouts. The defaults should - work for most users, so only change these if you know what you if you - know what you are doing and/or you are asked to. - attempts: - name: Attempts - description: >- - This section overrides the various default number of attempts to retry - before the driver gives up. The defaults should work for most users, so - only change these if you know what you if you know what you are doing - and/or you are asked to. + safe_mode: + name: Enable safe mode + description: >- + This setting puts your network in safe mode, which could significantly decrease + the performance of your network but may also help get the network up and running + so that you can troubleshoot issues, grab logs, etc. In most cases, users will + never need to use this feature, so only change this setting if you know what you + are doing and/or you are asked to. network: 3000/tcp: Z-Wave JS communication From d0cc7a7bf8404a1c9943bbe82ee30b496b80af9f Mon Sep 17 00:00:00 2001 From: Raman Gupta <7243222+raman325@users.noreply.github.com> Date: Fri, 13 Oct 2023 11:15:42 -0400 Subject: [PATCH 05/20] lint --- zwave_js/translations/en.yaml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/zwave_js/translations/en.yaml b/zwave_js/translations/en.yaml index ad0926d4d0a..201360cf07e 100644 --- a/zwave_js/translations/en.yaml +++ b/zwave_js/translations/en.yaml @@ -48,10 +48,11 @@ configuration: safe_mode: name: Enable safe mode description: >- - This setting puts your network in safe mode, which could significantly decrease - the performance of your network but may also help get the network up and running - so that you can troubleshoot issues, grab logs, etc. In most cases, users will - never need to use this feature, so only change this setting if you know what you - are doing and/or you are asked to. + This setting puts your network in safe mode, which could significantly + decrease the performance of your network but may also help get the + network up and running so that you can troubleshoot issues, grab logs, + etc. In most cases, users will never need to use this feature, so only + change this setting if you know what you are doing and/or you are asked + to. network: 3000/tcp: Z-Wave JS communication From 62cf92d0578446df89ef2d3db5e7bbb35ec09962 Mon Sep 17 00:00:00 2001 From: Raman Gupta <7243222+raman325@users.noreply.github.com> Date: Mon, 16 Oct 2023 08:13:54 -0400 Subject: [PATCH 06/20] Update config.yaml --- zwave_js/config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zwave_js/config.yaml b/zwave_js/config.yaml index 1351f977790..27bc1b9b2e2 100644 --- a/zwave_js/config.yaml +++ b/zwave_js/config.yaml @@ -1,5 +1,5 @@ --- -version: 0.1.98 +version: 0.1.99 slug: zwave_js name: Z-Wave JS description: Control a Z-Wave network with Home Assistant Z-Wave JS From b36c72cc5e8d96f0e34a2e514c1d117e265e274a Mon Sep 17 00:00:00 2001 From: Raman Gupta <7243222+raman325@users.noreply.github.com> Date: Tue, 17 Oct 2023 10:51:28 -0400 Subject: [PATCH 07/20] Bump zwave-js to 12.2.0 and introduce semantic versioning --- zwave_js/CHANGELOG.md | 12 +++++++++++- zwave_js/build.yaml | 2 +- zwave_js/config.yaml | 2 +- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/zwave_js/CHANGELOG.md b/zwave_js/CHANGELOG.md index 748e0bf7af5..44ee5d6d6d2 100644 --- a/zwave_js/CHANGELOG.md +++ b/zwave_js/CHANGELOG.md @@ -1,10 +1,20 @@ # Changelog -## 0.1.99 +## 1.0.0 ### Features - Add-on: Add `safe_mode` configuration option to put Z-Wave network in safe mode. This can be help with troubleshooting network issues and getting access to logs that you otherwise wouldn't be able to. This is an advanced configuration option that should not be adjusted in most cases and is therefore hidden from the default view. +- Add-on: Introduce semantic versioning. Due to a bug in early versions of the Z-Wave JS integration, release versions had to be less than `2.x` in order to stay backwards compatible. This made it impossible to use semantic versioning. With semantic versioning, major version changes to the addon will now reflect major changes, such as a major version release of Z-Wave JS, or a significant change to the add-on structure. This should help users better understand the potential impact of an upgrade. + +### Bug fixes + +- Z-Wave JS: Includes several more fixes and workarounds for the problematic interaction between some controller firmware bugs and the automatic controller recovery introduced in the `v12` release + +### Config file changes + +- Add NEO Cool Cam Repeater +- Increase report timeout for Aeotec Multisensor 6 to 2s ## 0.1.98 diff --git a/zwave_js/build.yaml b/zwave_js/build.yaml index f0634a65bbd..6ae0bf269e4 100644 --- a/zwave_js/build.yaml +++ b/zwave_js/build.yaml @@ -10,4 +10,4 @@ codenotary: base_image: notary@home-assistant.io args: ZWAVEJS_SERVER_VERSION: 1.32.1 - ZWAVEJS_VERSION: 12.1.1 + ZWAVEJS_VERSION: 12.2.0 diff --git a/zwave_js/config.yaml b/zwave_js/config.yaml index 27bc1b9b2e2..b49e47f31f2 100644 --- a/zwave_js/config.yaml +++ b/zwave_js/config.yaml @@ -1,5 +1,5 @@ --- -version: 0.1.99 +version: 1.0.0 slug: zwave_js name: Z-Wave JS description: Control a Z-Wave network with Home Assistant Z-Wave JS From 9acbdfb9f11b906d1753765cd41f2589ece3c1af Mon Sep 17 00:00:00 2001 From: Raman Gupta <7243222+raman325@users.noreply.github.com> Date: Tue, 17 Oct 2023 10:53:17 -0400 Subject: [PATCH 08/20] Add breaking change note --- zwave_js/CHANGELOG.md | 4 ++++ zwave_js/config.yaml | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/zwave_js/CHANGELOG.md b/zwave_js/CHANGELOG.md index 44ee5d6d6d2..b9f48093b4c 100644 --- a/zwave_js/CHANGELOG.md +++ b/zwave_js/CHANGELOG.md @@ -2,6 +2,10 @@ ## 1.0.0 +### Breaking changes + +- Users that are on Home Assistant versions `2021.2.x` will no longer be able to receive add-on updates. Users still on this version are encouraged to update to a newer version which will support additional updates and will have many additional capabilities in the integration. + ### Features - Add-on: Add `safe_mode` configuration option to put Z-Wave network in safe mode. This can be help with troubleshooting network issues and getting access to logs that you otherwise wouldn't be able to. This is an advanced configuration option that should not be adjusted in most cases and is therefore hidden from the default view. diff --git a/zwave_js/config.yaml b/zwave_js/config.yaml index b49e47f31f2..18515eacea4 100644 --- a/zwave_js/config.yaml +++ b/zwave_js/config.yaml @@ -14,7 +14,7 @@ codenotary: notary@home-assistant.io discovery: - zwave_js hassio_api: true -homeassistant: 2021.2.0b0 +homeassistant: 2021.3.0b0 image: homeassistant/{arch}-addon-zwave_js init: false options: From c9046400cb9426a533c7b17a3b1e84d4f2a7142d Mon Sep 17 00:00:00 2001 From: Raman Gupta <7243222+raman325@users.noreply.github.com> Date: Tue, 17 Oct 2023 11:24:33 -0400 Subject: [PATCH 09/20] update changelog --- zwave_js/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zwave_js/CHANGELOG.md b/zwave_js/CHANGELOG.md index b9f48093b4c..8e61aebf678 100644 --- a/zwave_js/CHANGELOG.md +++ b/zwave_js/CHANGELOG.md @@ -9,7 +9,7 @@ ### Features - Add-on: Add `safe_mode` configuration option to put Z-Wave network in safe mode. This can be help with troubleshooting network issues and getting access to logs that you otherwise wouldn't be able to. This is an advanced configuration option that should not be adjusted in most cases and is therefore hidden from the default view. -- Add-on: Introduce semantic versioning. Due to a bug in early versions of the Z-Wave JS integration, release versions had to be less than `2.x` in order to stay backwards compatible. This made it impossible to use semantic versioning. With semantic versioning, major version changes to the addon will now reflect major changes, such as a major version release of Z-Wave JS, or a significant change to the add-on structure. This should help users better understand the potential impact of an upgrade. +- Add-on: Introduce semantic versioning. With semantic versioning, major version changes to the addon will now reflect e.g. a major version release of Z-Wave JS or a significant change to the add-on structure. This should help users better understand the potential impact of an upgrade. ### Bug fixes From 22cbb4297cc689f80bd559cddd955800cc26623c Mon Sep 17 00:00:00 2001 From: Raman Gupta <7243222+raman325@users.noreply.github.com> Date: Tue, 17 Oct 2023 11:32:50 -0400 Subject: [PATCH 10/20] no min version change needed --- zwave_js/config.yaml | 2 +- zwave_js/rootfs/etc/cont-init.d/config.sh | 25 +++---------------- .../rootfs/usr/share/tempio/zwave_config.conf | 2 +- 3 files changed, 6 insertions(+), 23 deletions(-) diff --git a/zwave_js/config.yaml b/zwave_js/config.yaml index 18515eacea4..b49e47f31f2 100644 --- a/zwave_js/config.yaml +++ b/zwave_js/config.yaml @@ -14,7 +14,7 @@ codenotary: notary@home-assistant.io discovery: - zwave_js hassio_api: true -homeassistant: 2021.3.0b0 +homeassistant: 2021.2.0b0 image: homeassistant/{arch}-addon-zwave_js init: false options: diff --git a/zwave_js/rootfs/etc/cont-init.d/config.sh b/zwave_js/rootfs/etc/cont-init.d/config.sh index 0d9bde35981..9228c35a455 100755 --- a/zwave_js/rootfs/etc/cont-init.d/config.sh +++ b/zwave_js/rootfs/etc/cont-init.d/config.sh @@ -119,28 +119,11 @@ else bashio::log.info "Soft-reset disabled by user" fi -timeouts_and_attempts="" +presets="" if bashio::config.true 'safe_mode'; then - timeouts_and_attempts=", - \"timeouts\": { - \"ack\": 10000, - \"byte\": 10000, - \"response\": 60000, - \"sendDataCallback\": 650000, - \"report\": 10000, - \"nonce\": 20000, - \"retryJammed\": 5000, - \"sendToSleep\": 5000, - \"serialAPIStarted\": 30000 - }, - \"attempts\": { - \"openSerialPort\": 20000, - \"controller\": 3, - \"sendData\": 5, - \"sendDataJammed\": 10, - \"nodeInterview\": 10 - }" + presets=", + \"presets\": [\"SAFE_MODE\"]" fi # Generate config @@ -151,7 +134,7 @@ bashio::var.json \ s2_unauthenticated "${s2_unauthenticated}" \ log_level "${log_level}" \ soft_reset "^${soft_reset}" \ - timeouts_and_attempts "${timeouts_and_attempts}" | + presets "${presets}" | tempio \ -template /usr/share/tempio/zwave_config.conf \ -out /etc/zwave_config.json diff --git a/zwave_js/rootfs/usr/share/tempio/zwave_config.conf b/zwave_js/rootfs/usr/share/tempio/zwave_config.conf index 3b04a5cd973..0cc3caed54d 100644 --- a/zwave_js/rootfs/usr/share/tempio/zwave_config.conf +++ b/zwave_js/rootfs/usr/share/tempio/zwave_config.conf @@ -14,5 +14,5 @@ "S2_Authenticated": "{{ .s2_authenticated }}", "S2_Unauthenticated": "{{ .s2_unauthenticated }}" }, - "enableSoftReset": {{ .soft_reset }}{{ .timeouts_and_attempts }} + "enableSoftReset": {{ .soft_reset }}{{ .presets }} } From cf2ff12f8e0d79a945cbf6237c5da4c157bd8b4a Mon Sep 17 00:00:00 2001 From: Raman Gupta <7243222+raman325@users.noreply.github.com> Date: Tue, 17 Oct 2023 11:34:10 -0400 Subject: [PATCH 11/20] switch version bump to minor --- zwave_js/CHANGELOG.md | 2 +- zwave_js/config.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/zwave_js/CHANGELOG.md b/zwave_js/CHANGELOG.md index 8e61aebf678..7f1c2eb3314 100644 --- a/zwave_js/CHANGELOG.md +++ b/zwave_js/CHANGELOG.md @@ -1,6 +1,6 @@ # Changelog -## 1.0.0 +## 0.2.0 ### Breaking changes diff --git a/zwave_js/config.yaml b/zwave_js/config.yaml index b49e47f31f2..5f63478b571 100644 --- a/zwave_js/config.yaml +++ b/zwave_js/config.yaml @@ -1,5 +1,5 @@ --- -version: 1.0.0 +version: 0.2.0 slug: zwave_js name: Z-Wave JS description: Control a Z-Wave network with Home Assistant Z-Wave JS From 0f28e044ac00f63aac52212373c1df45fd570da0 Mon Sep 17 00:00:00 2001 From: Raman Gupta <7243222+raman325@users.noreply.github.com> Date: Tue, 17 Oct 2023 11:37:31 -0400 Subject: [PATCH 12/20] fix param name --- zwave_js/rootfs/etc/cont-init.d/config.sh | 8 ++++---- zwave_js/rootfs/usr/share/tempio/zwave_config.conf | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/zwave_js/rootfs/etc/cont-init.d/config.sh b/zwave_js/rootfs/etc/cont-init.d/config.sh index 9228c35a455..cab17bce1ca 100755 --- a/zwave_js/rootfs/etc/cont-init.d/config.sh +++ b/zwave_js/rootfs/etc/cont-init.d/config.sh @@ -119,11 +119,11 @@ else bashio::log.info "Soft-reset disabled by user" fi -presets="" +driver_presets="" if bashio::config.true 'safe_mode'; then - presets=", - \"presets\": [\"SAFE_MODE\"]" + driver_presets=", + \"driverPresets\": [\"SAFE_MODE\"]" fi # Generate config @@ -134,7 +134,7 @@ bashio::var.json \ s2_unauthenticated "${s2_unauthenticated}" \ log_level "${log_level}" \ soft_reset "^${soft_reset}" \ - presets "${presets}" | + driver_presets "${driver_presets}" | tempio \ -template /usr/share/tempio/zwave_config.conf \ -out /etc/zwave_config.json diff --git a/zwave_js/rootfs/usr/share/tempio/zwave_config.conf b/zwave_js/rootfs/usr/share/tempio/zwave_config.conf index 0cc3caed54d..c828d939cdb 100644 --- a/zwave_js/rootfs/usr/share/tempio/zwave_config.conf +++ b/zwave_js/rootfs/usr/share/tempio/zwave_config.conf @@ -14,5 +14,5 @@ "S2_Authenticated": "{{ .s2_authenticated }}", "S2_Unauthenticated": "{{ .s2_unauthenticated }}" }, - "enableSoftReset": {{ .soft_reset }}{{ .presets }} + "enableSoftReset": {{ .soft_reset }}{{ .driver_presets }} } From c05b1dedf4027bbd9a85300cba933826ee9c4217 Mon Sep 17 00:00:00 2001 From: Raman Gupta <7243222+raman325@users.noreply.github.com> Date: Tue, 17 Oct 2023 17:34:02 -0400 Subject: [PATCH 13/20] Bump zwave-js-server to 1.32.2 and adjust logic based on server changes --- zwave_js/build.yaml | 2 +- zwave_js/rootfs/etc/cont-init.d/config.sh | 8 ++++---- zwave_js/rootfs/usr/share/tempio/zwave_config.conf | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/zwave_js/build.yaml b/zwave_js/build.yaml index 6ae0bf269e4..e55b04d79f8 100644 --- a/zwave_js/build.yaml +++ b/zwave_js/build.yaml @@ -9,5 +9,5 @@ codenotary: signer: notary@home-assistant.io base_image: notary@home-assistant.io args: - ZWAVEJS_SERVER_VERSION: 1.32.1 + ZWAVEJS_SERVER_VERSION: 1.32.2 ZWAVEJS_VERSION: 12.2.0 diff --git a/zwave_js/rootfs/etc/cont-init.d/config.sh b/zwave_js/rootfs/etc/cont-init.d/config.sh index cab17bce1ca..9228c35a455 100755 --- a/zwave_js/rootfs/etc/cont-init.d/config.sh +++ b/zwave_js/rootfs/etc/cont-init.d/config.sh @@ -119,11 +119,11 @@ else bashio::log.info "Soft-reset disabled by user" fi -driver_presets="" +presets="" if bashio::config.true 'safe_mode'; then - driver_presets=", - \"driverPresets\": [\"SAFE_MODE\"]" + presets=", + \"presets\": [\"SAFE_MODE\"]" fi # Generate config @@ -134,7 +134,7 @@ bashio::var.json \ s2_unauthenticated "${s2_unauthenticated}" \ log_level "${log_level}" \ soft_reset "^${soft_reset}" \ - driver_presets "${driver_presets}" | + presets "${presets}" | tempio \ -template /usr/share/tempio/zwave_config.conf \ -out /etc/zwave_config.json diff --git a/zwave_js/rootfs/usr/share/tempio/zwave_config.conf b/zwave_js/rootfs/usr/share/tempio/zwave_config.conf index c828d939cdb..0cc3caed54d 100644 --- a/zwave_js/rootfs/usr/share/tempio/zwave_config.conf +++ b/zwave_js/rootfs/usr/share/tempio/zwave_config.conf @@ -14,5 +14,5 @@ "S2_Authenticated": "{{ .s2_authenticated }}", "S2_Unauthenticated": "{{ .s2_unauthenticated }}" }, - "enableSoftReset": {{ .soft_reset }}{{ .driver_presets }} + "enableSoftReset": {{ .soft_reset }}{{ .presets }} } From bf03f8c4879508b916faccc6b69d054cf2a923c8 Mon Sep 17 00:00:00 2001 From: Raman Gupta <7243222+raman325@users.noreply.github.com> Date: Tue, 17 Oct 2023 17:42:14 -0400 Subject: [PATCH 14/20] Update changelog --- zwave_js/CHANGELOG.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/zwave_js/CHANGELOG.md b/zwave_js/CHANGELOG.md index 7f1c2eb3314..1a8d5861e67 100644 --- a/zwave_js/CHANGELOG.md +++ b/zwave_js/CHANGELOG.md @@ -2,10 +2,6 @@ ## 0.2.0 -### Breaking changes - -- Users that are on Home Assistant versions `2021.2.x` will no longer be able to receive add-on updates. Users still on this version are encouraged to update to a newer version which will support additional updates and will have many additional capabilities in the integration. - ### Features - Add-on: Add `safe_mode` configuration option to put Z-Wave network in safe mode. This can be help with troubleshooting network issues and getting access to logs that you otherwise wouldn't be able to. This is an advanced configuration option that should not be adjusted in most cases and is therefore hidden from the default view. @@ -20,6 +16,11 @@ - Add NEO Cool Cam Repeater - Increase report timeout for Aeotec Multisensor 6 to 2s +### Detailed changelogs + +- [Z-Wave JS 12.2.0](https://github.com/zwave-js/node-zwave-js/releases/tag/v12.2.0) +- [Z-Wave JS Server 1.32.2](https://github.com/zwave-js/zwave-js-server/releases/tag/1.32.2) + ## 0.1.98 ### Bug fixes From edb3c12770d7a37321c5906f17bce61d92c39c7a Mon Sep 17 00:00:00 2001 From: Raman Gupta <7243222+raman325@users.noreply.github.com> Date: Tue, 17 Oct 2023 17:43:43 -0400 Subject: [PATCH 15/20] changelog --- zwave_js/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zwave_js/CHANGELOG.md b/zwave_js/CHANGELOG.md index 1a8d5861e67..b328d0f12a9 100644 --- a/zwave_js/CHANGELOG.md +++ b/zwave_js/CHANGELOG.md @@ -4,7 +4,7 @@ ### Features -- Add-on: Add `safe_mode` configuration option to put Z-Wave network in safe mode. This can be help with troubleshooting network issues and getting access to logs that you otherwise wouldn't be able to. This is an advanced configuration option that should not be adjusted in most cases and is therefore hidden from the default view. +- Add-on: Add `safe_mode` configuration option to put Z-Wave network in safe mode. This can be help with troubleshooting network issues and getting access to logs that you otherwise wouldn't be able to, but will likely slow down your network and should therefore be used sparingly. This is an advanced configuration option that should not be adjusted in most cases and is therefore hidden from the default view. - Add-on: Introduce semantic versioning. With semantic versioning, major version changes to the addon will now reflect e.g. a major version release of Z-Wave JS or a significant change to the add-on structure. This should help users better understand the potential impact of an upgrade. ### Bug fixes From 3c0fa38dff091c0559635f6fd5b5d01086ce7c7f Mon Sep 17 00:00:00 2001 From: Raman Gupta <7243222+raman325@users.noreply.github.com> Date: Tue, 17 Oct 2023 18:51:16 -0400 Subject: [PATCH 16/20] Update logging --- zwave_js/rootfs/etc/cont-init.d/config.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/zwave_js/rootfs/etc/cont-init.d/config.sh b/zwave_js/rootfs/etc/cont-init.d/config.sh index 9228c35a455..98463787616 100755 --- a/zwave_js/rootfs/etc/cont-init.d/config.sh +++ b/zwave_js/rootfs/etc/cont-init.d/config.sh @@ -122,6 +122,8 @@ fi presets="" if bashio::config.true 'safe_mode'; then + bashio::log.info "Safe mode enabled" + bashio::log.warning "WARNING: While in safe mode, the performance of your Z-Wave network will be in a reduced state. This is only meant for debugging purposes." presets=", \"presets\": [\"SAFE_MODE\"]" fi From 9a8aed6ec3240848b0c78c6e12fe965da450a745 Mon Sep 17 00:00:00 2001 From: Raman Gupta <7243222+raman325@users.noreply.github.com> Date: Tue, 17 Oct 2023 18:52:33 -0400 Subject: [PATCH 17/20] slight edit --- zwave_js/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zwave_js/CHANGELOG.md b/zwave_js/CHANGELOG.md index b328d0f12a9..6dca84bac11 100644 --- a/zwave_js/CHANGELOG.md +++ b/zwave_js/CHANGELOG.md @@ -5,7 +5,7 @@ ### Features - Add-on: Add `safe_mode` configuration option to put Z-Wave network in safe mode. This can be help with troubleshooting network issues and getting access to logs that you otherwise wouldn't be able to, but will likely slow down your network and should therefore be used sparingly. This is an advanced configuration option that should not be adjusted in most cases and is therefore hidden from the default view. -- Add-on: Introduce semantic versioning. With semantic versioning, major version changes to the addon will now reflect e.g. a major version release of Z-Wave JS or a significant change to the add-on structure. This should help users better understand the potential impact of an upgrade. +- Add-on: Switch to [semantic versioning](https://semver.org/). With this change, major version changes to the addon will now reflect e.g. a major version release of Z-Wave JS or a significant change to the add-on structure. This should help users better understand the potential impact of an upgrade. ### Bug fixes From 05385da37287377ae8cc9a47febaf046a847aa3e Mon Sep 17 00:00:00 2001 From: Raman Gupta <7243222+raman325@users.noreply.github.com> Date: Wed, 18 Oct 2023 00:40:28 -0400 Subject: [PATCH 18/20] Update CHANGELOG.md --- zwave_js/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zwave_js/CHANGELOG.md b/zwave_js/CHANGELOG.md index 6dca84bac11..b78dc520835 100644 --- a/zwave_js/CHANGELOG.md +++ b/zwave_js/CHANGELOG.md @@ -4,7 +4,7 @@ ### Features -- Add-on: Add `safe_mode` configuration option to put Z-Wave network in safe mode. This can be help with troubleshooting network issues and getting access to logs that you otherwise wouldn't be able to, but will likely slow down your network and should therefore be used sparingly. This is an advanced configuration option that should not be adjusted in most cases and is therefore hidden from the default view. +- Add-on: Add `safe_mode` configuration option to put Z-Wave network in safe mode. This can be used help with troubleshooting network issues, such as being unable to start it, but will likely slow down your network and should therefore be used sparingly. This is an advanced configuration option that should not be adjusted in most cases and is therefore hidden from the default view. - Add-on: Switch to [semantic versioning](https://semver.org/). With this change, major version changes to the addon will now reflect e.g. a major version release of Z-Wave JS or a significant change to the add-on structure. This should help users better understand the potential impact of an upgrade. ### Bug fixes From 8e09031265571d587342cbb1006f926b13b2d0bb Mon Sep 17 00:00:00 2001 From: Raman Gupta <7243222+raman325@users.noreply.github.com> Date: Wed, 18 Oct 2023 02:50:36 -0400 Subject: [PATCH 19/20] make json creation less hacky --- zwave_js/rootfs/etc/cont-init.d/config.sh | 9 ++++----- zwave_js/rootfs/usr/share/tempio/zwave_config.conf | 5 ++++- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/zwave_js/rootfs/etc/cont-init.d/config.sh b/zwave_js/rootfs/etc/cont-init.d/config.sh index 98463787616..b86f999da98 100755 --- a/zwave_js/rootfs/etc/cont-init.d/config.sh +++ b/zwave_js/rootfs/etc/cont-init.d/config.sh @@ -84,7 +84,7 @@ done # flushed to disk if [[ ${flush_to_disk:+x} ]]; then bashio::log.info "Flushing config to disk due to creation of new key(s)..." - bashio::addon.options > "/data/options.json" + bashio::addon.options >"/data/options.json" fi s0_legacy=$(bashio::config "s0_legacy_key") @@ -119,13 +119,12 @@ else bashio::log.info "Soft-reset disabled by user" fi -presets="" +safe_mode="" if bashio::config.true 'safe_mode'; then bashio::log.info "Safe mode enabled" bashio::log.warning "WARNING: While in safe mode, the performance of your Z-Wave network will be in a reduced state. This is only meant for debugging purposes." - presets=", - \"presets\": [\"SAFE_MODE\"]" + safe_mode="\"SAFE_MODE\"" fi # Generate config @@ -136,7 +135,7 @@ bashio::var.json \ s2_unauthenticated "${s2_unauthenticated}" \ log_level "${log_level}" \ soft_reset "^${soft_reset}" \ - presets "${presets}" | + safe_mode "${safe_mode}" | tempio \ -template /usr/share/tempio/zwave_config.conf \ -out /etc/zwave_config.json diff --git a/zwave_js/rootfs/usr/share/tempio/zwave_config.conf b/zwave_js/rootfs/usr/share/tempio/zwave_config.conf index 0cc3caed54d..01560776402 100644 --- a/zwave_js/rootfs/usr/share/tempio/zwave_config.conf +++ b/zwave_js/rootfs/usr/share/tempio/zwave_config.conf @@ -14,5 +14,8 @@ "S2_Authenticated": "{{ .s2_authenticated }}", "S2_Unauthenticated": "{{ .s2_unauthenticated }}" }, - "enableSoftReset": {{ .soft_reset }}{{ .presets }} + "enableSoftReset": {{ .soft_reset }}, + "presets": [ + {{ .safe_mode }} + ] } From d143b99d08cd1330a9b6485a75f49d8a1046a252 Mon Sep 17 00:00:00 2001 From: Raman Gupta <7243222+raman325@users.noreply.github.com> Date: Wed, 18 Oct 2023 10:51:56 -0400 Subject: [PATCH 20/20] Generate presets array dynamically --- zwave_js/rootfs/etc/cont-init.d/config.sh | 17 ++++++++++++++--- .../rootfs/usr/share/tempio/zwave_config.conf | 4 +--- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/zwave_js/rootfs/etc/cont-init.d/config.sh b/zwave_js/rootfs/etc/cont-init.d/config.sh index b86f999da98..4f7f3ce0879 100755 --- a/zwave_js/rootfs/etc/cont-init.d/config.sh +++ b/zwave_js/rootfs/etc/cont-init.d/config.sh @@ -13,6 +13,8 @@ declare log_level declare flush_to_disk declare host_chassis declare soft_reset +declare presets_array +declare presets readonly DOCS_EXAMPLE_KEY_1="2232666D100F795E5BB17F0A1BB7A146" readonly DOCS_EXAMPLE_KEY_2="A97D2A51A6D4022998BEFC7B5DAE8EA1" @@ -119,12 +121,21 @@ else bashio::log.info "Soft-reset disabled by user" fi -safe_mode="" +# Create empty presets array +presets_array=() if bashio::config.true 'safe_mode'; then bashio::log.info "Safe mode enabled" bashio::log.warning "WARNING: While in safe mode, the performance of your Z-Wave network will be in a reduced state. This is only meant for debugging purposes." - safe_mode="\"SAFE_MODE\"" + # Add SAFE_MODE to presets array + presets_array+=("SAFE_MODE") +fi + +# Convert presets array to JSON string and add to config +if [[ ${#presets_array[@]} -eq 0 ]]; then + presets="[]" +else + presets="$(printf '%s\n' "${presets_array[@]}" | jq -R . | jq -s .)" fi # Generate config @@ -135,7 +146,7 @@ bashio::var.json \ s2_unauthenticated "${s2_unauthenticated}" \ log_level "${log_level}" \ soft_reset "^${soft_reset}" \ - safe_mode "${safe_mode}" | + presets "${presets}" | tempio \ -template /usr/share/tempio/zwave_config.conf \ -out /etc/zwave_config.json diff --git a/zwave_js/rootfs/usr/share/tempio/zwave_config.conf b/zwave_js/rootfs/usr/share/tempio/zwave_config.conf index 01560776402..399160fe8ab 100644 --- a/zwave_js/rootfs/usr/share/tempio/zwave_config.conf +++ b/zwave_js/rootfs/usr/share/tempio/zwave_config.conf @@ -15,7 +15,5 @@ "S2_Unauthenticated": "{{ .s2_unauthenticated }}" }, "enableSoftReset": {{ .soft_reset }}, - "presets": [ - {{ .safe_mode }} - ] + "presets": {{ .presets }} }