A dual-ligand lanthanide coordination polymer is designed for ratiometric fluorescence and visual detection of Pi.