Abstract:In smart home systems, scenario automation rules can automatically execute a set of device operations based on user-defined trigger conditions, enabling complex coordinated behaviors such as “home mode” or “sleep mode”. However, end users often face challenges when creating customized rules, particularly when coordinating multiple devices and addressing complex intentions. On the one hand, users typically lack the technical expertise to clearly articulate their needs or translate them into formal rules. On the other hand, existing methods for generating automation rules have two primary limitations. First, they lack the capability to model complex scenarios, making it difficult to support advanced automation needs involving multi-device coordination. Second, they overly rely on users providing explicit, structured instructions, overlooking the implicit expression of user intentions. To address these issues, this study proposes HomeMind, an intelligent agent system powered by large language models (LLMs) that integrates pattern mining and semantic understanding capabilities. The workflow of HomeMind comprises three core steps. First, an unsupervised method for mining frequent event patterns is used to adaptively process event sequences of varying lengths, enabling more accurate identification of event patterns. Second, temporal features at both weekly and daily scales are extracted for each pattern, significantly enhancing its temporal context. Finally, a context-augmented prompt mechanism is leveraged to guide the LLM in inferring user intentions through chain-of-thought reasoning and generating semantically clear scenario automation rules. Ultimately, HomeMind presents candidate rules to users, facilitating the understanding and selection of automation solutions best suited to their lifestyles, and supports integration with smart home platforms for one-click rule deployment. Comprehensive evaluations of HomeMind are conducted on both real-world and synthetic datasets. Experimental results demonstrate that HomeMind outperforms existing baseline methods in both intention inference and rule generation accuracy.