Multi-Agent System Theory for Resource Management in Home Automation Systems