Lock with pin code

Hi,

I have a home made mqtt lock for my front door. I use a Manual Alarm Control Panel with pin code for my house and when the alarm is unarmed the lock is unlocked. The problem is that there are situations when I want to unarm the house without unlocking all my doors. I would like to have pin code on my lock so that a correctly unlocked door disable the alarm, not the other way around.

Going to Services in the UI and select lock.unlock there is an option for ‘code’, but there seems no way of adding a ‘code:’ parameter to my mqtt lock configuration (invalid parameter).

A possible nasty solution would be creating another Manual Alarm Control Panel for the lock only, and logic to sync them both with the lock status, but this is very hackish and probably my last option.

Is there any way, or custom component, or custom lovelace card or any other way to add a pincode to an mqtt lock? Any ideas?

Did you ever get anywhere with this. I am trying to do the same thing.

Kind of. I’ve been using a conditional card to hide the unlock button when the alarm is armed and showing it when unarmed.
Now I am using custom card “restriction-card” which supports both pin code and hiding. Good enough for me.

I know this is a bit of an old topic, but while restriction card or lock card does work for lovelace button’s it doesn’t work for iOS actions. Any thoughts on those?