An inversion strategy for energy saving in smart building through wireless monitoring