Hi, I think it would be interesting to be able to give attributes to “person” entities. This could be useful, for example, for assigning variable entities such as a school average or objects that belong to this person.
It seems like everyone wants door access control for their homes. For a full setup, this is a huge lift. May I suggest starting out much simpler?
There’s already tons of hardware out there (wiegand keypads, RFID readers), and ESPHome handles much of this hardware side of things. All that’s required is some kind of endpoint in home assistant that you can use the HTTP request ESPHome component to validate RFID and Keycodes with.
Therefore, I suggest a few simple additions to HA:
- Add to the Persons details, the ability to store custom key/values. This is where you would store a key, say ‘keycode’ and ‘rfidcode’, and it’s value. This integration would also be useful for many other purposes and components, not just access control.
- You can already set tags on doors, so this part is already solved (identifying a door). You could use #1 above to store a key
allowed_doors
with the tags for the door. - A way to setup an endpoint in HA, that would take as an input, JSON, with the keys for
door_id
,doors_allowed_key
,auth_type
,auth_value
. This would lookup ‘auth_type’ to match the key in the Person, anddoor_id
must be in the key set fordoors_allowed_key
. This endpoint should return a JSON payload withauth_allowed
true/false, and some other user details like,display_name
, and maybe other user defined keys.
From there it should be pretty easy for the endpoint to dump a log entry that could be used by other internal automations (welcome home, prescense, etc).
This seems like a pretty simple lift to get the access control stuff off the ground?
Thanks so much!
HA already has that
I would just store it in secrets and callback that value in automation. If it is changing value then creating an entity would be better
In regards to the API endpoint to validate a key, I’m not seeing how the home assistant API could do that? Maybe I could get the secret value via the API, and validate it locally, but that’s not exactly what I was looking for. I also don’t see anywhere in the link where I could add an endpoint to do what I wanted it to do. Maybe I’m missing something?
Also, thanks for the idea of secrets, I’ll look into that, but that doesn’t seem like an easy thing to update or edit as codes change.
Validate is easy. I just realize the input of key could be issue.
I wanted to give my kids access to our entry gate but did not want give shared code so I decide to use OTP for Code.
HA has OTP sensor so it has latest code
Each person has Auth app with OTP code. Code may be group shared or individual.
I created Javascipt Webpage for people to enter code. It simply forwards code to HA api and api trigger’s automation. I don’t currently parse which users code triggers but I’m sure if I want I could just compare code and feed that to notification somehow.
Automation checks code against allowed codes and other conditions (time of day) and perform actions (open gate or ring doorbell)
I think this is similar to what you are looking to do, only using NFC instead of OTP. I not familiar with how NFC work with HA but I’m guessing the web frontend I use is not needed since NFC is direct hardware input