An Approach to Home Automation by means of MAS Theory