How does the smartlock know the code? After creating a code, you must synchronize the lock: by opening or closing the door: before opening the smartPhone sends the new rights to the lock,if you have a gateway there is nothing to do, the rights are sent to the lock within 10s.