Skip to content

Conversation

rzr
Copy link
Collaborator

@rzr rzr commented Sep 18, 2025

This feature was not delivered on zpc-1.7.0

Relate-to: SiliconLabs/UnifySDK#43

Change

Ongoing parallel implementation of CC

zwave-unify-u3c-20240501

Supported features

  • Add, Edit, Remove an User (ZPC and MQTT)
  • Add, Edit, Remove an Credential (ZPC and MQTT)
  • End device interview of capabilities (ZPC and MQTT)
  • Support Set User/Credential Report Error

Incoming (not in PR yet, but implemented)

  • Handle multiple deletion of Users/Credentials
  • Credential Learn
  • User Unique Identifier Credential Association
  • User Checksum
  • Credential Checksum

WIP

  • Log errors in MQTT (and DevUI)

How to test it

End device

You can use the simulated environment to have an end device that support User Credential : https://github.com/Z-Wave-Alliance/z-wave-stack/wiki/ZPC

Controller

Compile (tested on Ubuntu 22.04 WSL)

In the git repository :

# We need mosquitto in the system
uic> sudo apt install mosquitto

# Build docker container
uic> docker/build_docker.sh amd64 uic_amd64;
# Start docker container 
uic> docker run -it -v $PWD:$PWD -w $PWD uic_amd64;

# Now we are in the docker container, create build folder
docker> mkdir build && cd build

# Create Makefile with only ZPC and DevUI
docker> cmake .. -GNinja -DBUILD_AOXPC=OFF -DBUILD_CPCD=OFF -DBUILD_EMD=OFF -DBUILD_EPC=OFF -DBUILD_GMS=OFF -DBUILD_IMAGE_PROVIDER=OFF -DBUILD_MATTER_BRIDGE=OFF -DBUILD_NAL=OFF -DBUILD_OTBR=OFF -DBUILD_POSITIONING=OFF -DBUILD_TESTING=OFF -DBUILD_UIC_DEMO=OFF -DBUILD_UPTI_CAP=OFF -DBUILD_UPTI_WRITER=OFF -DBUILD_UPVL=OFF -DBUILD_ZIGBEED=OFF -DBUILD_ZIGPC=OFF

# Compile 
docker> ninja

# Create .deb packages if you want to install them on your machine
docker> ninja package

Once compiled, you can either install the dev packages or start the manually :

# ZPC start 
#⚠️--zpc.serial might change based on your socat implementation)
uic> sudo build_amd64/applications/zpc/zpc  --zpc.serial=/tmp/socat-localhost+4901 --zpc.datastore_file /tmp/simulated.db --mapdir ./applications/zpc/components/dotdot_mapper/rules/ --log.tag_level zwave_command_class_user_credential:d,dotdot_mqtt:d,user_credential_cluster_server:d,zwave_command_class_notification:d; 

# Dev UI API
#⚠️ You'll need node 18+ (use nvm https://github.com/nvm-sh/nvm) 
uic> cd applications/dev_ui/dev_gui
uic> npm run start-api

# Dev UI (https://localhost:3000)
#⚠️ You'll need node 18+ (use nvm https://github.com/nvm-sh/nvm) 
#⚠️ Security issues may happen with firefox, you'll have to test it on Chronium or use the .deb package
uic> cd applications/dev_ui/dev_gui
uic> npm run start

Run

We recommend to start zpc in command line : https://siliconlabs.github.io/UnifySDK/applications/zpc/readme_user.html#running-zpc-from-the-command-line

With the following arguments to help us debug an issue :
--log.tag_level zwave_command_class_user_credential:d,user_credential_cluster_server:d,zwave_command_class_notification:d;

⚠️ Make sure that this file SiliconLabs/UnifySDK@924445b#diff-69a45f32ef895eeb999e643981807b60127f9a119499c6c83729312d66824544 is in your --mapdir directory (default path : /usr/share/uic/rules)

Once the end device is included you can see the User Credential class in : https://localhost:3080/usercredential

⚠️Default credential data should not display properly, this is a known issue in the end device and will be fixed soon.

Screenshots

image
image

Related-to: https://github.com/Z-Wave-Alliance/OSWG/issues/21#issuecomment-2074462819

