A Middleware for the Integration of Smart Grid Elements with WSN Based Solutions. (16th December 2014)