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

Improve ZHADoorlock device #4876

Closed
wants to merge 8 commits into from

Conversation

Smanar
Copy link
Collaborator

@Smanar Smanar commented May 14, 2021

This code:

  • move the doorlock stuff in doorlock.cpp file
  • add the field "state/doorstate" with value open/closed/error jammed/error forced open/error unspecified
  • add the field "state/notification" with some information like "source:keypad, code:Unlock, pin:0"
  • add a field "state/pin" for pin management

@Smanar
Copy link
Collaborator Author

Smanar commented May 14, 2021

For Pin management I m using state/pin and not config/pin, because the work need to be done by the third app, there is no "get all pin" command, and thoses kind of device realy don't like request spamming.

Can use GET and DELETE with
/api/{apikey}/sensors/{sensorid}/state/pin/{userid}

Can use PUT with
/api/{apikey}/sensors/{sensorid}/state/pin
and the body
{"id":4,"type": X, "status":Y, "code":"YYYYYY"}

When a new ID is detected, it will be added in state/pin, but you can delete them even it is not in the Json. The Json don't contain the full id list.

    "state": {
        "doorstate": "closed",
        "lastupdated": "2021-04-30T19:11:59.026",
        "lockstate": "unlocked",
        "notification": "source:manual,code:Manual Unlock,pin:0",
        "pin": [
            {
                "code": "XXXXXXXXXX",
                "id": 2,
                "status": 1,
                "type": 0
            },
            {
                "code": "XXXXXXXXXX",
                "id": 1,
                "status": 1,
                "type": 0
            },
            {
                "code": "1234",
                "id": 3,
                "status": 1,
                "type": 0
            }
        ]
    }

@manup
Copy link
Member

manup commented May 22, 2021

Cool, I like that the door lock code moved into a separate file. I'm going to get a Yalelock for testing myself. For the PIN security we still need to find a way which works for all clients, I guess it would be good to create a dedicated issue for that and get discussion and ideas how to approach this.

@zeiphon
Copy link

zeiphon commented Jul 7, 2021

@manup did you end up getting a yale lock for testing?

@bjornomy
Copy link

@Smanar this looks very promising. Is there anything I could help with? I have an ID Lock 150 where I would like to use the set/get pin functionality and maybe 'Door opened by user x' or whatever it may be.
I've seen people implementing this (lock) in Zigbee2Mqtt, and I might be able to get some details from them, if needed.

@Smanar
Copy link
Collaborator Author

Smanar commented Jul 17, 2021

If I m right the "ID Lock 150" is alreadu in the code ?
This Pr and the key pad one #4758 are in the todo list, it s for that they was recently updated, with some luck we will have them in the future PR validation session.

@bjornomy
Copy link

bjornomy commented Jul 17, 2021

Ahh, sorry, I might have been somewhat unclear.

As far as I understand, this PR improves the generic ZHADoorlock basis that all Zigbee locks could use as a representation of the component. ZHADoorlock is then the object which is serialized into JSON when you GET /api//[sensor|light]/, correct?

It seems to me that this PR adds at least the ability to read out both 'locked/unlocked' and 'open, closed, jammed', which the last of I can't get through the REST API today.

Since my lock has the correct cluster and state fields (0x0101 -> 0x000 - 0x0003), I was simply thinking I could test, or otherwise look through the locks implementation in Zigbee2Mqtt to maybe get some implementation hints towards other useful and generic functionality.

@Smanar
Copy link
Collaborator Author

Smanar commented Jul 17, 2021

ZHAdoorlock is already in the code, but yes, the actual version miss some feature like the state/doorstate or the state/notification.
Thoses one are on this PR, and if you have a linux machine with full OS you can test this PR, it was updated recently so it don't miss lot of changes.

@Smanar Smanar mentioned this pull request Jul 30, 2021
@manup
Copy link
Member

manup commented Aug 1, 2021

Small update: I got a Danalock V3 now for testing and will review and test the code after the next stable release.

@wvuyk
Copy link

wvuyk commented Sep 11, 2021

@manup

Are there any plans to implement pin code management possibilities on the Yale lock keypads (and others too I imagine)? I have a customer who would like to implement the zigbee version of Yale lock as the responbse seems to be a lot better then zwave versions. But he needs user (pin) management to have its tracks correct?

Wim

@burken-
Copy link
Contributor

burken- commented Oct 26, 2021

@Smanar @manup Is there anything I can help with to get this PR over the finishline? Would be really neat to have the pin-code handling in the api

@Mimiix Mimiix linked an issue Feb 2, 2022 that may be closed by this pull request
@amaino
Copy link

amaino commented Aug 26, 2022

Really would like to have PIN management through the REST api. I have a cleaner coming by every second week and want to create a one time pin automatically for him in the morning of the day.

Is there anything I can do to help this PR to go through?

@dtd
Copy link

dtd commented Sep 9, 2022

Any updates on progress on this PR? Would really love to have the pin management.

@Smanar Smanar closed this Apr 30, 2024
@Smanar Smanar deleted the doorlock_part2 branch April 30, 2024 15:12
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.

IDlock 150 - No binding for door state
8 participants