Text this: Optimization-based optimal energy management system for smart home in smart grid