Store Lock PIN Value on a Sensor o Exposed it on Home Assistant

Home assistant is great, but no other like hubitat to handle Zwave devices. I want to store the codes i set on my lock on a virtual device, so i can expose it to Home Assistant. For Example:

-Lock Code 1: 1234
-Virtual Temperature Sensor: Lock Code 1 %value% (This sensor will be share to home assistant, so i can see that value on a entity.)

I set the value the codes values on Home Assistant, i want this option to confirm that se value was successfully set.

You could probably do that with a variable. When the lock code is entered it is stored in the variable that the virtual temp read passed to HA that way?

Can you show me and example?, if is not to much to ask.