用大模型自动发现并修复智能家居配置错误,准确率超90%。
SmartHomeSecure: Automated Detection and Repair of Smart Home Configuration Errors Using Large Language Models
- 结合程序分析与约束提示,分步诊断配置文件错误
- 五类错误检测准确率达100%,修复成功率87%~93%
- 适合智能家居用户和开发者快速排查配置问题
智能家庭自动化平台越来越多地依赖用户编写的YAML配置文件来定义设备行为,但这些文件容易出现语法、格式和语义逻辑错误,导致自动化失败甚至安全风险。现有YAML验证器、静态分析工具及通用大模型在端到端诊断与修复方面支持有限,因缺乏领域知识和经验证的修复流程。本文提出SmartHomeSecure,一个基于轻量级程序分析与约束引导大模型生成的原型系统,用于自动检测与修复Home Assistant配置错误。该系统解析YAML文件,识别语法与常见语义错误,归一化错误上下文,对常规缺陷执行确定性自动修复,并构建约束提示以引导LLM生成最小且结构合法的修复方案。系统实现为四层模块化网页应用:UI壳层、功能协调器、领域引擎与集成层。修复流程在100个真实世界Home Assistant YAML文件上测试,人为注入五类错误(语法/解析、缩进、映射、序列、标量引号)。测试了gpt-oss-20b、gpt-oss-120b、llama-3.1-8b、llama-3.3-70b四个模型。结果显示三款模型检测准确率100%,修复成功率在87%至93%之间。人工验证确认成功输出无幻觉或错误修复。结果表明,结合领域感知程序分析与约束生成式AI是提升智能家居配置修复可靠性与可用性的可行路径。
原文摘要 · Abstract (English)
Smart home automation platforms increasingly rely on user-authored YAML configuration files to define device behaviors, but these files are prone to syntax, formatting, and semantic logic errors that can cause automation failures and safety risks. Existing YAML validators, static analysis tools, and general-purpose large language models offer limited support for end-to-end diagnosis and repair because they lack domain-specific understanding and validated correction workflows. This paper presents SmartHomeSecure, a prototype for automated detection and repair of Home Assistant configuration errors using lightweight program analysis and constraint-guided large language model generation. SmartHomeSecure parses YAML files, detects syntactic and common semantic errors, normalizes error context, applies deterministic auto-fixes for routine defects, and constructs constrained prompts that guide LLMs toward minimal and structurally valid repairs. The system is implemented as a modular web application with four layers: UI Shell, Feature Orchestrator, Domain Engine, and Integration Layer. Its repair pipeline was evaluated on 100 real-world Home Assistant YAML files with manually injected errors across five categories: syntax/parsing, indentation, mapping, sequence, and scalar quoting errors. Four models were tested: gpt-oss-20b, gpt-oss-120b, llama-3.1-8b, and llama-3.3-70b. Results show that three models achieved 100% error detection accuracy, with repair success rates ranging from 87% to 93%. Manual verification found no hallucinated or incorrect repairs among successful outputs. These findings suggest that combining domain-aware program analysis with constrained generative AI is a feasible approach for improving the reliability and usability of smart home configuration repair.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。