Built this quite some time ago to work with an RF Based front door lock (when I ran OpenHAB) Am slowly transitioning to HA. Wrote an instructable for it quite a number of years ago, have updated to include YAML config for ESPHome / HA.
Maybe useful for someone:
Only downside it doesn’t have feedback as to current lock status if someone manually locks the door, still handy for locking front door either remotely or via automation