feat: handle battery replacement notifications from Z-Wave devices#4514
Open
robertsLando with Copilot wants to merge 11 commits into
Open
feat: handle battery replacement notifications from Z-Wave devices#4514robertsLando with Copilot wants to merge 11 commits into
robertsLando with Copilot wants to merge 11 commits into
Conversation
Co-authored-by: robertsLando <11502495+robertsLando@users.noreply.github.com>
Co-authored-by: robertsLando <11502495+robertsLando@users.noreply.github.com>
Co-authored-by: robertsLando <11502495+robertsLando@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix unknown notification received for CC Battery
feat: handle battery replacement notifications from Z-Wave devices
Jan 8, 2026
robertsLando
approved these changes
Jan 8, 2026
robertsLando
marked this pull request as ready for review
January 8, 2026 14:45
Pull Request Test Coverage Report for Build 21359151708Details
💛 - Coveralls |
Member
|
@AlCalzone thoughts on this? |
Contributor
|
This pull-request is stale because it has been open 90 days with no activity. Remove the stale label or comment or this will be closed in 5 days. To ignore this pull-request entirely you can add the no-stale label |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Z-Wave JS 15.10.0+ emits battery replacement notifications with urgency levels (
Soon|Now) based on device-specific discharge characteristics. Previously logged as unknown errors.Changes
Backend (
api/lib/ZwaveClient.ts)batteryReplacementStatustoZUINodetypedismissBatteryReplacementStatus(nodeId)API methodFrontend (
src/components/nodes-table/)mdiBatteryAlertfor "Soon", redmdiBatteryAlertVariantOutlinefor "Now"RichValue.vuewith onClick handler supportBehavior
UI
Battery icons now indicate replacement urgency with appropriate colors and tooltips prompting user action:
Per spec: "Controllers SHOULD inform the user that the battery needs replacement each time the low-battery warning is received." Device manufacturers determine warning thresholds based on battery chemistry.
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
224.0.0.251REDACTED, pid is -1(packet block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
This section details on the original issue you should resolve
<issue_title>Unknown notification received CC Battery</issue_title>
<issue_description>### Checklist
Deploy method
Docker
Z-Wave JS UI version
11.3.1.3c9348d
ZwaveJS version
15.14.0
Describe the bug
To Reproduce
Have a device send a low battery notification.
Expected behavior
Event is handled.
Additional context
Notification added to driver in 15.10.0.</issue_description>
<agent_instructions>When a battery notification is received set a flag on node and show this on UI to warn user that the battery should be replaced. The user can dismiss this notification and the notification should be dismissed automatically when/if the battery level returns above 90%</agent_instructions>
Comments on the Issue (you are @copilot in this section)
@robertsLando @AlCalzone Should I handle this notification or not? What kind of "valueId" should I create then? What are the possible values of args.urgency?zwave-js-ui/api/lib/ZwaveClient.ts
Lines 5817 to 5847 in 7b0285f
<comment_new>@AlCalzone
For reference, here's the explanation why it was done:
zwave-js/zwave-js#7984
The urgency is one of
BatteryReplacementStatus.Soon | BatteryReplacementStatus.NowI would actually not create a value ID for it. The whole point of this change was that it is meant to be a notification and not stateful.
Maybe we can show a badge on the battery level, yellow warning symbol for "soon", red alert symbol for "now"?
On click we could show a dialog explaining that the battery needs to be replaced soon/now, with a button to dismiss the warning state?</comment_new>
<comment_new>@robertsLando
What I do with notifications is to create a valueId object to be emitted with the event in both socket and MQTT, I don't create a real valueId. </comment_new>
<comment_new>@robertsLando
BTW I already show battery levels on UI, I don't know if this Is really necessary (I mean to handle it on UI side as well)</comment_new>
<comment_new>@robertsLando
@kpine This should be handled in latest release</comment_new>
<comment_new>@AlCalzone
The point of these notifications is that each battery type is different. 20% might be fine for one kind of battery, but another one might drop off very steeply:
Showing hints on the UI can help with this.</bo...
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.