In this work, POM anions were introduced into the viologen system in order to synthesize POM-viologen hybrid compounds with excellent properties. Three new POM-viologen compounds, {CdII(tybipy)(DMF)2[β-Mo8O26]0.5Cl} (1), {CoII(tybipy)2(DMF)2[H2(β-Mo8O26)]2}·4C2H7N (2), and (tybipy)4·(β-Mo8O26) (3) (tybipy·Br = 1-thiophen-3-ylmethyl-[4,4']bipyridinyl-1-ium bromide), have been prepared by a solvothermal method, and their structures were characterized. POM anions are modified by mixing organic ligands with transition metals in compounds 1 and 2. However, compound 3 is a supramolecular structure constructed by hydrogen bonding interactions between the dissociative viologen and POM anions. These three compounds have rapid photoresponse and photochromic ability, which can be made into mixed matrix membranes and hydrogels for UV detection. The rigid sandwich devices prepared by compounds 1-3 have achieved ultrafast electrochromism and recovery. In addition, photochromic hydrogels based on compounds 1-3 can achieve ultrafast photochromic recovery. Compounds 1-3 can be used in ink-free printing and Hg2+ fluorescence detecting. Compounds 1 and 2 can also be used as organic amine detectors. Combined with photochromism and fluorescence detection of Hg2+, visual test papers for Hg2+, Cu2+, and Co2+ were successfully realized, which can improve the portability and detection speed of heavy metal ions in the actual environment.