Simultaneous sensing of the chemical and physical environment with smart nanocomposites prepared from hybrid colloids