Home access control using RFID reader

I have an RFID reader connected to home assistant which gives me the scanned code in HA.

Now I would like to set up a mapping to map usernames to the RFID tags.
In normal programming languages I’d need a list using key-values. The key is the RFID tag code and the value is the user name.
But I really don’t know where to start looking on how to set something like this up in HA?
I also want to be able to add/remove users from lovelace…

The next step would be to assign “allowed access hours” for the users. But that would need to be dynamically too, since I could add/remove users…

Basically I’d like to make something like this to check if a code is allowed acces:

Code Name Access DayOfWeek TimeFrom TimeTo
1234 User 1 always
5555 User 2 controlled 2 07:00 15:00
5656 User 3 controlled 3 12:00 14:00
5656 User 3 controlled 4 12:00 14:00

User 1 is always allowed access.
User 2 only on tuesday from 07:00-14:00
User 3 on wednesday 12:00-14:00 and thursday 12:00-14:00

Could anyone point me in the right direction on how to make this?

Thanks in advance!

Which RFID reader are you using and how did you connect it to HA?

Would love something like this too.
I got a Tuya Access Keypad, set it to ReaderMode (Wiegand 26), then connected it to an ESP32 with ESPHome.
Wiegand on ESPHome

So now I can get TagIDs in HomeAssistant, but lack the UI Tools to map them to users and define rules as to what happens when they scan during certain time.
Sure, I can set up a few Automations, but this is a pain to maintain as days/times vary for people needing access to property.

1 Like

Did you ever come up with a solution?

https://github.com/ssieb/custom_components/tree/master/components/wiegand

:: page not found :unamused:

NOTE: Some components have been merged to esphome