Design and Implementation of an Internet of Things Based Smart Energy Metering