The controlled introduction of artificial extrinsic defects is critical to achieve the functions of photonic crystals. Smart defects capable of responding to external stimuli lead to more advanced applications.H ere we report am icrogel colloidal crystal with ad efect state whichc ould be induced and erased reversibly by external stimuli. The crystal was assembled from PNIPAM microgel and P(NIPAM-AAc) microgel of the same size. The resulting doped crystal does not exhibit adefect state in its stop band because of the similar optical properties of the dopant and the host. By increasing the pH value,however,the dopant P(NIPAM-AAc) spheres swell to alarger size and turn into real defects in the crystal, resulting in the appearance of defect state.Adjusting the pH value back restores the sizeo ft he dopant spheres,a nd thus erases the defect state.T emperature,as econd external stimulus,c ould also be used to induce and erase defect states of the crystal.