Definition and application of innovative control logics for residential energy optimization