Skip to content

Commit

Permalink
Bump zwave-js to 12.0.2 and add soft_reset capability (home-assista…
Browse files Browse the repository at this point in the history
…nt#3237)

* Bump zwave-js to 12.0.2

* missed commit

* Add disable_soft_reset configuration option

* fix lint

* Add support for explicit enabling of soft reset

* feedback and changes

* fix changelog

* Update zwave_js/DOCS.md

Co-authored-by: kpine <[email protected]>

* Update zwave_js/DOCS.md

Co-authored-by: kpine <[email protected]>

* adjust

* Add extra log statement

* Add timeout

* Be consistent in release notes

* Fix bug

---------

Co-authored-by: kpine <[email protected]>
  • Loading branch information
raman325 and kpine authored Oct 3, 2023
1 parent dad2ce5 commit 72fac56
Show file tree
Hide file tree
Showing 7 changed files with 75 additions and 25 deletions.
41 changes: 30 additions & 11 deletions zwave_js/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,27 @@
# Changelog

## 0.1.94

### Features

- Add-on: Add a `soft_reset` configuration option to choose how to handle soft-reset functionality for 500 series controllers.
- Add-on: Extend timeout from 3 seconds to 30 to give Z-Wave JS more time to commit things to disk.

### Bug fixes

- Z-Wave JS: The workaround from v12.0.0 for the 7.19.x SDK bug was not working correctly when the command that caused the controller to get stuck could be retried. This has now been fixed.
- Z-Wave JS: Ignore when a node reports Security S0/S2 CC to have version 0 (unsupported) although it is using that CC

### Config file changes
- Add Shelly to manufacturers
- Add Shelly Wave 1, Wave 2PM, update Wave 1PM association labels
- Add Sunricher SR-ZV2833PAC

### Detailed changelog

- [Z-Wave JS 12.0.1](https://github.com/zwave-js/node-zwave-js/releases/tag/v12.0.1)
- [Z-Wave JS 12.0.2](https://github.com/zwave-js/node-zwave-js/releases/tag/v12.0.2)

## 0.1.93

### Bug fixes
Expand All @@ -14,28 +36,25 @@

### Bug fixes

- Revert change to stop rebuilding @serialport/bindings-cpp from source as the problem is fixed on some CPU platforms but not all
- Add-on: Revert change to stop rebuilding @serialport/bindings-cpp from source as the problem is fixed on some CPU platforms but not all

## 0.1.91

### Breaking changes

- Firmware updates may no longer work properly in Home Assistant versions 2023.9.x and earlier due to a breaking change upstream that couldn't be made backward compatible, but will work once again starting in 2023.10.0. This breaking change ultimately improves firmware updates, as checking for updates no longer requires communication with the device, therefore reducing the risk of corrupting manufacturer information. This also means that updates for battery-powered devices can be detected without waking up the devices.

- Z-Wave JS: Firmware updates may no longer work properly in Home Assistant versions 2023.9.x and earlier due to a breaking change upstream that couldn't be made backward compatible, but will work once again starting in 2023.10.0. This breaking change ultimately improves firmware updates, as checking for updates no longer requires communication with the device, therefore reducing the risk of corrupting manufacturer information. This also means that updates for battery-powered devices can be detected without waking up the devices.

### Features

- Unresponsive controllers are now detected and automatically restarted if possible.
- Battery-powered devices are sent back to sleep after 250 ms with no command (down from 1000 ms). This should result in significant battery savings for devices that frequently wake up.
- We no longer rebuild the @serialport/bindings-cpp package from source.

- Z-Wave JS: Unresponsive controllers are now detected and automatically restarted if possible.
- Z-Wave JS: Battery-powered devices are sent back to sleep after 250 ms with no command (down from 1000 ms). This should result in significant battery savings for devices that frequently wake up.
- Add-on: We no longer rebuild the @serialport/bindings-cpp package from source.

### Bug fixes

- A bug in the 7.19.x SDK has surfaced where the controller gets stuck in the middle of a transmission. Previously, this would go unnoticed because the failed commands would cause the nodes to be marked dead until the controller finally recovered. Since v11.12.0, however, Z-Wave JS would consider the controller jammed and retry the last command indefinitely. This situation is now detected, and Z-Wave JS attempts to recover by soft resetting the controller when this happens.
- Fixed an issue where supporting controllers would no longer be automatically restarted after failing to do so once.
- Devices that send notifications from endpoints, like Aeotec Wallmote, are now properly supported.

- Z-Wave JS: A bug in the 7.19.x SDK has surfaced where the controller gets stuck in the middle of a transmission. Previously, this would go unnoticed because the failed commands would cause the nodes to be marked dead until the controller finally recovered. Since v11.12.0, however, Z-Wave JS would consider the controller jammed and retry the last command indefinitely. This situation is now detected, and Z-Wave JS attempts to recover by soft resetting the controller when this happens.
- Z-Wave JS: Fixed an issue where supporting controllers would no longer be automatically restarted after failing to do so once.
- Z-Wave JS: Devices that send notifications from endpoints, like Aeotec Wallmote, are now properly supported.

### Config file changes

Expand Down
7 changes: 7 additions & 0 deletions zwave_js/DOCS.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,13 @@ the Supervisor.
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:
1. Automatic - the add-on will decide whether soft-reset should be enabled or disabled for 500 series controllers. This is the default option and should work for most people.
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 `network_key` (deprecated)

In previous versions of the addon, this was the only key that was needed. With
Expand Down
5 changes: 5 additions & 0 deletions zwave_js/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ FROM ${BUILD_FROM}
ARG ZWAVEJS_SERVER_VERSION
ARG ZWAVEJS_VERSION

# Environment configuration
ENV \
S6_KILL_GRACETIME=30000 \
S6_SERVICES_GRACETIME=30000

# Install Z-Wave JS
WORKDIR /usr/src
RUN \
Expand Down
2 changes: 1 addition & 1 deletion zwave_js/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ codenotary:
base_image: [email protected]
args:
ZWAVEJS_SERVER_VERSION: 1.32.1
ZWAVEJS_VERSION: 12.0.0
ZWAVEJS_VERSION: 12.0.2
9 changes: 6 additions & 3 deletions zwave_js/config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
version: 0.1.93
version: 0.1.94
slug: zwave_js
name: Z-Wave JS
description: Control a Z-Wave network with Home Assistant Z-Wave JS
Expand All @@ -20,6 +20,7 @@ init: false
options:
device: null
log_level: info
soft_reset: Automatic
s0_legacy_key: ""
s2_access_control_key: ""
s2_authenticated_key: ""
Expand All @@ -28,12 +29,14 @@ ports:
3000/tcp: null
schema:
device: device(subsystem=tty)
emulate_hardware: bool?
log_level: list(silly|debug|verbose|http|info|warn|error)?
network_key: match(|[0-9a-fA-F]{32,32})?
soft_reset: list(Automatic|Enabled|Disabled)
s0_legacy_key: match(|[0-9a-fA-F]{32,32})?
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})?
stage: stable
startup: services
timeout: 30
28 changes: 18 additions & 10 deletions zwave_js/rootfs/etc/cont-init.d/config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ if bashio::config.has_value 'network_key'; then
bashio::log.info "Migrating \"network_key\" option to \"s0_legacy_key\"..."
bashio::addon.option s0_legacy_key "$(bashio::config 'network_key')"
bashio::log.info "Flushing config to disk due to key migration..."
bashio::addon.options > "/data/options.json"
bashio::addon.options >"/data/options.json"
fi
fi

Expand Down Expand Up @@ -92,7 +92,7 @@ s2_access_control=$(bashio::config "s2_access_control_key")
s2_authenticated=$(bashio::config "s2_authenticated_key")
s2_unauthenticated=$(bashio::config "s2_unauthenticated_key")

if ! bashio::config.has_value 'log_level'; then
if ! bashio::config.has_value 'log_level'; then
log_level=$(bashio::info.logging)
bashio::log.info "No log level specified, falling back to Supervisor"
bashio::log.info "log level (${log_level})..."
Expand All @@ -102,23 +102,31 @@ fi

host_chassis=$(bashio::host.chassis)

if [ "${host_chassis}" == "vm" ]; then
soft_reset=false
bashio::log.info "Virtual Machine detected, disabling soft-reset"
else
if bashio::config.equals 'soft_reset' 'Automatic'; then
bashio::log.info "Soft-reset set to automatic"
if [ "${host_chassis}" == "vm" ]; then
soft_reset=false
bashio::log.info "Virtual Machine detected, disabling soft-reset"
else
soft_reset=true
bashio::log.info "Virtual Machine not detected, enabling soft-reset"
fi
elif bashio::config.equals 'soft_reset' 'Enabled'; then
soft_reset=true
bashio::log.info "Virtual Machine not detected, enabling soft-reset"
bashio::log.info "Soft-reset enabled by user"
else
soft_reset=false
bashio::log.info "Soft-reset disabled by user"
fi


# Generate config
bashio::var.json \
s0_legacy "${s0_legacy}" \
s2_access_control "${s2_access_control}" \
s2_authenticated "${s2_authenticated}" \
s2_unauthenticated "${s2_unauthenticated}" \
log_level "${log_level}" \
soft_reset "^${soft_reset}" \
| tempio \
soft_reset "^${soft_reset}" |
tempio \
-template /usr/share/tempio/zwave_config.conf \
-out /etc/zwave_config.json
8 changes: 8 additions & 0 deletions zwave_js/translations/en.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,13 @@ configuration:
description: >-
This must be provided in order to include devices with the S2
Unauthenticated security class.
soft_reset:
name: 500 series controller soft-reset
description: >-
This setting tells the add-on how to handle soft-resets for 500 series
controllers. The default setting, Automatic, instructs the add-on to
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.
network:
3000/tcp: Z-Wave JS communication

0 comments on commit 72fac56

Please sign in to comment.