The supramolecular assembly of anionic azobenzene dicarboxylate and cationic cetyltrimethylammonium bromide (CTAB) formed a stimuli responsive hydrogel with a critical gelation concentration (CGC) of 0.33 wt%. This self-sustainable two-component system was able to repair damage upon light irradiation. Moreover, it was successfully employed in the fabrication of highly sensitive humidity sensors for the first time.