How to create a new sensor of a 'sub' attribute?

Assuming you know how to set up a template sensor, use this in the template to get the pin_code for user 108:

{{ state_attr('lock.0x68...','users')['108']['pin_code'] }}

for example. Have a play in Developer Tools / Templates to check it.

1 Like