Is it possible to add a new PIN code on a doorlock by lua scripting ?
I would like to dynamically add and remove PIN codes on my doorlock but I don’t know if it is possible (for security aspect) and if so, how to do it (sample code)
It should be possible using the core Lua module available on our Ezlo API for Lua scripting. Here you can give it a check at all the modules, the syntax, and a short description of what each module does.
Give me some time as I don’t have access to a lock to test right now, but I’ll reply to you as soon as I can with a sample code!
@slapfrost thank you for the fast reply… However, I’m on a VeraPlus controller. I suppose that the core API is not the same for the VeraPlus and the new Ezlo Hubs right ?
Yes, you are right. The API provided is intended to be used with Ezlo Hubs. Considering the fact that you are using a Vera Plus, it might be possible with Luup Lua extensions or forcing a data request to either add or remove a pin code. I’ll send you a PM, if you can possibly enable remote access on your controller and allows us to create/delete pin codes on it, we should be able to come up with a code that can be useful for you. It’d be posted here as well in case it’s useful for anybody else.
DeviceID: The ID of the device to add/remove the pin code. PinCodeName: The name to be given to the new pin code to be added. NewPinCode: The new pin code to be added. PinCodeSlot: The slot that the pin code is occupying on the lock. You can check the pin code slot on the interface, where the pin codes are listed.
However, since you have made your remote tests on my controller, all my zigbee devices are now disconnected. I had this issue several times on my VeraPlus and it is very frustrating because the only way I found to correct the situation is to delete all the devices and recreate again.
Do you have an idea why this is appening only on Zigbee and not Zwave and maybe having a better way to correct the situation ?
Customer support will contact you to get more details on the issue you reported. Please re-enable remote access on your controller and allows us to make a further investigation regarding zig bee settings.