Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow clearing of user codes when user passes [0,0,0,0] #1059

Closed
wants to merge 5 commits into from
Closed

allow clearing of user codes when user passes [0,0,0,0] #1059

wants to merge 5 commits into from

Conversation

drytoastman
Copy link

I think most zwave locks allow removing/clearing codes from their memory. According to the zwave spec file "SDS12652-13 - Z-Wave Command Class Specification N-Z.pdf" on page 333, you can set the status to Available and pass 4 bytes of 0 data.

I've tested this with my old Schlage BE369 deadbolt and it appears to work as intended.

@drytoastman
Copy link
Author

Note, this is raw zero data, not the ascii characters '0000' or [0x30, 0x30, 0x30, 0x30] for setting the door code of '0000'.

@Fishwaldo
Copy link
Member

Hrm. Let me think about this. using '0000' implies that the user is knowledgeable about Z-Wave. Id like something intuitive like a button etc.

@drytoastman
Copy link
Author

The primary reason I picked the '\0\0\0\0' was because I'm coming through the python API Value object so my only real options are setting the value or something through the node object but that doesn't seem right. Can you assign a zero length string to a value? That might be more understandable for the average user.

@Fishwaldo
Copy link
Member

Based on this posting: http://forum.z-wavepublic.com/t/3-51-user-code-command-class-version-1/80 we now know that the RFID'd devices were breaking the specs. The usercode should be a ASCII string.

So I'm inclined to make the following changes:

  1. Add a ValueString containing the ASCII representation of the usercode and some code to see if the actual usercode falls in the ASCII range. If not, then dont expose it.
  2. Keep the Existing ValueRaw for applications to continue to work with RFID's or existing ASCII based devices.
  3. Expose a new ValueInt that is write only. Takes a index of the UserCode to clear. When submitted the usercode class will do the necessary
  4. adopt your "0000" code to clear as well.

The only constraint, we only have 256 indexes to work with on ValueID's. I think its time to expand that to 65536 :)

@nechry
Copy link
Member

nechry commented Jan 11, 2017

I agree with your proposition @Fishwaldo

@nalipaz
Copy link

nalipaz commented Dec 15, 2017

This issue is now going on a year standing, is it possible there will be any movement on this change in the foreseeable future?

@zmcandee
Copy link

@Fishwaldo Any progress on incorporating this? The PR works as described and seems to be an important update for people that want to clear codes. Could we merge this as is and create a separate issue for adding ValueInt and ValueString?

@nalipaz
Copy link

nalipaz commented May 31, 2018

Looking further around the threads it seems that 0000 only clears on certain devices and on others it is a working code when set. That said I don't think this should necessarily be incorporated as it has unintended consequences for those who have a device that doesn't clear upon setting 0000.

@drytoastman
Copy link
Author

I was the original poster. That patch was really a kludge to work within the current API. It probably makes more sense to add a ClearValue or such to the API but I don't know enough about the official zwave command classes to know if that is correct or not. Unfortunately, it seems like lock manufacturers are doing different things for clearing so it may end up being some piece that needs custom handling based on the lock type.

ddstreet pushed a commit to ddstreet/open-zwave that referenced this pull request Sep 8, 2018
ddstreet pushed a commit to ddstreet/open-zwave that referenced this pull request Sep 12, 2018
ddstreet pushed a commit to ddstreet/open-zwave that referenced this pull request Sep 16, 2018
ddstreet pushed a commit to ddstreet/open-zwave that referenced this pull request Sep 19, 2018
ddstreet pushed a commit to ddstreet/open-zwave that referenced this pull request Oct 4, 2018
ddstreet pushed a commit to ddstreet/open-zwave that referenced this pull request Oct 24, 2018
@Fishwaldo
Copy link
Member

I'm Closing this as I'm refactoring the UserCode CC right now. See #997

@Fishwaldo Fishwaldo closed this Dec 3, 2018
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.

5 participants