Left side of the schematic is the key encoder encoder. Right side is the switch side. To unlock the digital lock, one should copy the encoder line pattern, (for example 001011) to the switch line pattern. Red light means the lock is closed, green line means it is opened.