iantrich / restriction-card

🔒 Apply restrictions to Lovelace cards
MIT License
270 stars 23 forks source link

Multiple PIN codes #67

Open kalhimeo opened 2 years ago

kalhimeo commented 2 years ago

Is your feature request related to a problem? Please describe. Not related to a problem, just that at the moment we can only specify one unique pin code per card

Describe the solution you'd like Change the code section to make it a list of strings instead of just a string

Describe alternatives you've considered N.A.

Additional context When multiple users are using the wall tablet, it's nice that that everyone can have his own PIN code (ie. to disable the alarm system).

Thank you very much for considering the feature request :-)

Fusseldieb commented 11 months ago

A workaround is to create conditional entities based on the logged user.

Let's say you have three users. Create a card with three alarm entities (the same one three times). Then, using the YAML code editor, conditionally show only the one for the logged user. Do that for all three. Done that, I think you can just assign a pin to each one and done. As a "bonus" you'll see that just the right pin for the right user works, as with an array all codes would be valid for all users (which increases the "risk*").

* Protecting something in the frontend isn't really a protection anyways. Someone with a little experience with JS can click right through, regardless of which pin you set.

kitty99hub commented 1 month ago

Hi, @Fusseldieb However, this workaround does not necessarily lead to the desired solution! If, for example, you want to record which person has entered a code on a wall tablet that accesses HA with a separate device login, this is not possible, because in this case, the individual people do not log in to the tablet with their personal login... The workaround only works with personal devices such as a cell phone, but not on a wall tablet that is permanently logged in with the separate device login. The desired multi-pin solution would be very helpful here. I am also looking for a solution on how I can best integrate my Aqara U200 door lock into HA, but for various reasons I have not yet found the right one. Multiple personal PINs would be great here :) kind regards