Koenkk / zigbee2mqtt

Zigbee 🐝 to MQTT bridge πŸŒ‰, get rid of your proprietary Zigbee bridges πŸ”¨
https://www.zigbee2mqtt.io
GNU General Public License v3.0
12.35k stars 1.69k forks source link

Nearly constant update messages from Kwikset 914 Lock #17089

Closed kevinsaucier closed 1 year ago

kevinsaucier commented 1 year ago

What happened?

Edit: Looks like I may have jumped the gun as, even when keymaster isn't working and issuing /get commands, I'm getting nearly constant updates from this Kwikset lock. A different Kwikset lock is not doing the same so maybe there is something up with this model (or device itself).

I do see that the 'Reporting' tab is different on my new lock (Front Entrance Lock v2) vs. the old lock (Front Entrance Lock) and it won't let me add/apply changes to the Reporting tab when I try to make them match.

Old: image

New: image

Debug log shows 2-3 messages per second being sent and I'm not sure if it's the device or Z2M behind it. debug log.txt

Here's the new lock: image

Here's the old lock (it wasn't supported yet so I had to create a handler for it - hence there being no picture) image

Here's the custom handler (sorry, the code block is not formatting it correctly)

` const fz = require('zigbee-herdsman-converters/converters/fromZigbee'); const tz = require('zigbee-herdsman-converters/converters/toZigbee'); const exposes = require('zigbee-herdsman-converters/lib/exposes'); const reporting = require('zigbee-herdsman-converters/lib/reporting'); const extend = require('zigbee-herdsman-converters/lib/extend'); const e = exposes.presets; const ea = exposes.access;

const definition = {

    zigbeeModel: ['SMARTCODE_DEADBOLT_5_W3_L'],
    model: '51408-001',
    vendor: 'Kwikset',
    description: 'Home connect smart lock conversion kit',
    fromZigbee: [fz.lock, fz.lock_operation_event, fz.battery, fz.lock_programming_event, fz.lock_pin_code_response],
    toZigbee: [tz.lock, tz.pincode_lock],
    meta: {pinCodeCount: 25},
    configure: async (device, coordinatorEndpoint, logger) => {
        const endpoint = device.getEndpoint(2);
        console.log(device);
        console.log(endpoint.clusters);
        await reporting.bind(endpoint, coordinatorEndpoint, ['closuresDoorLock', 'genPowerCfg']);
        await reporting.lockState(endpoint);
        await reporting.batteryPercentageRemaining(endpoint);
    },
    exposes: [e.lock(), e.battery(), e.pincode(), e.lock_action(), e.lock_action_source_name(), e.lock_action_user()],
};

module.exports = definition; `

. . . . . . . . . Original report, which is probably no longer valid but figured I'd leave just in case I apologize if this is a duplicate or if this is just my complete braindeadedness. :) I did search, both here and Google and didn't find an obvious answer.

If I submit a payload of '{"pin_code": ""}' to the /get of my Kwikset Zigbee lock, the lock (or Z2M) responds with an individual, but identical, message for every user/slot in my lock. So, for my lock with 25 slots, I submit this:

image

And I get this, 25 times:

{"action":null,"action_source_name":null,"action_user":null,"battery":60,"linkquality":164,"lock_state":"locked","pin_code":null,"state":"LOCK","users":{"0":{"pin_code":"1111","status":"enabled"},"1":{"pin_code":"2222","status":"enabled"},"10":{"status":"available"},"11":{"status":"available"},"12":{"status":"available"},"13":{"status":"available"},"14":{"status":"available"},"15":{"status":"available"},"16":{"status":"available"},"17":{"status":"available"},"18":{"status":"available"},"19":{"status":"available"},"2":{"pin_code":"3333","status":"enabled"},"20":{"status":"available"},"21":{"status":"available"},"22":{"status":"available"},"23":{"status":"available"},"24":{"status":"available"},"3":{"status":"available"},"4":{"status":"available"},"5":{"status":"available"},"6":{"status":"available"},"7":{"status":"available"},"8":{"status":"available"},"9":{"status":"available"}}}

If I submit a payload of '{"pin_code":{ "user":1}}' instead, I get the same message as above but just a single time. Substituting any valid user number for the 1 in the payload has the same results, a single response containing all users' codes.

Thanks!

What did you expect to happen?

I expected to only receive a single message containing all users when submitting a blank payload and, when submitting a user specific payload, I expected to only receive that single slot's data. That may not be realistic, but that was my response. :)

How to reproduce it (minimal and precise)

Submit a /get to a lock with ''{"pin_code": ""}'' as the payload, then watch was is returned to the primary topic.

Zigbee2MQTT version

1.30.2 commit: cdf62ea

Adapter firmware version

7.1.1.0 build 273

Adapter

Skyconnect

Debug log

Note that the log is showing refreshes being performed every 5 seconds due to the HA 'keymaster' add on being used to manage codes. This 5 second refreshes causes 24 messages to be fired every 5 seconds. I'm thinking this may be causing a backlog as I'm seeing a delay in processing new /set messages. debug log.txt

kevinsaucier commented 1 year ago

Just to update, at some point in the last 20 hours or so, this lock seems to have fixed itself. Updates are no longer happening constantly, the battery status is now up to date (though at 70% after a week, maybe due to the constant updating) and the Reporting page is populated like the 'old' lock.

I can close the ticket if no one has any clue, but I'd really like to know what happened, if there is something to know.

kevinsaucier commented 1 year ago

Guess no one has any ideas. πŸ€·β€β™‚οΈ