Applying MAS Theory to Complex Home Automation Systems