An internet of things architecture for preserving privacy of energy consumption