A CO2 optical sensor based on self-assembled metal-organic framework nanoparticles