Home and Building Automation Systems (HBAS) are becoming of widespread adoption. When distinct users interact with such systems, their intentions are likely to be different, often resulting in conflicting situations, which the systems ought to recognize and resolve automatically. This work aims at investigating conflict in HBAS and creating a solution to detect and resolve them. Herein, we review the literature concerning conflict detection and resolution, and propose a formal framework based on constraint solving that enables detecting and solving conflict situations automatically. (C) 2013 Elsevier B.V. All rights reserved.