Newbie help: Design a door access system (keymaster n/a)

Hello there,

I am a newbie working with HAOS 11.5 and ESPHOME.
My main goal is to achieve a door access system that allows a couple of users to open doors at certain times with PIN and RFID code.

The hardware side already works perfectly fine: I do not like Chinese Zwave locks (battery dependency, etc), and opted for a WIEGAND access pad that can read RFIDs and has a keypad (using ZKteco KR602M available for 25 Euros on AliExpress). This I power against docs with just 5V DC, which leads into WIEGAND working at only 3.9V level but still being long term reliable. This I can then directly hook up to an ESP32-C3 SuperMini (without level shifter), using ESPHome - all works like a charm, super simple, cheap, reliable, cable powered, and I get RFIDs and PIN codes very reliably and fast through WIFI.

I can not use keymaster since it only works with Zwave locks. Instead, I need a simple way to query some data storage with the entered RFID and PIN and location (ID of keypad) and date to check if this combination is allowed right now to open the door. If yes, an Ethernet Relay board triggers an electric latch.

Hardware is all done, but editing, storing and querying the access data - I am pretty lost. My idea was to use the SQL SENSOR to query this data from an SQL database which basically delivers back a result or not and would in turn activate the door relay. Could work easily. Editing and changing door access data I could possibly do by adding phpMyAdmin to HA and then just do low level editing of the database table.

The above should work, but user friendly is something else.

Does anyone can point me (name-drop me) some ideas how to do it differently? How to edit door access data, ideally directly from HA, and how to query this data from some automation?

Any idea would be welcomed. I am talking about 15 doors and 10 users.

Try https://github.com/raman325/lock_code_manager