Checklist

Checklist

rzr and others added 30 commits September 18, 2025 11:09
- User Capabilities
- Credential Capabilities
- All User Checksum
- User Get/Report
- Credential Get/Report

Merged :
UIC-3222: Fix Supported Credential Types
UIC-3222: Ignore User ID 0 & don't create duplicates
UIC-3222: Delayed interview
UIC-3222: User Credential User Name Encoding under UUID (No real advantage to put this under USER_NAME)
UIC-3222: Fix user discovery
UIC-3222: Credential get log
UIC-3222: Discovery fix (credential and user get)
UIC-3222: Discovery interview remove all users before user interview
UIC-3222: Fix credential report if credential data is missing
UIC-3222: Remove user if User modifier type is DNE
UIC-3222: Correctly remove all user credential before discovery
UIC-3222: set_reported_attribute return correct status and undefined desired
UIC-3222: Add get_desired user id node function
UIC-3222: get_credential_type can now be searched as desired value
UIC-3222: Credential Learn Properties

[Philippe Coval]

Adjusted crc16 in applications/zpc/components/zwave_command_classes/test/CMakeLists.txt
UIC-3222: Credential Set on Credential Operation Type
UIC-3222: Set Credential (delete) improvement
UIC-3222: Credential SET also look in desired values

UIC-3222: Fix delete operation on Credential SET
UIC-3222: Allow extra bytes when testing set/get commands
UIC-3222: User set on User Operation Type
UIC-3222: More user types
UIC-3222: User SET fix
UIC-3222: Set User (delete) improvement
UIC-3222: Fix expiring minutes to Desired Or Reported to allow add
UIC-3222: User SET can look into desired attributes
UIC-3222: Expose New credential capabilities
UIC-3222: Expose Admin Code

[Philippe Coval]

Adjusted applications/zpc/components/zwave_command_classes/test/CMakeLists.txt
This patch will :
- Not delete all user database en Unify startup
- Allow the user to re-initiate an interview with the device and discover again all users
Also remove credential if modifier type is DNE
UIC-3222: Documentation of delete all credentials
In the previous implementation of U3C, User Notification Report size was incorrect : Z-Wave-Alliance/z-wave-stack#409
This commit use the correct implementation.
This commit will ensure that no more than Credential Type/Credential Slot exists no matter the user that got it. If we have (1,1) credential for User 1, user 2 cannot have a credential with type 1 and slot 1. User 2 should have type 1 and slot 2.

For more context see Z-Wave-Alliance/AWG#172
Verify that the slot we are trying to add is in range of supported slots
Refactoring report function to use new C++ helpers
May be squashed later with the full refactor of User Report according to the new Z-Wave specification
This length is deducted from the attribute itself no need to complicate things.
Fix delete all user in report user
Remove notification handler for user
[Philippe Coval]

Adjusted Conflicts in:
	applications/zpc/components/zwave_command_classes/test/CMakeLists.txt
Those functions are not needed anymore with the new C++ helpers.

get_uint16_value will be removed when credential refactoring is here
Also rename get_credential_identifier_nodes
Remove all Notification callbacks
We don't use desired state for credential type anymore since it's add complexity without any needs for it.
This will make the User Credential Implementation clearer
Add a new helper class for clarity
Much simpler and more efficient thanks to change parent feature
Top level API is now available directly with an header to avoid base file to be too big
Use new C++ api to be more consistent
0 nodes are better handled
Credential node are properly deleted when no credential is available
Only check reported value instead of desired and reported
Updated test to better coverage USER_SET
…rules

Works both when adding a credential and modifying it
Use a new callback mechanism that allows the server to listen to certain event
Add a notification to the UI
Set the received checksum last
Allow to add an credential that is already in the node tree
Check desired or reported value of CREDENTIAL_LEARN_OPERATION_TYPE to avoid issues with supervision
Send status to mqtt
Now the attribute ALL_USERS_CHECKSUM is defined at the end of the User interview if device support it
Add command to force the refresh of the checksum
Now correctly interview ALL users on the first discovery (previously was only checking the first one due to a resolution error)
All user checksum happens after all users & all credentials are reported
@rzr rzr marked this pull request as draft September 22, 2025 13:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants