feat: support embedding Z-Wave JS UI in other software#4520
feat: support embedding Z-Wave JS UI in other software#4520robertsLando merged 15 commits intomasterfrom
Conversation
Pull Request Test Coverage Report for Build 21627130537Details
💛 - Coveralls |
4bc6ebd to
2b226db
Compare
|
Before merging, we need to delete the tarball again. I had to upload it for testing. |
2b226db to
ec54863
Compare
ZWAVE_PORT
robertsLando
left a comment
There was a problem hiding this comment.
Apart from tarball the code changes look good to me 👍🏼
|
Did a few more changes. Once we're ready to merge and release, I'll delete the tarballs again. |
robertsLando
left a comment
There was a problem hiding this comment.
Changes look good. I'm wondering if in UI it makes sense to make inputs disabled instead of hiding them. WDYT?
robertsLando
left a comment
There was a problem hiding this comment.
would also be nice to mention this on docs somewhere
There was a problem hiding this comment.
Pull request overview
This PR adds support for embedding Z-Wave JS UI in other software (e.g., Home Assistant addon) by allowing external management of certain settings through environment variables and a JSON configuration file.
Changes:
- Adds new
externalSettings.tsmodule to load and merge external Z-Wave settings from a JSON file specified viaZWAVE_EXTERNAL_SETTINGSenvironment variable - Implements
ZWAVE_PORTenvironment variable to force-enable Z-Wave and override the configured port, disabling serial port enumeration - Updates Settings UI to conditionally hide fields for externally managed settings using
isSettingManagedExternallychecks - Adds
managedExternallyarray to frontend store to track which settings are managed externally
Reviewed changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| api/lib/externalSettings.ts | New module providing functions to load external settings from JSON file, merge them into Z-Wave config, apply driver-only settings, and generate list of externally managed setting paths |
| api/lib/ZwaveClient.ts | Adds ZWAVE_PORT environment variable handling to force-enable and override port, and applies external driver settings after security key parsing |
| api/app.ts | Integrates external settings by merging them before ZwaveClient initialization, constructs managedExternally array for API responses, and skips serial port enumeration when ZWAVE_PORT is set |
| src/stores/base.js | Adds managedExternally state array and isSettingManagedExternally getter function to check if a setting path is externally managed |
| src/views/Settings.vue | Adds conditional rendering (v-if directives) to hide UI controls for externally managed settings across Z-Wave, security keys, RF configuration, logging, and Home Assistant sections; adds computed properties to check when all settings in a group are externally managed |
| .env.app.example | Documents new ZWAVE_PORT and ZWAVE_EXTERNAL_SETTINGS environment variables |
| api/lib/utils.ts | Removes outdated TODO comment about using ??= operator |
| package.json | Bumps version to 11.10.2-alpha.6 |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
@copilot add documentation for the new features in this PR to the end of the usage/setup section in the docs |
|
@AlCalzone I've opened a new pull request, #4533, to work on those changes. Once the pull request is ready, I'll request review from you. |
Adds documentation for embedding Z-Wave JS UI in other software (e.g.,
Home Assistant add-ons) where settings are managed externally via
environment variables.
### Documentation Added
- **Controller Port Override** (`ZWAVE_PORT`): Force-enable Z-Wave and
override configured port, disables serial port enumeration in UI
- **External Settings Management** (`ZWAVE_EXTERNAL_SETTINGS`): Path to
JSON file with externally managed driver/server settings, hides
corresponding UI controls
- **Supported External Settings**: Complete reference for all
configurable settings:
- Logging (UI + driver-only options)
- RF configuration (region, auto power levels)
- Storage settings (cache dir, throttle mode)
- Security keys (S0, S2, Long Range)
- Z-Wave JS Server configuration
- Driver presets
- **Example Configuration**: Real-world Home Assistant add-on setup with
JSON structure
### External Settings File Example
```json
{
"logEnabled": true,
"logLevel": "info",
"rf": {
"region": 0,
"autoPowerlevels": true
},
"securityKeys": {
"S0_Legacy": "0102030405060708090A0B0C0D0E0F10",
"S2_Authenticated": "2122232425262728292A2B2C2D2E2F30"
},
"serverEnabled": true,
"serverPort": 3000
}
```
Documentation placed at end of `docs/usage/setup.md` as requested.
<!-- START COPILOT CODING AGENT TIPS -->
---
💬 We'd love your input! Share your thoughts on Copilot coding agent in
our [2 minute survey](https://gh.io/copilot-coding-agent-survey).
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: AlCalzone <17641229+AlCalzone@users.noreply.github.com>
|
@AlCalzone Lookd good to me, did you checked also #4520 (review) ? |
|
I had them disabled at first, but eventually decided to hide them completely. The settings felt unnecessarily noisy with all those disabled fields the user couldn't use at all. |
This PR adds support for embedding Z-Wave JS UI in other software, e.g. a Home Assistant addon.
In this mode, several settings are managed externally and will be unavailable in Z-Wave JS UI.
Controller port
Set using the env variable

ZWAVE_PORT:Security keys, RF and log configuration
Set using the env variable
ZWAVE_EXTERNAL_SETTINGS