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

Enhance reporting of nimly pro door lock #6010

Merged
merged 11 commits into from
Jul 27, 2023
Merged

Conversation

slackspace-io
Copy link
Contributor

Enhancing support for Nimly Pro smart lock. The original version does not report values for numerous fields - see Koenkk/zigbee2mqtt#17205

Parsing messages 256 and 257 to return the following:
last_unlock_source: Whether self, keypad, fingerprint, rfid which unlocked the door
last_unlock_user: numerical value of which user unlocked the door
last_lock_source: Whether self, keypad, fingerprint, rfid which locked the door
last_lock_user: numerical value of which user locked the door

As well the last reported pin entry -- This is whatever numbers were entered into the keypad.

This works for me as an external converter, this is my first time trying to merge in to your repo. Hopefully i've followed things correct :)

const hex = msg.data['256'].toString(16).padStart(8, '0');
const firstOctet = String(hex.substring(0, 2));
const lookup: { [key: string]: string } = {
'00': 'MQTT',
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • I proprose to change this to zigbee, this library is used by more projects than just Zigbee2MQTT.
  • Please make everything lower case here

@@ -26,8 +76,11 @@ const definitions: Definition[] = [
device.save();
},
exposes: [e.lock(), e.battery(), e.sound_volume(),
e.lock_action_source_name(), e.lock_action_user(),
e.action(Array.from(Object.values(constants.easyCodeTouchActions))),
e.text('last_unlock_source', ea.STATE).withDescription('Last unlock source'),
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I missed this in my initial review, but this should be an e.enum with all the values from the lookup. (same for last_lock_source)

@Koenkk Koenkk merged commit 62fbaa2 into Koenkk:master Jul 27, 2023
@Koenkk
Copy link
Owner

Koenkk commented Jul 27, 2023

Thanks!

@stefancn
Copy link

Thanks for your superb works guys, but our locks doesn't show zeros '0' in the 'last_used_pin_code' eg. '440605' shows '4465' can you fix this ....

Regards ...

/Stefan

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.

3 participants