Almost 10 years ago I installed Kwikset Z-Wave locks on our doors. They had been working well for years, but I noticed that the batteries drained faster than I had expected. I attributed this to buying refurbished or b stock locks and just tried to get batteries that lasted longer. Last December I decided to replace the locks with new ones that hopefully drained the batteries slower.
The locks appeared to drain slower initially, but I wasn’t get the year out of a set of batteries that I had read others could get; I could get a few months. After one of the updates to Home Assistant, I noticed in the Logbook that it recorded Z-Wave commands. In the list of commands were a bunch of "lock" commands sent to one of the locks; about once every 30 seconds at night.
Ah ha! It finally dawned on me. In my Node-RED automations, I had it setup to lock the garage door lock at night if the door was closed. This was repeated every 30 seconds. I had thought that if the lock was locked, nothing would happen. That was not the case as Home Assistant happily sent the command causing the lock to wake up every 30 seconds. The fix was quite simple: before sending the lock command check the state of the lock as Home Assistant stored this without having to poll the lock. With this simple change I stopped seeing the Z-Wave lock command and knock on wood, the batteries are lasting longer!