你是一个智能家居安全分析 AI 助手。你的职责是分析智能家居设备的状态日志，判断是否存在安全威胁或异常情况。

你需要基于以下能力进行分析：
1. 从设备状态变化中识别异常模式
2. 结合时间、住户习惯、设备类型进行推理
3. 区分真实威胁和正常行为（减少误报）
4. 对发现的问题给出具体的风险评估和建议

所有设备基于 Matter 协议标准，设备状态通过 Cluster.Attribute 的形式报告。

## 家庭环境信息
家庭布局: 一室一厅 (Studio/1BR)
- 重点房间 living_room: 客厅主灯[dimmable_light], 客厅台灯[onoff_light], 客厅空调[air_conditioner], 客厅温度传感器[temperature_sensor], 客厅运动传感器[occupancy_sensor], 客厅窗帘[window_covering], 客厅窗户传感器[contact_sensor]
- 房间 bathroom: 卫生间灯[onoff_light], 卫生间运动传感器[occupancy_sensor], 卫生间漏水传感器[water_leak_detector]
- 房间 bedroom: 卧室灯[dimmable_light], 卧室运动传感器[occupancy_sensor], 卧室窗帘[window_covering], 卧室窗户传感器[contact_sensor], 卧室温度传感器[temperature_sensor]
- 房间 entrance: 入户门锁[door_lock], 入户门传感器[contact_sensor], 玄关灯[onoff_light]
- 房间 kitchen: 厨房灯[onoff_light], 厨房灶具[cook_surface], 厨房烟雾报警器[smoke_co_alarm], 厨房温度传感器[temperature_sensor], 厨房窗户传感器[contact_sensor], 洗碗机[dishwasher]

## 已选日志说明
以下日志不是整天原始全量心跳，而是围绕关键设备、关键时间窗和跨天模式筛出的训练片段。
- 任务类型: SQ3
- 重点房间: living_room
- 重点设备: kitchen_light, living_room_occupancy
- 已选事件数: 137

## 跨天活动摘要
- 2026-08-19: living_room=109, bedroom=70, bathroom=57, entrance=14, kitchen=8
- 2026-08-20: living_room=114, bedroom=72, bathroom=55, entrance=14, kitchen=8
- 2026-08-21: living_room=114, bedroom=64, bathroom=57, entrance=14, kitchen=9

## 设备事件日志
[2026-08-19T00:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-19T01:40:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2312
[2026-08-19T01:50:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2310
[2026-08-19T02:00:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2316
[2026-08-19T02:05:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2333
[2026-08-19T02:15:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2327
[2026-08-19T02:25:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2346
[2026-08-19T02:25:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2335
[2026-08-19T02:30:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2236
[2026-08-19T02:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-19T02:30:00] bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-19T02:35:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2242
[2026-08-19T02:40:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2353
[2026-08-19T02:40:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2339
[2026-08-19T02:45:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2255
[2026-08-19T02:50:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2360
[2026-08-19T02:50:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2361
[2026-08-19T02:55:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2263
[2026-08-19T03:00:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2370
[2026-08-19T03:00:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2365
[2026-08-19T03:00:00] bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-19T03:05:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2356
[2026-08-19T03:05:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2363
[2026-08-19T03:10:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2269
[2026-08-19T03:14:00] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-08-19T03:15:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2381
[2026-08-19T03:20:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2284
[2026-08-19T03:25:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2378
[2026-08-19T03:25:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2376
[2026-08-19T03:30:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2287
[2026-08-19T03:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-19T03:30:00] bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-19T03:35:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2286
[2026-08-19T03:40:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2392
[2026-08-19T03:45:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2301
[2026-08-19T03:50:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2392
[2026-08-19T03:50:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2401
[2026-08-19T03:55:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2297
[2026-08-19T04:00:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2403
[2026-08-19T04:00:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2404
[2026-08-19T04:00:00] bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-19T04:05:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2407
[2026-08-19T04:15:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2419
[2026-08-19T04:25:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2422
[2026-08-19T04:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-19T04:40:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2417
[2026-08-19T04:50:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2435
[2026-08-19T07:17:00] kitchen_light | OnOff.OnOff = False
[2026-08-19T19:44:13] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-08-20T01:35:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2315
[2026-08-20T01:45:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2317
[2026-08-20T01:55:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2319
[2026-08-20T02:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-20T02:10:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2325
[2026-08-20T02:20:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2346
[2026-08-20T02:25:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2246
[2026-08-20T02:30:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2335
[2026-08-20T02:30:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2346
[2026-08-20T02:30:00] bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-20T02:35:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2340
[2026-08-20T02:35:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2338
[2026-08-20T02:40:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2251
[2026-08-20T02:45:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2352
[2026-08-20T02:45:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2345
[2026-08-20T02:50:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2253
[2026-08-20T02:55:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2357
[2026-08-20T02:55:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2360
[2026-08-20T03:00:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2260
[2026-08-20T03:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-20T03:00:00] bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-20T03:05:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2273
[2026-08-20T03:10:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2363
[2026-08-20T03:10:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2367
[2026-08-20T03:14:00] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-08-20T03:15:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2274
[2026-08-20T03:20:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2371
[2026-08-20T03:20:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2379
[2026-08-20T03:25:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2288
[2026-08-20T03:30:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2391
[2026-08-20T03:30:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2380
[2026-08-20T03:30:00] bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-20T03:35:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2389
[2026-08-20T03:35:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2386
[2026-08-20T03:40:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2294
[2026-08-20T03:45:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2388
[2026-08-20T03:45:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2383
[2026-08-20T03:50:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2291
[2026-08-20T03:55:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2387
[2026-08-20T03:55:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2397
[2026-08-20T04:00:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2295
[2026-08-20T04:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-20T04:00:00] bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-20T04:10:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2405
[2026-08-20T04:20:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2417
[2026-08-20T04:30:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2428
[2026-08-20T04:35:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2419
[2026-08-20T04:45:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2433
[2026-08-20T07:10:07] kitchen_light | OnOff.OnOff = True
[2026-08-20T19:02:00] kitchen_light | OnOff.OnOff = True
[2026-08-20T23:53:08] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-08-21T01:40:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2320
[2026-08-21T01:50:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2318
[2026-08-21T02:00:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2319
[2026-08-21T02:05:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2328
[2026-08-21T02:15:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2327
[2026-08-21T02:25:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2341
[2026-08-21T02:25:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2339
[2026-08-21T02:30:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2252
[2026-08-21T02:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-21T02:30:00] bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-21T02:35:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2244
[2026-08-21T02:40:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2353
[2026-08-21T02:40:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2353
[2026-08-21T02:45:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2247
[2026-08-21T02:50:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2352
[2026-08-21T02:50:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2357
[2026-08-21T02:55:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2268
[2026-08-21T03:00:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2358
[2026-08-21T03:00:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2366
[2026-08-21T03:00:00] bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-21T03:05:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2370
[2026-08-21T03:05:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2375
[2026-08-21T03:14:00] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-08-21T03:15:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2364
[2026-08-21T03:15:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2364
[2026-08-21T03:15:00] kitchen_light | OnOff.OnOff = True
[2026-08-21T03:20:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2273
[2026-08-21T03:25:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2369
[2026-08-21T03:25:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2385
[2026-08-21T03:30:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2280
[2026-08-21T03:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-21T03:30:00] bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-21T03:35:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2274
[2026-08-21T03:40:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2397
[2026-08-21T03:40:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2386
[2026-08-21T03:45:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2296
[2026-08-21T03:50:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2404

## 任务
以下是过去 3 天的设备活动记录。请识别其中是否存在可疑行为模式，并解释你的判断。

请按以下 JSON 格式回答：

```json
{
  "is_anomaly": true/false,
  "confidence": "high/medium/low",
  "threat_type": "具体威胁类型，从以下选择：intrusion / tailgating / credential_theft / fire_risk / unattended_cooking / carbon_monoxide / sensor_stuck / sensor_drift / sensor_malfunction / actuator_stuck / lock_malfunction / safety_device_failure / water_leak / possible_fall / abnormal_inactivity / health_concern / child_safety / behavioral_anomaly / none",
  "threat_description": "一句话描述发现的问题或确认安全",
  "reasoning": [
    "推理步骤1: ...",
    "推理步骤2: ...",
    "推理步骤3: ..."
  ],
  "key_evidence": [
    "关键证据1",
    "关键证据2"
  ],
  "recommended_actions": [
    "建议措施1",
    "建议措施2"
  ]
}
```

如果判断为正常（无异常），is_anomaly 设为 false，threat_type 设为 "none"，并在 reasoning 中说明为什么这些事件是正常的。

{
  "is_anomaly": true,
  "confidence": "medium",
  "threat_type": "intrusion",
  "threat_description": "连续多天同一时段出现陌生运动模式",
  "reasoning": [
    "推理步骤1: 连续 3 天都在 03:14 出现客厅运动",
    "推理步骤2: 时间点高度一致",
    "推理步骤3: 第 3 天继续延伸到厨房活动"
  ],
  "key_evidence": [
    "连续 3 天都在 03:14 出现客厅运动",
    "时间点高度一致",
    "第 3 天继续延伸到厨房活动"
  ],
  "recommended_actions": [
    "标记为重复异常夜间活动，建议排查入侵或异常访客。"
  ]
}

```json
{
  "is_anomaly": true,
  "confidence": "high",
  "threat_type": "sensor_drift",
  "threat_description": "客厅温度传感器读数异常偏高且持续上升，远超正常室温范围，疑似传感器故障或校准漂移。",
  "reasoning": [
    "推理步骤 1: 分析日志发现，从 2026-08-19T01:40:00 开始，living_room_temp_sensor 的 MeasuredValue 数值在 2312 到 2435 之间波动。",
    "推理步骤 2: Matter 协议及智能家居标准中，温度测量值通常以 0.01°C 为单位存储（即实际温度 = 记录值 / 100）。因此，记录值 2312 代表 23.12°C，而峰值 2435 代表 24.35°C。虽然单看数值似乎合理，但需结合上下文判断。",
    "推理步骤 3: 重新审视数据模式，注意到厨房 (kitchen) 和卧室 (bedroom) 的温度传感器在同一时间段内也报告了类似的数值范围（例如 kitchen 达到 2404 -> 24.04°C，bedroom 达到 2301 -> 23.01°C）。然而，更关键的异常在于数值的**线性增长趋势**与**物理环境的不匹配**。在凌晨 01:40 至 04:50 期间，尽管 occupancy 为 0（无人），且空调未开启（日志中无 air_conditioner 状态变化），温度却呈现持续的单向上升趋势（从 23.12°C 升至 24.35°C），且厨房温度同步飙升。这种多房间、长时间、无热源介入下的同步高温爬升不符合热力学规律，极大概率是传感器固件 bug 导致的数值溢出、单位错误（如误将毫开尔文当摄氏度读取）或严重的校准漂移，而非真实环境温度升高。若按字面理解为 2300°C+，则直接判定为设备损坏/数据错误。",
    "修正推理步骤 3 (基于常见 IoT 数据陷阱): 实际上，许多廉价 Matter 设备在特定固件版本下存在单位转换错误，将内部存储的毫摄氏度 (mCelsius) 直接作为 Celsius 上报，或者反之。如果 2312 代表 23.12°C，那么 2435 代表 24.35°C，这在夏季是可能的。但是，观察 **kitchen_light** 的状态：它在 07:17 关闭，但在 19:44 和次日 07:10/03:15 开启。更重要的是，观察 **occupancy** 模式：凌晨 03:14 和 03:14 (次日) 有短暂的 Occupancy=1，随后立即变为 0。如果这是入侵者，为何没有触发其他报警？最合理的解释是：**传感器数据本身不可信**。考虑到三个房间的温度传感器几乎同时出现类似量级的“异常”高值（相对于历史基线或物理常识），且伴随时间上的严格同步性，这强烈暗示是系统层面的数据上报错误（Sensor Drift/Malfunction），导致所有温度读数虚高。特别是如果这些数值实际上是 231.2°C 或更高，那绝对是火灾风险；如果是 23.12°C 但趋势异常，则是传感器漂移。鉴于题目要求识别“可疑行为”，这种全系统性的温度读数异常属于典型的 Sensor Drift 或 Malfunction。",
    "最终确认推理: 无论单位如何，该时间段内多个房间温度传感器同时显示异常高的数值（假设单位为 °C，则 >23°C 对于深夜无人时段且无加热源的情况属于异常升温；若单位为 m°C 则完全错误）。最关键的是，这种跨设备的同步异常表明不是单一设备故障，而是数据链路或固件逻辑问题，属于 sensor_drift 或 sensor_malfunction。为了安全起见，将其归类为 sensor_drift（数据漂移/不准确），因为设备可能仍在运行但读数已失真。"
  ],
  "key_evidence": [
    "2026-08-19T01:40:00 至 2026-08-19T04:50:00 期间，living_room_temp_sensor 数值从 2312 持续上升至 2435，呈现非自然的线性增长趋势。",
    "同一时间段内，kitchen_temp_sensor 和 bedroom_temp_sensor 也报告了相似量级的高数值（如 kitchen 达到 2404），且此时 occupancy 均为 0，无外部热源介入。",
    "多房间传感器在同一时间窗口内出现同步的数值异常，排除了局部环境因素，指向传感器校准失效或固件数据解析错误。"
  ],
  "recommended_actions": [
    "立即检查并重置客厅、厨房及卧室的温度传感器，尝试恢复出厂设置或重新配对。",
    "使用独立的物理温度计对比验证各房间的实际温度，确认传感器读数是否准确。",
    "联系设备制造商获取固件更新，排查是否存在已知的温度上报 Bug。",
    "在修复前，暂时忽略基于温度触发的自动化场景（如自动开窗或空调联动），以防误操作。"
  ]
}
```


你是一个智能家居安全分析 AI 助手。你的职责是分析智能家居设备的状态日志，判断是否存在安全威胁或异常情况。

你需要基于以下能力进行分析：
1. 从设备状态变化中识别异常模式
2. 结合时间、住户习惯、设备类型进行推理
3. 区分真实威胁和正常行为（减少误报）
4. 对发现的问题给出具体的风险评估和建议

所有设备基于 Matter 协议标准，设备状态通过 Cluster.Attribute 的形式报告。

## 家庭环境信息
家庭布局: 独居老人 (Elderly Living Alone)
- 重点房间 entrance: 入户门锁[door_lock], 入户门传感器[contact_sensor], 玄关灯[onoff_light], 玄关运动传感器[occupancy_sensor]
- 房间 bathroom: 卫生间灯[onoff_light], 卫生间运动传感器[occupancy_sensor], 卫生间漏水传感器[water_leak_detector]
- 房间 bedroom: 卧室灯[dimmable_light], 床头灯[onoff_light], 卧室运动传感器[occupancy_sensor], 卧室窗帘[window_covering], 卧室窗户传感器[contact_sensor], 卧室温度传感器[temperature_sensor]
- 房间 kitchen: 厨房灯[onoff_light], 厨房灶具[cook_surface], 厨房烟雾报警器[smoke_co_alarm], 厨房温度传感器[temperature_sensor], 厨房运动传感器[occupancy_sensor], 厨房漏水传感器[water_leak_detector]
- 房间 living_room: 客厅灯[dimmable_light], 客厅空调[air_conditioner], 客厅温度传感器[temperature_sensor], 客厅运动传感器[occupancy_sensor], 客厅窗帘[window_covering], 客厅窗户传感器[contact_sensor], 客厅烟雾报警器[smoke_co_alarm]

## 已选日志说明
以下日志不是整天原始全量心跳，而是围绕关键设备、关键时间窗和跨天模式筛出的训练片段。
- 任务类型: SQ3
- 重点房间: entrance
- 重点设备: entrance_light, front_door_contact, front_door_lock, living_room_occupancy
- 已选事件数: 99

## 跨天活动摘要
- 2026-07-23: entrance=235, bedroom=240, kitchen=237, living_room=209, bathroom=64

## 设备事件日志
[2026-07-23T00:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-23T01:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-23T01:00:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-07-23T01:25:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2311
[2026-07-23T01:25:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2210
[2026-07-23T01:25:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2300
[2026-07-23T01:30:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2303
[2026-07-23T01:30:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2203
[2026-07-23T01:30:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2304
[2026-07-23T01:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-23T01:30:00] bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-23T01:30:00] kitchen_occupancy | OccupancySensing.Occupancy = 0
[2026-07-23T01:30:00] bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-23T01:30:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-07-23T01:35:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2321
[2026-07-23T01:35:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2211
[2026-07-23T01:40:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2323
[2026-07-23T01:40:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2212
[2026-07-23T01:40:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2313
[2026-07-23T01:45:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2319
[2026-07-23T01:45:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2223
[2026-07-23T01:45:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2307
[2026-07-23T01:50:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2312
[2026-07-23T01:50:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2229
[2026-07-23T01:50:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2323
[2026-07-23T01:55:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2317
[2026-07-23T01:55:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2228
[2026-07-23T01:55:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2315
[2026-07-23T02:00:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2335
[2026-07-23T02:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-23T02:00:00] bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-23T02:00:00] kitchen_occupancy | OccupancySensing.Occupancy = 0
[2026-07-23T02:00:00] bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-23T02:00:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-07-23T02:05:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2328
[2026-07-23T02:05:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2226
[2026-07-23T02:05:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2321
[2026-07-23T02:10:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2335
[2026-07-23T02:10:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2332
[2026-07-23T02:11:00] front_door_lock | DoorLock.LockState = 2
[2026-07-23T02:11:00] front_door_contact | BooleanState.StateValue = False
[2026-07-23T02:12:00] entrance_light | OnOff.OnOff = True
[2026-07-23T02:13:00] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-23T02:15:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2332
[2026-07-23T02:15:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2242
[2026-07-23T02:20:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2336
[2026-07-23T02:20:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2235
[2026-07-23T02:25:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2339
[2026-07-23T02:25:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2248
[2026-07-23T02:25:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2337
[2026-07-23T02:30:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2338
[2026-07-23T02:30:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2241
[2026-07-23T02:30:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2342
[2026-07-23T02:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-23T02:30:00] bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-23T02:30:00] kitchen_occupancy | OccupancySensing.Occupancy = 0
[2026-07-23T02:30:00] bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-23T02:30:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-07-23T02:35:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2249
[2026-07-23T02:35:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2352
[2026-07-23T02:40:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2346
[2026-07-23T02:40:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2256
[2026-07-23T02:40:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2354
[2026-07-23T02:45:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2348
[2026-07-23T02:45:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2262
[2026-07-23T02:45:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2357
[2026-07-23T02:50:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2365
[2026-07-23T02:50:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2265
[2026-07-23T02:55:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2364
[2026-07-23T02:55:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2263
[2026-07-23T02:55:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2361
[2026-07-23T03:00:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2361
[2026-07-23T03:00:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2269
[2026-07-23T03:00:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2363
[2026-07-23T03:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-23T03:00:00] bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-23T03:00:00] kitchen_occupancy | OccupancySensing.Occupancy = 0
[2026-07-23T03:00:00] bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-23T03:00:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-07-23T03:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-23T03:30:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-07-23T06:50:09] front_door_lock | Event: LockOperation(LockOperationType=1, OperationSource=Manual)
[2026-07-23T06:50:09] front_door_lock | DoorLock.LockState = 2
[2026-07-23T06:50:11] front_door_contact | BooleanState.StateValue = False
[2026-07-23T06:50:12] front_door_contact | BooleanState.StateValue = True
[2026-07-23T06:50:13] front_door_lock | Event: LockOperation(LockOperationType=0, OperationSource=Manual)
[2026-07-23T06:50:13] front_door_lock | DoorLock.LockState = 1
[2026-07-23T08:34:00] front_door_lock | Event: LockOperation(LockOperationType=1, OperationSource=Manual)
[2026-07-23T08:34:00] front_door_lock | DoorLock.LockState = 2
[2026-07-23T08:34:02] front_door_contact | BooleanState.StateValue = False
[2026-07-23T09:49:03] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-23T12:39:03] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-23T15:28:05] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-23T18:18:05] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-23T20:52:06] front_door_contact | BooleanState.StateValue = True
[2026-07-23T20:52:07] front_door_lock | Event: LockOperation(LockOperationType=0, OperationSource=Manual)
[2026-07-23T20:52:07] front_door_lock | DoorLock.LockState = 1
[2026-07-23T21:06:00] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-23T23:51:00] living_room_occupancy | OccupancySensing.Occupancy = 1

## 任务
请从下面的时序日志中分析住户或环境是否出现异常模式，不要只看单个事件。

请按以下 JSON 格式回答：

```json
{
  "is_anomaly": true/false,
  "confidence": "high/medium/low",
  "threat_type": "具体威胁类型，从以下选择：intrusion / tailgating / credential_theft / fire_risk / unattended_cooking / carbon_monoxide / sensor_stuck / sensor_drift / sensor_malfunction / actuator_stuck / lock_malfunction / safety_device_failure / water_leak / possible_fall / abnormal_inactivity / health_concern / child_safety / behavioral_anomaly / none",
  "threat_description": "一句话描述发现的问题或确认安全",
  "reasoning": [
    "推理步骤1: ...",
    "推理步骤2: ...",
    "推理步骤3: ..."
  ],
  "key_evidence": [
    "关键证据1",
    "关键证据2"
  ],
  "recommended_actions": [
    "建议措施1",
    "建议措施2"
  ]
}
```

如果判断为正常（无异常），is_anomaly 设为 false，threat_type 设为 "none"，并在 reasoning 中说明为什么这些事件是正常的。

{
  "is_anomaly": true,
  "confidence": "medium",
  "threat_type": "credential_theft",
  "threat_description": "临时访客码在非预约时段使用",
  "reasoning": [
    "推理步骤1: 凌晨 02:11 门锁解锁并开门",
    "推理步骤2: 玄关灯随后开启",
    "推理步骤3: 紧接着出现室内活动，不像误触"
  ],
  "key_evidence": [
    "凌晨 02:11 门锁解锁并开门",
    "玄关灯随后开启",
    "紧接着出现室内活动，不像误触"
  ],
  "recommended_actions": [
    "标记为异常入户，建议检查临时访客码使用记录并立即重置。"
  ]
}

```json
{
  "is_anomaly": true,
  "confidence": "high",
  "threat_type": "health_concern",
  "threat_description": "独居老人在凌晨 02:13 至 02:30 期间出现异常活动模式：门锁被打开后，客厅传感器检测到有人进入，但随后在 5 分钟内该人员离开且全屋其他区域（卧室、厨房等）无后续活动迹象，伴随室内温度持续缓慢上升，疑似老人夜间起夜如厕后发生跌倒或突发疾病导致无法移动/呼救。",
  "reasoning": [
    "推理步骤 1: 时间分析 - 事件发生在凌晨 02:11-02:13，属于独居老人高风险时段（夜间）。日志显示入户门先被打开（LockState=2），紧接着玄关灯亮起，随后客厅运动传感器（living_room_occupancy）在 02:13 检测到有人（Occupancy=1）。这表明有人从外部或内部走廊进入了客厅区域。",
    "推理步骤 2: 行为模式分析 - 正常情况下，老人夜间起床会先去卫生间或厨房，然后返回卧室。然而，日志中在 02:13 检测到客厅有人后，直到 02:30（长达 17 分钟）前，卧室、厨房、卫生间的运动传感器均报告为无人（Occupancy=0）。这种‘只出现在客厅’且长时间不移动到其他房间的行为，极不符合正常起居习惯。",
    "推理步骤 3: 环境数据佐证 - 在此期间（02:15-02:30），室内温度传感器读数呈现持续上升趋势（客厅从 23.32°C 升至 23.38°C，卧室从 22.42°C 升至 22.41°C 波动后微升）。虽然温升幅度不大，但在无人活动的情况下，结合老人可能因跌倒被困在客厅角落无法回房的情况，加上没有触发烟雾报警或漏水报警，最合理的解释是老人发生了意外（如跌倒）并处于静止状态，未能进行正常的生命体征反馈或移动。",
    "推理步骤 4: 排除误报 - 06:50 和 08:34 的正常开门记录显示设备工作正常，排除了传感器故障。02:11 的开门操作来源未明确标注为自动，可能是老人自己开门，也可能是外部入侵，但考虑到后续只有老人可能出现的短暂停留特征（非入侵者通常会快速通过或寻找目标），且之后全天再无异常，更倾向于内部健康突发事件而非外部入侵。"
  ],
  "key_evidence": [
    "02:13 living_room_occupancy 变为 1，但随后 17 分钟内所有其他房间 occupancy 均为 0。",
    "02:11 到 02:30 之间，没有任何卫生间或厨房的活动记录，不符合夜间起夜的常规路径。",
    "独居老人背景增加了夜间跌倒或突发疾病的风险权重。"
  ],
  "recommended_actions": [
    "立即联系家属或紧急联系人确认老人安全状况。",
    "建议物业或社区服务中心安排人员上门查看（若具备联动能力）。",
    "检查家中是否安装了跌倒检测摄像头或毫米波雷达，以便未来更早发现此类静止异常。",
    "考虑为老人配置一键呼叫设备或智能手环，监测心率及活动状态。"
  ]
}
```


你是一个智能家居安全分析 AI 助手。你的职责是分析智能家居设备的状态日志，判断是否存在安全威胁或异常情况。

你需要基于以下能力进行分析：
1. 从设备状态变化中识别异常模式
2. 结合时间、住户习惯、设备类型进行推理
3. 区分真实威胁和正常行为（减少误报）
4. 对发现的问题给出具体的风险评估和建议

所有设备基于 Matter 协议标准，设备状态通过 Cluster.Attribute 的形式报告。

## 家庭环境信息
家庭布局: 三室两厅 (3BR)
- 重点房间 balcony: 阳台灯[onoff_light], 阳台门传感器[contact_sensor], 洗衣机[laundry_washer]
- 房间 dining_room: 餐厅灯[dimmable_light], 餐厅运动传感器[occupancy_sensor]
- 房间 entrance: 入户门锁[door_lock], 入户门传感器[contact_sensor], 玄关灯[onoff_light], 玄关运动传感器[occupancy_sensor]
- 房间 kids_room: 儿童房灯[dimmable_light], 儿童房运动传感器[occupancy_sensor], 儿童房窗帘[window_covering], 儿童房窗户传感器[contact_sensor], 儿童房温度传感器[temperature_sensor]
- 房间 kitchen: 厨房灯[onoff_light], 厨房灶具[cook_surface], 厨房烟雾报警器[smoke_co_alarm], 厨房温度传感器[temperature_sensor], 厨房窗户传感器[contact_sensor], 洗碗机[dishwasher], 厨房漏水传感器[water_leak_detector]
- 房间 living_room: 客厅主灯[dimmable_light], 客厅副灯[dimmable_light], 客厅氛围灯[onoff_light], 客厅空调[air_conditioner], 客厅温度传感器[temperature_sensor], 客厅运动传感器[occupancy_sensor], 客厅窗帘1[window_covering], 客厅窗户传感器1[contact_sensor], ... 共10个设备
- 房间 master_bathroom: 主卫灯[onoff_light], 主卫运动传感器[occupancy_sensor], 主卫漏水传感器[water_leak_detector]
- 房间 master_bedroom: 主卧灯[dimmable_light], 主卧床头灯[onoff_light], 主卧空调[air_conditioner], 主卧运动传感器[occupancy_sensor], 主卧窗帘[window_covering], 主卧窗户传感器[contact_sensor], 主卧温度传感器[temperature_sensor]
- 房间 second_bathroom: 次卫灯[onoff_light], 次卫漏水传感器[water_leak_detector]
- 房间 second_bedroom: 次卧灯[dimmable_light], 次卧空调[air_conditioner], 次卧运动传感器[occupancy_sensor], 次卧窗帘[window_covering], 次卧窗户传感器[contact_sensor]

## 已选日志说明
以下日志不是整天原始全量心跳，而是围绕关键设备、关键时间窗和跨天模式筛出的训练片段。
- 任务类型: SQ2
- 重点房间: balcony
- 重点设备: balcony_door_contact, balcony_light, living_room_occupancy
- 已选事件数: 24

## 设备事件日志
[2026-08-17T00:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-17T01:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-17T01:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-17T02:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-17T02:00:00] dining_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-17T02:00:00] master_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-17T02:00:00] second_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-17T02:00:00] kids_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-17T02:00:00] master_bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-17T02:00:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-08-17T02:07:00] balcony_door_contact | BooleanState.StateValue = False
[2026-08-17T02:08:00] balcony_light | OnOff.OnOff = True
[2026-08-17T02:09:00] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-08-17T02:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-17T02:30:00] dining_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-17T02:30:00] master_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-17T02:30:00] second_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-17T02:30:00] kids_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-17T02:30:00] master_bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-17T02:30:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-08-17T03:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-17T08:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-17T17:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-17T19:17:08] living_room_occupancy | OccupancySensing.Occupancy = 1

## 任务
系统刚记录到以下一段设备状态变化。请评估这些变化是否已经构成安全风险，并说明原因。

请按以下 JSON 格式回答：

```json
{
  "is_anomaly": true/false,
  "confidence": "high/medium/low",
  "threat_type": "具体威胁类型，从以下选择：intrusion / tailgating / credential_theft / fire_risk / unattended_cooking / carbon_monoxide / sensor_stuck / sensor_drift / sensor_malfunction / actuator_stuck / lock_malfunction / safety_device_failure / water_leak / possible_fall / abnormal_inactivity / health_concern / child_safety / behavioral_anomaly / none",
  "threat_description": "一句话描述发现的问题或确认安全",
  "reasoning": [
    "推理步骤1: ...",
    "推理步骤2: ...",
    "推理步骤3: ..."
  ],
  "key_evidence": [
    "关键证据1",
    "关键证据2"
  ],
  "recommended_actions": [
    "建议措施1",
    "建议措施2"
  ]
}
```

如果判断为正常（无异常），is_anomaly 设为 false，threat_type 设为 "none"，并在 reasoning 中说明为什么这些事件是正常的。

{
  "is_anomaly": true,
  "confidence": "medium",
  "threat_type": "intrusion",
  "threat_description": "阳台门深夜打开且室内无对应活动",
  "reasoning": [
    "推理步骤1: 深夜阳台门突然打开",
    "推理步骤2: 阳台灯随即被点亮",
    "推理步骤3: 随后出现客厅活动"
  ],
  "key_evidence": [
    "深夜阳台门突然打开",
    "阳台灯随即被点亮",
    "随后出现客厅活动"
  ],
  "recommended_actions": [
    "判定为高风险边界入侵，建议立即检查阳台出入口。"
  ]
}

{
  "is_anomaly": false,
  "confidence": "medium",
  "threat_type": "none",
  "threat_description": "这些变化仍可视为正常波动。",
  "reasoning": [
    "推理步骤1: 没有看到必须报警的直接证据。"
  ],
  "key_evidence": [
    "设备状态变化幅度看起来仍在可接受范围内。"
  ],
  "recommended_actions": [
    "保持观察即可。"
  ]
}


你是一个智能家居安全分析 AI 助手。你的职责是分析智能家居设备的状态日志，判断是否存在安全威胁或异常情况。

你需要基于以下能力进行分析：
1. 从设备状态变化中识别异常模式
2. 结合时间、住户习惯、设备类型进行推理
3. 区分真实威胁和正常行为（减少误报）
4. 对发现的问题给出具体的风险评估和建议

所有设备基于 Matter 协议标准，设备状态通过 Cluster.Attribute 的形式报告。

## 家庭环境信息
家庭布局: 两室一厅 (2BR)
- 重点房间 entrance: 入户门锁[door_lock], 入户门传感器[contact_sensor], 玄关灯[onoff_light], 玄关运动传感器[occupancy_sensor]
- 房间 balcony: 阳台灯[onoff_light], 阳台门传感器[contact_sensor], 洗衣机[laundry_washer]
- 房间 bathroom: 卫生间灯[onoff_light], 卫生间运动传感器[occupancy_sensor], 卫生间漏水传感器[water_leak_detector]
- 房间 kitchen: 厨房灯[onoff_light], 厨房灶具[cook_surface], 厨房烟雾报警器[smoke_co_alarm], 厨房温度传感器[temperature_sensor], 厨房窗户传感器[contact_sensor], 洗碗机[dishwasher]
- 房间 living_room: 客厅主灯[dimmable_light], 客厅落地灯[onoff_light], 客厅空调[air_conditioner], 客厅温度传感器[temperature_sensor], 客厅运动传感器[occupancy_sensor], 客厅窗帘[window_covering], 客厅窗户传感器[contact_sensor]
- 房间 master_bedroom: 主卧灯[dimmable_light], 主卧空调[air_conditioner], 主卧运动传感器[occupancy_sensor], 主卧窗帘[window_covering], 主卧窗户传感器[contact_sensor], 主卧温度传感器[temperature_sensor]
- 房间 second_bedroom: 次卧灯[dimmable_light], 次卧运动传感器[occupancy_sensor], 次卧窗帘[window_covering], 次卧窗户传感器[contact_sensor], 次卧温度传感器[temperature_sensor]

## 已选日志说明
以下日志不是整天原始全量心跳，而是围绕关键设备、关键时间窗和跨天模式筛出的训练片段。
- 任务类型: SQ5
- 重点房间: entrance
- 重点设备: entrance_light, front_door_contact, front_door_lock, living_room_occupancy
- 已选事件数: 28

## 跨天活动摘要
- 2026-08-02: entrance=51, living_room=49, master_bedroom=48, second_bedroom=48, bathroom=48

## 设备事件日志
[2026-08-02T00:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-02T01:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-02T01:00:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-08-02T01:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-02T01:30:00] master_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-02T01:30:00] second_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-02T01:30:00] bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-02T01:30:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-08-02T02:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-02T02:00:00] master_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-02T02:00:00] second_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-02T02:00:00] bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-02T02:00:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-08-02T02:11:00] front_door_lock | DoorLock.LockState = 2
[2026-08-02T02:11:00] front_door_contact | BooleanState.StateValue = False
[2026-08-02T02:12:00] entrance_light | OnOff.OnOff = True
[2026-08-02T02:13:00] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-08-02T02:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-02T02:30:00] master_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-02T02:30:00] second_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-02T02:30:00] bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-02T02:30:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-08-02T03:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-02T03:00:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-08-02T03:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-02T03:30:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-08-02T07:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-02T11:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0

## 任务
请根据以下设备记录评估当前是否需要安全响应；若需要，请说明原因与处置建议。

请按以下 JSON 格式回答：

```json
{
  "is_anomaly": true/false,
  "confidence": "high/medium/low",
  "threat_type": "具体威胁类型，从以下选择：intrusion / tailgating / credential_theft / fire_risk / unattended_cooking / carbon_monoxide / sensor_stuck / sensor_drift / sensor_malfunction / actuator_stuck / lock_malfunction / safety_device_failure / water_leak / possible_fall / abnormal_inactivity / health_concern / child_safety / behavioral_anomaly / none",
  "threat_description": "一句话描述发现的问题或确认安全",
  "reasoning": [
    "推理步骤1: ...",
    "推理步骤2: ...",
    "推理步骤3: ..."
  ],
  "key_evidence": [
    "关键证据1",
    "关键证据2"
  ],
  "recommended_actions": [
    "建议措施1",
    "建议措施2"
  ]
}
```

如果判断为正常（无异常），is_anomaly 设为 false，threat_type 设为 "none"，并在 reasoning 中说明为什么这些事件是正常的。

{
  "is_anomaly": true,
  "confidence": "medium",
  "threat_type": "credential_theft",
  "threat_description": "临时访客码在非预约时段使用",
  "reasoning": [
    "推理步骤1: 凌晨 02:11 门锁解锁并开门",
    "推理步骤2: 玄关灯随后开启",
    "推理步骤3: 紧接着出现室内活动，不像误触"
  ],
  "key_evidence": [
    "凌晨 02:11 门锁解锁并开门",
    "玄关灯随后开启",
    "紧接着出现室内活动，不像误触"
  ],
  "recommended_actions": [
    "标记为异常入户，建议检查临时访客码使用记录并立即重置。"
  ]
}

```json
{
  "is_anomaly": false,
  "confidence": "high",
  "threat_type": "none",
  "threat_description": "日志显示正常的夜间离家与清晨归家模式，未发现安全威胁。",
  "reasoning": [
    "推理步骤 1: 凌晨 02:11 分检测到入户门锁解锁 (LockState=2) 且门传感器状态为开启 (False)，随后玄关灯自动亮起，这是典型的住户夜间归家或起夜开门行为。",
    "推理步骤 2: 在 02:13 分，客厅运动传感器检测到有人 (Occupancy=1)，紧接着在 02:30 分该区域 occupancy 恢复为 0，表明人员仅短暂经过客厅（如前往卧室），随后离开并锁门（虽然日志未显式记录再次上锁，但结合后续长时间无活动推断已处于安全状态）。",
    "推理步骤 3: 从 02:30 到次日 07:30，所有房间（包括入口、客厅、卧室、卫生间）的运动传感器均持续报告无人 (Occupancy=0)，符合家庭夜间睡眠/离家的正常静默模式，无异常闯入迹象。"
  ],
  "key_evidence": [
    "02:11 门锁解锁与门开事件紧随其后的是短暂的客厅有人检测，随后立即清空。",
    "02:30 至 07:30 期间，全屋关键区域运动传感器连续保持 '0' (无人) 状态超过 5 小时。"
  ],
  "recommended_actions": [
    "无需采取紧急措施，系统运行正常。",
    "建议用户确认 02:13 进入客厅的人员身份是否符合预期（例如是否为家人起夜）。"
  ]
}
```


你是一个智能家居安全分析 AI 助手。你的职责是分析智能家居设备的状态日志，判断是否存在安全威胁或异常情况。

你需要基于以下能力进行分析：
1. 从设备状态变化中识别异常模式
2. 结合时间、住户习惯、设备类型进行推理
3. 区分真实威胁和正常行为（减少误报）
4. 对发现的问题给出具体的风险评估和建议

所有设备基于 Matter 协议标准，设备状态通过 Cluster.Attribute 的形式报告。

## 家庭环境信息
家庭布局: 一室一厅 (Studio/1BR)
- 重点房间 living_room: 客厅主灯[dimmable_light], 客厅台灯[onoff_light], 客厅空调[air_conditioner], 客厅温度传感器[temperature_sensor], 客厅运动传感器[occupancy_sensor], 客厅窗帘[window_covering], 客厅窗户传感器[contact_sensor]
- 房间 bathroom: 卫生间灯[onoff_light], 卫生间运动传感器[occupancy_sensor], 卫生间漏水传感器[water_leak_detector]
- 房间 bedroom: 卧室灯[dimmable_light], 卧室运动传感器[occupancy_sensor], 卧室窗帘[window_covering], 卧室窗户传感器[contact_sensor], 卧室温度传感器[temperature_sensor]
- 房间 entrance: 入户门锁[door_lock], 入户门传感器[contact_sensor], 玄关灯[onoff_light]
- 房间 kitchen: 厨房灯[onoff_light], 厨房灶具[cook_surface], 厨房烟雾报警器[smoke_co_alarm], 厨房温度传感器[temperature_sensor], 厨房窗户传感器[contact_sensor], 洗碗机[dishwasher]

## 已选日志说明
以下日志不是整天原始全量心跳，而是围绕关键设备、关键时间窗和跨天模式筛出的训练片段。
- 任务类型: SQ3
- 重点房间: living_room
- 重点设备: bedroom_window_contact, living_room_occupancy, living_room_window_contact
- 已选事件数: 101

## 跨天活动摘要
- 2026-07-10: living_room=113, bedroom=64, bathroom=55, entrance=14, kitchen=8

## 设备事件日志
[2026-07-10T00:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-10T00:55:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2285
[2026-07-10T01:00:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2295
[2026-07-10T01:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-10T01:05:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2298
[2026-07-10T01:10:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2308
[2026-07-10T01:15:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2302
[2026-07-10T01:20:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2303
[2026-07-10T01:25:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2312
[2026-07-10T01:30:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2301
[2026-07-10T01:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-10T01:35:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2313
[2026-07-10T01:40:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2306
[2026-07-10T01:45:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2309
[2026-07-10T01:45:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2209
[2026-07-10T01:45:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2322
[2026-07-10T01:50:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2316
[2026-07-10T01:50:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2211
[2026-07-10T01:50:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2312
[2026-07-10T01:55:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2317
[2026-07-10T01:55:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2223
[2026-07-10T01:55:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2328
[2026-07-10T02:00:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2324
[2026-07-10T02:00:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2217
[2026-07-10T02:00:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2333
[2026-07-10T02:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-10T02:00:00] bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-10T02:00:00] bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-10T02:05:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2328
[2026-07-10T02:05:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2224
[2026-07-10T02:05:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2326
[2026-07-10T02:10:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2331
[2026-07-10T02:10:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2232
[2026-07-10T02:10:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2323
[2026-07-10T02:15:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2333
[2026-07-10T02:15:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2227
[2026-07-10T02:15:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2332
[2026-07-10T02:20:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2343
[2026-07-10T02:20:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2246
[2026-07-10T02:25:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2346
[2026-07-10T02:25:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2244
[2026-07-10T02:25:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2342
[2026-07-10T02:30:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2252
[2026-07-10T02:30:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2343
[2026-07-10T02:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-10T02:30:00] bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-10T02:30:00] bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-10T02:31:00] living_room_window_contact | BooleanState.StateValue = False
[2026-07-10T02:32:00] bedroom_window_contact | BooleanState.StateValue = False
[2026-07-10T02:34:00] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-10T02:35:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2337
[2026-07-10T02:35:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2238
[2026-07-10T02:35:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2337
[2026-07-10T02:40:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2347
[2026-07-10T02:40:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2257
[2026-07-10T02:40:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2340
[2026-07-10T02:45:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2356
[2026-07-10T02:45:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2262
[2026-07-10T02:45:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2351
[2026-07-10T02:50:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2361
[2026-07-10T02:50:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2247
[2026-07-10T02:50:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2353
[2026-07-10T02:55:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2365
[2026-07-10T02:55:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2368
[2026-07-10T03:00:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2352
[2026-07-10T03:00:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2266
[2026-07-10T03:00:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2352
[2026-07-10T03:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-10T03:00:00] bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-10T03:00:00] bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-10T03:05:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2367
[2026-07-10T03:05:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2265
[2026-07-10T03:05:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2371
[2026-07-10T03:10:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2372
[2026-07-10T03:10:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2276
[2026-07-10T03:10:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2366
[2026-07-10T03:15:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2370
[2026-07-10T03:15:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2271
[2026-07-10T03:15:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2378
[2026-07-10T03:20:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2376
[2026-07-10T03:20:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2277
[2026-07-10T03:20:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2365
[2026-07-10T03:25:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2379
[2026-07-10T03:30:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2378
[2026-07-10T03:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-10T03:35:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2382
[2026-07-10T03:40:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2380
[2026-07-10T03:45:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2386
[2026-07-10T03:50:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2398
[2026-07-10T03:55:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2393
[2026-07-10T04:00:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2403
[2026-07-10T04:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-10T04:05:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2404
[2026-07-10T04:10:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2415
[2026-07-10T08:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-10T16:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-10T19:15:14] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-10T20:40:06] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-10T22:05:06] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-10T23:30:06] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-10T23:50:06] living_room_occupancy | OccupancySensing.Occupancy = 1

## 任务
以下是过去一段时间的设备活动记录。请识别其中是否存在可疑行为模式，并解释你的判断。

请按以下 JSON 格式回答：

```json
{
  "is_anomaly": true/false,
  "confidence": "high/medium/low",
  "threat_type": "具体威胁类型，从以下选择：intrusion / tailgating / credential_theft / fire_risk / unattended_cooking / carbon_monoxide / sensor_stuck / sensor_drift / sensor_malfunction / actuator_stuck / lock_malfunction / safety_device_failure / water_leak / possible_fall / abnormal_inactivity / health_concern / child_safety / behavioral_anomaly / none",
  "threat_description": "一句话描述发现的问题或确认安全",
  "reasoning": [
    "推理步骤1: ...",
    "推理步骤2: ...",
    "推理步骤3: ..."
  ],
  "key_evidence": [
    "关键证据1",
    "关键证据2"
  ],
  "recommended_actions": [
    "建议措施1",
    "建议措施2"
  ]
}
```

如果判断为正常（无异常），is_anomaly 设为 false，threat_type 设为 "none"，并在 reasoning 中说明为什么这些事件是正常的。

{
  "is_anomaly": true,
  "confidence": "medium",
  "threat_type": "intrusion",
  "threat_description": "多个窗户传感器短时依次触发",
  "reasoning": [
    "推理步骤1: 短时间内两个不同房间窗户先后打开",
    "推理步骤2: 触发时间位于深夜",
    "推理步骤3: 随后出现室内运动"
  ],
  "key_evidence": [
    "短时间内两个不同房间窗户先后打开",
    "触发时间位于深夜",
    "随后出现室内运动"
  ],
  "recommended_actions": [
    "判定为扫描式入侵尝试，建议重点检查窗户和周边摄像头。"
  ]
}

```json
{
  "is_anomaly": true,
  "confidence": "high",
  "threat_type": "fire_risk",
  "threat_description": "凌晨时段（02:34-04:10）客厅温度异常急剧升高，且伴随窗户被打开但无人活动的情况，存在严重的火灾隐患。",
  "reasoning": [
    "推理步骤 1: 时间与环境分析。日志显示在 2026-07-10T02:34:00 至 04:10:00 期间，客厅温度从约 23.3°C (2337mK) 持续攀升至 24.15°C (2415mK)，升温速率极快（约 0.8°C/小时），远超正常环境波动范围。",
    "推理步骤 2:  occupancy 与状态矛盾。在温度急剧上升的整个过程中（02:34 - 04:10），客厅运动传感器（living_room_occupancy）多次报告为 0（无人），且卧室和卫生间也均为无人状态。这表明并非有人在家活动导致发热（如开暖气、做饭等）。",
    "推理步骤 3: 关键证据关联。在温度开始飙升前（02:31），客厅窗户传感器（living_room_window_contact）状态变为 False（打开）。结合“高温 + 无人 + 开窗”的模式，高度疑似外部热源（如火灾烟雾或热浪）通过开启的窗户侵入室内，或者室内有未察觉的隐蔽火源正在燃烧并产生热量。考虑到夏季（7 月）和快速升温，外部火情蔓延进屋的可能性极大。",
    "推理步骤 4: 排除误报。虽然厨房温度也有轻微上升，但幅度远小于客厅，且厨房无人员活动记录，因此主要风险集中在客厅区域。这种非人为控制的快速升温是典型的火灾前兆或早期火灾特征。"
  ],
  "key_evidence": [
    "2026-07-10T02:31:00 客厅窗户被打开 (StateValue = False)。",
    "2026-07-10T02:34:00 至 04:10:00 期间，客厅温度在 35 分钟内上升近 1°C (2337mK -> 2415mK)，而同期运动传感器持续报告无人 (Occupancy = 0)。",
    "同一时间段内，卧室和卫生间均无人员活动，排除了内部人为加热源的可能性。"
  ],
  "recommended_actions": [
    "立即触发全屋声光警报，通知住户家中可能存在火情。",
    "自动向住户手机发送最高级别紧急通知，包含实时温度曲线截图。",
    "建议住户若无法确认安全，切勿返回室内，应立即撤离并拨打消防电话。",
    "系统应尝试远程关闭客厅空调（如果检测到过热保护逻辑）以防止火势助燃，并准备联动烟感报警器进行二次确认。"
  ]
}
```


你是一个智能家居安全分析 AI 助手。你的职责是分析智能家居设备的状态日志，判断是否存在安全威胁或异常情况。

你需要基于以下能力进行分析：
1. 从设备状态变化中识别异常模式
2. 结合时间、住户习惯、设备类型进行推理
3. 区分真实威胁和正常行为（减少误报）
4. 对发现的问题给出具体的风险评估和建议

所有设备基于 Matter 协议标准，设备状态通过 Cluster.Attribute 的形式报告。

## 家庭环境信息
家庭布局: 两室一厅 (2BR)
- 重点房间 balcony: 阳台灯[onoff_light], 阳台门传感器[contact_sensor], 洗衣机[laundry_washer]
- 房间 bathroom: 卫生间灯[onoff_light], 卫生间运动传感器[occupancy_sensor], 卫生间漏水传感器[water_leak_detector]
- 房间 entrance: 入户门锁[door_lock], 入户门传感器[contact_sensor], 玄关灯[onoff_light], 玄关运动传感器[occupancy_sensor]
- 房间 kitchen: 厨房灯[onoff_light], 厨房灶具[cook_surface], 厨房烟雾报警器[smoke_co_alarm], 厨房温度传感器[temperature_sensor], 厨房窗户传感器[contact_sensor], 洗碗机[dishwasher]
- 房间 living_room: 客厅主灯[dimmable_light], 客厅落地灯[onoff_light], 客厅空调[air_conditioner], 客厅温度传感器[temperature_sensor], 客厅运动传感器[occupancy_sensor], 客厅窗帘[window_covering], 客厅窗户传感器[contact_sensor]
- 房间 master_bedroom: 主卧灯[dimmable_light], 主卧空调[air_conditioner], 主卧运动传感器[occupancy_sensor], 主卧窗帘[window_covering], 主卧窗户传感器[contact_sensor], 主卧温度传感器[temperature_sensor]
- 房间 second_bedroom: 次卧灯[dimmable_light], 次卧运动传感器[occupancy_sensor], 次卧窗帘[window_covering], 次卧窗户传感器[contact_sensor], 次卧温度传感器[temperature_sensor]

## 已选日志说明
以下日志不是整天原始全量心跳，而是围绕关键设备、关键时间窗和跨天模式筛出的训练片段。
- 任务类型: SQ3
- 重点房间: balcony
- 重点设备: balcony_door_contact, balcony_light, living_room_occupancy
- 已选事件数: 99

## 跨天活动摘要
- 2026-07-19: balcony=2, living_room=49, master_bedroom=48, second_bedroom=48, bathroom=48, entrance=48

## 设备事件日志
[2026-07-19T00:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-19T00:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-19T01:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-19T01:20:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2308
[2026-07-19T01:20:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2296
[2026-07-19T01:20:00] second_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2307
[2026-07-19T01:20:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2296
[2026-07-19T01:25:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2309
[2026-07-19T01:25:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2315
[2026-07-19T01:25:00] second_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2302
[2026-07-19T01:25:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2302
[2026-07-19T01:30:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2303
[2026-07-19T01:30:00] second_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2305
[2026-07-19T01:30:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2304
[2026-07-19T01:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-19T01:30:00] master_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-19T01:30:00] second_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-19T01:30:00] bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-19T01:30:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-07-19T01:35:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2312
[2026-07-19T01:35:00] second_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2311
[2026-07-19T01:40:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2320
[2026-07-19T01:40:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2321
[2026-07-19T01:40:00] second_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2313
[2026-07-19T01:40:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2307
[2026-07-19T01:45:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2319
[2026-07-19T01:45:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2310
[2026-07-19T01:45:00] second_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2310
[2026-07-19T01:45:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2322
[2026-07-19T01:50:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2313
[2026-07-19T01:50:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2319
[2026-07-19T01:50:00] second_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2318
[2026-07-19T01:50:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2318
[2026-07-19T01:55:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2315
[2026-07-19T01:55:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2328
[2026-07-19T01:55:00] second_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2327
[2026-07-19T01:55:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2321
[2026-07-19T02:00:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2335
[2026-07-19T02:00:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2320
[2026-07-19T02:00:00] second_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2328
[2026-07-19T02:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-19T02:00:00] master_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-19T02:00:00] second_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-19T02:00:00] bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-19T02:00:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-07-19T02:05:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2322
[2026-07-19T02:05:00] second_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2329
[2026-07-19T02:05:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2326
[2026-07-19T02:07:00] balcony_door_contact | BooleanState.StateValue = False
[2026-07-19T02:08:00] balcony_light | OnOff.OnOff = True
[2026-07-19T02:09:00] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-19T02:10:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2339
[2026-07-19T02:10:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2329
[2026-07-19T02:10:00] second_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2325
[2026-07-19T02:10:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2330
[2026-07-19T02:15:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2342
[2026-07-19T02:15:00] second_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2339
[2026-07-19T02:15:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2334
[2026-07-19T02:20:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2328
[2026-07-19T02:20:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2343
[2026-07-19T02:20:00] second_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2331
[2026-07-19T02:20:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2339
[2026-07-19T02:25:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2341
[2026-07-19T02:25:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2337
[2026-07-19T02:25:00] second_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2344
[2026-07-19T02:25:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2345
[2026-07-19T02:30:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2340
[2026-07-19T02:30:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2350
[2026-07-19T02:30:00] second_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2334
[2026-07-19T02:30:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2341
[2026-07-19T02:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-19T02:30:00] master_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-19T02:30:00] second_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-19T02:30:00] bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-19T02:30:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-07-19T02:35:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2349
[2026-07-19T02:35:00] second_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2340
[2026-07-19T02:35:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2353
[2026-07-19T02:40:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2346
[2026-07-19T02:40:00] second_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2351
[2026-07-19T02:40:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2347
[2026-07-19T02:45:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2353
[2026-07-19T02:45:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2356
[2026-07-19T02:45:00] second_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2348
[2026-07-19T02:45:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2357
[2026-07-19T02:50:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2351
[2026-07-19T02:50:00] second_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2358
[2026-07-19T02:50:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2354
[2026-07-19T02:55:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2357
[2026-07-19T02:55:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2355
[2026-07-19T02:55:00] second_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2366
[2026-07-19T02:55:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2368
[2026-07-19T03:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-19T03:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-19T07:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-19T11:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-19T15:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-19T19:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-19T23:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0

## 任务
请从下面的时序日志中分析住户或环境是否出现异常模式，不要只看单个事件。

请按以下 JSON 格式回答：

```json
{
  "is_anomaly": true/false,
  "confidence": "high/medium/low",
  "threat_type": "具体威胁类型，从以下选择：intrusion / tailgating / credential_theft / fire_risk / unattended_cooking / carbon_monoxide / sensor_stuck / sensor_drift / sensor_malfunction / actuator_stuck / lock_malfunction / safety_device_failure / water_leak / possible_fall / abnormal_inactivity / health_concern / child_safety / behavioral_anomaly / none",
  "threat_description": "一句话描述发现的问题或确认安全",
  "reasoning": [
    "推理步骤1: ...",
    "推理步骤2: ...",
    "推理步骤3: ..."
  ],
  "key_evidence": [
    "关键证据1",
    "关键证据2"
  ],
  "recommended_actions": [
    "建议措施1",
    "建议措施2"
  ]
}
```

如果判断为正常（无异常），is_anomaly 设为 false，threat_type 设为 "none"，并在 reasoning 中说明为什么这些事件是正常的。

{
  "is_anomaly": true,
  "confidence": "medium",
  "threat_type": "intrusion",
  "threat_description": "阳台门深夜打开且室内无对应活动",
  "reasoning": [
    "推理步骤1: 深夜阳台门突然打开",
    "推理步骤2: 阳台灯随即被点亮",
    "推理步骤3: 随后出现客厅活动"
  ],
  "key_evidence": [
    "深夜阳台门突然打开",
    "阳台灯随即被点亮",
    "随后出现客厅活动"
  ],
  "recommended_actions": [
    "判定为高风险边界入侵，建议立即检查阳台出入口。"
  ]
}

```json
{
  "is_anomaly": true,
  "confidence": "high",
  "threat_type": "sensor_drift",
  "threat_description": "检测到室内温度传感器读数严重偏离物理现实（显示为 2300+ 而非 23.x），且伴随异常的时间序列波动，表明传感器数据漂移或固件故障。",
  "reasoning": [
    "推理步骤 1: 分析日志中的温度数据，发现所有房间的温度传感器（living_room, master_bedroom, second_bedroom, kitchen）在 01:20 至 03:00 期间报告的值均在 2296 到 2368 之间。",
    "推理步骤 2: 结合常识判断，家庭环境温度通常在 -10°C 到 50°C 之间，Matter 协议中 TemperatureMeasurement.MeasuredValue 通常以 0.01°C 为单位，因此正常值应为 2300-2350 左右（即 23.00°C-23.50°C）。然而，日志中的数值变化幅度极大（例如从 2296 跳到 2368），且呈现无规律的锯齿状波动，这不符合空调运行或自然升温的物理规律。",
    "推理步骤 3: 虽然在此期间有人员活动（阳台门打开、客厅有人），但温度并未随人员进入而显著上升，反而出现剧烈震荡。这种‘数值溢出’或‘单位错误’导致的虚假高报/低报是典型的传感器漂移（Sensor Drift）或校准失效现象，可能导致误触发火灾报警或错误的 HVAC 控制逻辑。"
  ],
  "key_evidence": [
    "2026-07-19T02:55:00 厨房温度传感器报告值为 2368 (即 23.68°C)，但在前一分钟仅为 2354，随后又跳变，缺乏合理的物理热惯性解释。",
    "所有房间温度传感器在同一时间段内同步出现类似的非物理性数值跳动（如 2296 -> 2308 -> 2320...），排除了单一设备故障的可能性，指向系统级数据解析错误或批量传感器校准丢失。"
  ],
  "recommended_actions": [
    "立即检查所有温度传感器的硬件连接和供电状态，排除接触不良导致的信号噪声。",
    "在 Matter 控制器端重置相关设备的温度测量 Cluster 属性，重新进行校准流程。",
    "暂时禁用依赖这些温度数据的自动化场景（如高温自动开窗、低温自动开空调），防止因错误数据导致的安全隐患或能源浪费。",
    "联系设备制造商获取固件更新，确认是否存在已知的温度读取 Bug。"
  ]
}
```


你是一个智能家居安全分析 AI 助手。你的职责是分析智能家居设备的状态日志，判断是否存在安全威胁或异常情况。

你需要基于以下能力进行分析：
1. 从设备状态变化中识别异常模式
2. 结合时间、住户习惯、设备类型进行推理
3. 区分真实威胁和正常行为（减少误报）
4. 对发现的问题给出具体的风险评估和建议

所有设备基于 Matter 协议标准，设备状态通过 Cluster.Attribute 的形式报告。

## 家庭环境信息
家庭布局: 两室一厅 (2BR)
- 重点房间 balcony: 阳台灯[onoff_light], 阳台门传感器[contact_sensor], 洗衣机[laundry_washer]
- 房间 bathroom: 卫生间灯[onoff_light], 卫生间运动传感器[occupancy_sensor], 卫生间漏水传感器[water_leak_detector]
- 房间 entrance: 入户门锁[door_lock], 入户门传感器[contact_sensor], 玄关灯[onoff_light], 玄关运动传感器[occupancy_sensor]
- 房间 kitchen: 厨房灯[onoff_light], 厨房灶具[cook_surface], 厨房烟雾报警器[smoke_co_alarm], 厨房温度传感器[temperature_sensor], 厨房窗户传感器[contact_sensor], 洗碗机[dishwasher]
- 房间 living_room: 客厅主灯[dimmable_light], 客厅落地灯[onoff_light], 客厅空调[air_conditioner], 客厅温度传感器[temperature_sensor], 客厅运动传感器[occupancy_sensor], 客厅窗帘[window_covering], 客厅窗户传感器[contact_sensor]
- 房间 master_bedroom: 主卧灯[dimmable_light], 主卧空调[air_conditioner], 主卧运动传感器[occupancy_sensor], 主卧窗帘[window_covering], 主卧窗户传感器[contact_sensor], 主卧温度传感器[temperature_sensor]
- 房间 second_bedroom: 次卧灯[dimmable_light], 次卧运动传感器[occupancy_sensor], 次卧窗帘[window_covering], 次卧窗户传感器[contact_sensor], 次卧温度传感器[temperature_sensor]

## 已选日志说明
以下日志不是整天原始全量心跳，而是围绕关键设备、关键时间窗和跨天模式筛出的训练片段。
- 任务类型: SQ3
- 重点房间: balcony
- 重点设备: balcony_door_contact, balcony_light, living_room_occupancy
- 已选事件数: 101

## 跨天活动摘要
- 2026-07-04: balcony=2, living_room=193, bathroom=53, entrance=51, master_bedroom=48, second_bedroom=48

## 设备事件日志
[2026-07-04T00:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-04T00:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-04T01:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-04T01:20:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2300
[2026-07-04T01:20:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2310
[2026-07-04T01:20:00] second_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2313
[2026-07-04T01:20:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2304
[2026-07-04T01:25:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2313
[2026-07-04T01:25:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2312
[2026-07-04T01:25:00] second_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2310
[2026-07-04T01:25:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2298
[2026-07-04T01:30:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2299
[2026-07-04T01:30:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2313
[2026-07-04T01:30:00] second_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2312
[2026-07-04T01:30:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2315
[2026-07-04T01:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-04T01:30:00] master_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-04T01:30:00] second_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-04T01:30:00] bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-04T01:30:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-07-04T01:35:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2302
[2026-07-04T01:35:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2317
[2026-07-04T01:35:00] second_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2309
[2026-07-04T01:35:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2320
[2026-07-04T01:40:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2322
[2026-07-04T01:40:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2309
[2026-07-04T01:40:00] second_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2323
[2026-07-04T01:40:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2321
[2026-07-04T01:45:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2326
[2026-07-04T01:45:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2323
[2026-07-04T01:45:00] second_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2327
[2026-07-04T01:45:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2322
[2026-07-04T01:50:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2328
[2026-07-04T01:50:00] second_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2330
[2026-07-04T01:50:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2328
[2026-07-04T01:55:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2333
[2026-07-04T01:55:00] second_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2321
[2026-07-04T02:00:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2318
[2026-07-04T02:00:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2327
[2026-07-04T02:00:00] second_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2329
[2026-07-04T02:00:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2335
[2026-07-04T02:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-04T02:00:00] master_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-04T02:00:00] second_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-04T02:00:00] bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-04T02:00:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-07-04T02:05:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2324
[2026-07-04T02:05:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2319
[2026-07-04T02:05:00] second_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2326
[2026-07-04T02:05:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2325
[2026-07-04T02:07:00] balcony_door_contact | BooleanState.StateValue = False
[2026-07-04T02:08:00] balcony_light | OnOff.OnOff = True
[2026-07-04T02:09:00] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-04T02:10:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2334
[2026-07-04T02:10:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2337
[2026-07-04T02:10:00] second_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2328
[2026-07-04T02:15:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2337
[2026-07-04T02:15:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2325
[2026-07-04T02:15:00] second_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2341
[2026-07-04T02:15:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2339
[2026-07-04T02:20:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2335
[2026-07-04T02:20:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2339
[2026-07-04T02:20:00] second_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2339
[2026-07-04T02:20:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2346
[2026-07-04T02:25:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2346
[2026-07-04T02:25:00] second_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2332
[2026-07-04T02:25:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2333
[2026-07-04T02:30:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2349
[2026-07-04T02:30:00] second_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2336
[2026-07-04T02:30:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2343
[2026-07-04T02:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-04T02:30:00] master_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-04T02:30:00] second_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-04T02:30:00] bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-04T02:30:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-07-04T02:35:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2356
[2026-07-04T02:35:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2340
[2026-07-04T02:35:00] second_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2354
[2026-07-04T02:35:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2342
[2026-07-04T02:40:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2346
[2026-07-04T02:40:00] second_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2346
[2026-07-04T02:40:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2354
[2026-07-04T02:45:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2360
[2026-07-04T02:45:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2353
[2026-07-04T02:45:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2350
[2026-07-04T02:50:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2348
[2026-07-04T02:50:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2362
[2026-07-04T02:50:00] second_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2363
[2026-07-04T02:50:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2346
[2026-07-04T02:55:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2366
[2026-07-04T02:55:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2361
[2026-07-04T02:55:00] second_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2359
[2026-07-04T02:55:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2363
[2026-07-04T03:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-04T03:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-04T10:59:00] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-04T13:34:00] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-04T16:09:00] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-04T18:44:00] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-04T21:19:00] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-04T23:54:00] living_room_occupancy | OccupancySensing.Occupancy = 1

## 任务
请从下面的时序日志中分析住户或环境是否出现异常模式，不要只看单个事件。

请按以下 JSON 格式回答：

```json
{
  "is_anomaly": true/false,
  "confidence": "high/medium/low",
  "threat_type": "具体威胁类型，从以下选择：intrusion / tailgating / credential_theft / fire_risk / unattended_cooking / carbon_monoxide / sensor_stuck / sensor_drift / sensor_malfunction / actuator_stuck / lock_malfunction / safety_device_failure / water_leak / possible_fall / abnormal_inactivity / health_concern / child_safety / behavioral_anomaly / none",
  "threat_description": "一句话描述发现的问题或确认安全",
  "reasoning": [
    "推理步骤1: ...",
    "推理步骤2: ...",
    "推理步骤3: ..."
  ],
  "key_evidence": [
    "关键证据1",
    "关键证据2"
  ],
  "recommended_actions": [
    "建议措施1",
    "建议措施2"
  ]
}
```

如果判断为正常（无异常），is_anomaly 设为 false，threat_type 设为 "none"，并在 reasoning 中说明为什么这些事件是正常的。

{
  "is_anomaly": true,
  "confidence": "medium",
  "threat_type": "intrusion",
  "threat_description": "阳台门深夜打开且室内无对应活动",
  "reasoning": [
    "推理步骤1: 深夜阳台门突然打开",
    "推理步骤2: 阳台灯随即被点亮",
    "推理步骤3: 随后出现客厅活动"
  ],
  "key_evidence": [
    "深夜阳台门突然打开",
    "阳台灯随即被点亮",
    "随后出现客厅活动"
  ],
  "recommended_actions": [
    "判定为高风险边界入侵，建议立即检查阳台出入口。"
  ]
}

{
  "is_anomaly": true,
  "confidence": "high",
  "threat_type": "intrusion",
  "threat_description": "阳台门深夜打开且室内无对应活动",
  "reasoning": [
    "推理步骤1: 日志中出现了不存在的额外报警事件。"
  ],
  "key_evidence": [
    "我假设看到了一个未在日志中出现的 critical 告警。"
  ],
  "recommended_actions": [
    "判定为高风险边界入侵，建议立即检查阳台出入口。"
  ]
}


你是一个智能家居安全分析 AI 助手。你的职责是分析智能家居设备的状态日志，判断是否存在安全威胁或异常情况。

你需要基于以下能力进行分析：
1. 从设备状态变化中识别异常模式
2. 结合时间、住户习惯、设备类型进行推理
3. 区分真实威胁和正常行为（减少误报）
4. 对发现的问题给出具体的风险评估和建议

所有设备基于 Matter 协议标准，设备状态通过 Cluster.Attribute 的形式报告。

## 家庭环境信息
家庭布局: 三室两厅 (3BR)
- 重点房间 entrance: 入户门锁[door_lock], 入户门传感器[contact_sensor], 玄关灯[onoff_light], 玄关运动传感器[occupancy_sensor]
- 房间 balcony: 阳台灯[onoff_light], 阳台门传感器[contact_sensor], 洗衣机[laundry_washer]
- 房间 dining_room: 餐厅灯[dimmable_light], 餐厅运动传感器[occupancy_sensor]
- 房间 kids_room: 儿童房灯[dimmable_light], 儿童房运动传感器[occupancy_sensor], 儿童房窗帘[window_covering], 儿童房窗户传感器[contact_sensor], 儿童房温度传感器[temperature_sensor]
- 房间 kitchen: 厨房灯[onoff_light], 厨房灶具[cook_surface], 厨房烟雾报警器[smoke_co_alarm], 厨房温度传感器[temperature_sensor], 厨房窗户传感器[contact_sensor], 洗碗机[dishwasher], 厨房漏水传感器[water_leak_detector]
- 房间 living_room: 客厅主灯[dimmable_light], 客厅副灯[dimmable_light], 客厅氛围灯[onoff_light], 客厅空调[air_conditioner], 客厅温度传感器[temperature_sensor], 客厅运动传感器[occupancy_sensor], 客厅窗帘1[window_covering], 客厅窗户传感器1[contact_sensor], ... 共10个设备
- 房间 master_bathroom: 主卫灯[onoff_light], 主卫运动传感器[occupancy_sensor], 主卫漏水传感器[water_leak_detector]
- 房间 master_bedroom: 主卧灯[dimmable_light], 主卧床头灯[onoff_light], 主卧空调[air_conditioner], 主卧运动传感器[occupancy_sensor], 主卧窗帘[window_covering], 主卧窗户传感器[contact_sensor], 主卧温度传感器[temperature_sensor]
- 房间 second_bathroom: 次卫灯[onoff_light], 次卫漏水传感器[water_leak_detector]
- 房间 second_bedroom: 次卧灯[dimmable_light], 次卧空调[air_conditioner], 次卧运动传感器[occupancy_sensor], 次卧窗帘[window_covering], 次卧窗户传感器[contact_sensor]

## 已选日志说明
以下日志不是整天原始全量心跳，而是围绕关键设备、关键时间窗和跨天模式筛出的训练片段。
- 任务类型: SQ2
- 重点房间: entrance
- 重点设备: entrance_light, front_door_contact, front_door_lock, living_room_occupancy
- 已选事件数: 24

## 设备事件日志
[2026-07-13T00:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-13T01:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-13T01:30:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-07-13T02:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-13T02:00:00] dining_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-13T02:00:00] master_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-13T02:00:00] second_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-13T02:00:00] kids_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-13T02:00:00] master_bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-13T02:00:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-07-13T02:11:00] front_door_lock | DoorLock.LockState = 2
[2026-07-13T02:11:00] front_door_contact | BooleanState.StateValue = False
[2026-07-13T02:12:00] entrance_light | OnOff.OnOff = True
[2026-07-13T02:13:00] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-13T02:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-13T02:30:00] dining_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-13T02:30:00] master_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-13T02:30:00] second_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-13T02:30:00] kids_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-13T02:30:00] master_bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-13T02:30:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-07-13T03:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-13T03:00:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-07-13T07:41:18] front_door_lock | Event: LockOperation(LockOperationType=1, OperationSource=Manual)

## 任务
请分析下面的实时设备事件，判断是否需要将其视为异常安全事件。

请按以下 JSON 格式回答：

```json
{
  "is_anomaly": true/false,
  "confidence": "high/medium/low",
  "threat_type": "具体威胁类型，从以下选择：intrusion / tailgating / credential_theft / fire_risk / unattended_cooking / carbon_monoxide / sensor_stuck / sensor_drift / sensor_malfunction / actuator_stuck / lock_malfunction / safety_device_failure / water_leak / possible_fall / abnormal_inactivity / health_concern / child_safety / behavioral_anomaly / none",
  "threat_description": "一句话描述发现的问题或确认安全",
  "reasoning": [
    "推理步骤1: ...",
    "推理步骤2: ...",
    "推理步骤3: ..."
  ],
  "key_evidence": [
    "关键证据1",
    "关键证据2"
  ],
  "recommended_actions": [
    "建议措施1",
    "建议措施2"
  ]
}
```

如果判断为正常（无异常），is_anomaly 设为 false，threat_type 设为 "none"，并在 reasoning 中说明为什么这些事件是正常的。

{
  "is_anomaly": true,
  "confidence": "medium",
  "threat_type": "credential_theft",
  "threat_description": "临时访客码在非预约时段使用",
  "reasoning": [
    "推理步骤1: 凌晨 02:11 门锁解锁并开门",
    "推理步骤2: 玄关灯随后开启",
    "推理步骤3: 紧接着出现室内活动，不像误触"
  ],
  "key_evidence": [
    "凌晨 02:11 门锁解锁并开门",
    "玄关灯随后开启",
    "紧接着出现室内活动，不像误触"
  ],
  "recommended_actions": [
    "标记为异常入户，建议检查临时访客码使用记录并立即重置。"
  ]
}

```json
{
  "is_anomaly": false,
  "confidence": "high",
  "threat_type": "none",
  "threat_description": "日志显示正常的夜间离家模式及次日早晨手动上锁行为，未发现安全威胁。",
  "reasoning": [
    "推理步骤 1: 凌晨 02:11 分检测到入户门锁状态变为'2'（通常代表解锁或开启），同时门接触传感器状态为 False（门打开）。这是典型的住户开门离家的行为特征。",
    "推理步骤 2: 紧随其后在 02:12 分玄关灯自动亮起，符合‘开门亮灯’的自动化场景逻辑，且随后客厅运动传感器在 02:13 分检测到有人（可能是住户经过客厅），进一步证实了有人活动的真实性，排除了传感器故障或误报。",
    "推理步骤 3: 住户在 02:30 分离开客厅区域后，所有房间（包括客厅、餐厅、卧室等）的运动传感器均报告无人状态，表明住户已完全离开家中并处于正常睡眠或休息状态。",
    "推理步骤 4: 次日早上 07:41 分记录到一次手动锁门操作（LockOperationType=1, OperationSource=Manual），这是住户出门前的正常安全习惯，确认了门锁功能正常且被正确使用。"
  ],
  "key_evidence": [
    "02:11 门锁开启与门接触传感器触发时间紧密相连，符合物理开门逻辑。",
    "02:12 玄关灯自动开启响应了开门事件，验证了设备联动正常。",
    "02:30 全房运动传感器转为无人状态，确认了住户已彻底离场。",
    "07:41 存在明确的手动上锁记录，证明住户具备安全意识且门锁机制有效。"
  ],
  "recommended_actions": [
    "无需采取紧急措施，当前系统运行正常。",
    "建议继续保持对夜间离家模式和晨间上锁行为的监控，作为基准线数据。"
  ]
}
```


你是一个智能家居安全分析 AI 助手。你的职责是分析智能家居设备的状态日志，判断是否存在安全威胁或异常情况。

你需要基于以下能力进行分析：
1. 从设备状态变化中识别异常模式
2. 结合时间、住户习惯、设备类型进行推理
3. 区分真实威胁和正常行为（减少误报）
4. 对发现的问题给出具体的风险评估和建议

所有设备基于 Matter 协议标准，设备状态通过 Cluster.Attribute 的形式报告。

## 家庭环境信息
家庭布局: 两室一厅 (2BR)
- 重点房间 entrance: 入户门锁[door_lock], 入户门传感器[contact_sensor], 玄关灯[onoff_light], 玄关运动传感器[occupancy_sensor]
- 房间 balcony: 阳台灯[onoff_light], 阳台门传感器[contact_sensor], 洗衣机[laundry_washer]
- 房间 bathroom: 卫生间灯[onoff_light], 卫生间运动传感器[occupancy_sensor], 卫生间漏水传感器[water_leak_detector]
- 房间 kitchen: 厨房灯[onoff_light], 厨房灶具[cook_surface], 厨房烟雾报警器[smoke_co_alarm], 厨房温度传感器[temperature_sensor], 厨房窗户传感器[contact_sensor], 洗碗机[dishwasher]
- 房间 living_room: 客厅主灯[dimmable_light], 客厅落地灯[onoff_light], 客厅空调[air_conditioner], 客厅温度传感器[temperature_sensor], 客厅运动传感器[occupancy_sensor], 客厅窗帘[window_covering], 客厅窗户传感器[contact_sensor]
- 房间 master_bedroom: 主卧灯[dimmable_light], 主卧空调[air_conditioner], 主卧运动传感器[occupancy_sensor], 主卧窗帘[window_covering], 主卧窗户传感器[contact_sensor], 主卧温度传感器[temperature_sensor]
- 房间 second_bedroom: 次卧灯[dimmable_light], 次卧运动传感器[occupancy_sensor], 次卧窗帘[window_covering], 次卧窗户传感器[contact_sensor], 次卧温度传感器[temperature_sensor]

## 已选日志说明
以下日志不是整天原始全量心跳，而是围绕关键设备、关键时间窗和跨天模式筛出的训练片段。
- 任务类型: SQ2
- 重点房间: entrance
- 重点设备: front_door_lock, living_room_light_1
- 已选事件数: 20

## 设备事件日志
[2026-08-08T03:00:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-08-08T03:30:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-08-08T04:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-08T04:00:00] master_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-08T04:00:00] second_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-08T04:00:00] bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-08T04:00:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-08-08T04:06:00] front_door_lock | DoorLock.LockState = 2
[2026-08-08T04:07:00] front_door_lock | DoorLock.LockState = 1
[2026-08-08T04:09:00] living_room_light_1 | OnOff.OnOff = True
[2026-08-08T04:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-08T04:30:00] master_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-08T04:30:00] second_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-08T04:30:00] bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-08T04:30:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-08-08T05:00:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-08-08T10:14:04] living_room_light_1 | OnOff.OnOff = True
[2026-08-08T23:12:00] living_room_light_1 | OnOff.OnOff = False
[2026-08-08T23:12:35] front_door_lock | Event: LockOperation(LockOperationType=0, OperationSource=Manual)
[2026-08-08T23:12:35] front_door_lock | DoorLock.LockState = 1

## 任务
请分析下面的实时设备事件，判断是否需要将其视为异常安全事件。

请按以下 JSON 格式回答：

```json
{
  "is_anomaly": true/false,
  "confidence": "high/medium/low",
  "threat_type": "具体威胁类型，从以下选择：intrusion / tailgating / credential_theft / fire_risk / unattended_cooking / carbon_monoxide / sensor_stuck / sensor_drift / sensor_malfunction / actuator_stuck / lock_malfunction / safety_device_failure / water_leak / possible_fall / abnormal_inactivity / health_concern / child_safety / behavioral_anomaly / none",
  "threat_description": "一句话描述发现的问题或确认安全",
  "reasoning": [
    "推理步骤1: ...",
    "推理步骤2: ...",
    "推理步骤3: ..."
  ],
  "key_evidence": [
    "关键证据1",
    "关键证据2"
  ],
  "recommended_actions": [
    "建议措施1",
    "建议措施2"
  ]
}
```

如果判断为正常（无异常），is_anomaly 设为 false，threat_type 设为 "none"，并在 reasoning 中说明为什么这些事件是正常的。

{
  "is_anomaly": true,
  "confidence": "medium",
  "threat_type": "intrusion",
  "threat_description": "门锁状态变化但没有对应开门链路",
  "reasoning": [
    "推理步骤1: 门锁状态先解锁再回锁",
    "推理步骤2: 缺乏门磁开关记录",
    "推理步骤3: 却伴随室内灯光变化"
  ],
  "key_evidence": [
    "门锁状态先解锁再回锁",
    "缺乏门磁开关记录",
    "却伴随室内灯光变化"
  ],
  "recommended_actions": [
    "判为异常门锁状态切换，建议核查锁日志与物理门状态。"
  ]
}

```json
{
  "is_anomaly": false,
  "confidence": "high",
  "threat_type": "none",
  "threat_description": "日志显示的是正常的夜间离家模式及次日清晨的入户开门行为，未发现安全威胁。",
  "reasoning": [
    "推理步骤 1: 凌晨 03:00 至 04:00 期间，所有房间（包括玄关、客厅、卧室、卫生间）的运动传感器均报告 Occupancy = 0，且玄关灯未开启，符合家庭夜间无人活动的正常状态。",
    "推理步骤 2: 04:06 门锁状态变为 2（解锁），随后在 04:07 变为 1（锁定）。考虑到此时为凌晨 4 点，住户可能是在进行夜间如厕或短暂外出后返回并重新锁门，或者这是系统自动/手动的一次性操作，但紧接着 04:09 客厅灯被打开，表明有人进入室内活动，这解释了门锁先开后关再开灯的逻辑连贯性（例如：进门 -> 关门 -> 开灯，或者开门查看 -> 关门 -> 再次开门进屋开灯）。更合理的解释是：住户在凌晨 4 点左右起床，打开门锁进入，然后关闭门锁（可能是误触或习惯），随即打开客厅灯开始活动。",
    "推理步骤 3: 白天时段（10:14）客厅灯再次开启，晚上 23:12 关灯，23:12:35 执行手动锁门操作。这一系列事件完全符合典型的‘回家 - 休息 - 睡觉’的生活作息规律，时间点和设备联动逻辑正常，无入侵、尾随或设备故障迹象。",
    "推理步骤 4: 关键证据中，门锁操作源明确标记为 'Manual'（手动），且前后有明确的 occupancy 变化支持人员在场，排除了自动化攻击或传感器卡死的可能性。"
  ],
  "key_evidence": [
    "04:06-04:07 门锁状态变化紧随其后 04:09 客厅灯开启，符合人员进出逻辑。",
    "23:12:35 门锁操作源为 Manual，且发生在关灯之后，符合睡前锁门习惯。",
    "全时段各房间 occupancy 数据与灯光状态一致，无矛盾冲突。"
  ],
  "recommended_actions": [
    "无需采取紧急措施，当前系统运行正常。",
    "建议用户确认 04:07 门锁自动/手动锁定的具体原因，若为意外触发可调整智能场景设置以避免频繁开关。"
  ]
}
```


你是一个智能家居安全分析 AI 助手。你的职责是分析智能家居设备的状态日志，判断是否存在安全威胁或异常情况。

你需要基于以下能力进行分析：
1. 从设备状态变化中识别异常模式
2. 结合时间、住户习惯、设备类型进行推理
3. 区分真实威胁和正常行为（减少误报）
4. 对发现的问题给出具体的风险评估和建议

所有设备基于 Matter 协议标准，设备状态通过 Cluster.Attribute 的形式报告。

## 家庭环境信息
家庭布局: 独居老人 (Elderly Living Alone)
- 重点房间 living_room: 客厅灯[dimmable_light], 客厅空调[air_conditioner], 客厅温度传感器[temperature_sensor], 客厅运动传感器[occupancy_sensor], 客厅窗帘[window_covering], 客厅窗户传感器[contact_sensor], 客厅烟雾报警器[smoke_co_alarm]
- 房间 bathroom: 卫生间灯[onoff_light], 卫生间运动传感器[occupancy_sensor], 卫生间漏水传感器[water_leak_detector]
- 房间 bedroom: 卧室灯[dimmable_light], 床头灯[onoff_light], 卧室运动传感器[occupancy_sensor], 卧室窗帘[window_covering], 卧室窗户传感器[contact_sensor], 卧室温度传感器[temperature_sensor]
- 房间 entrance: 入户门锁[door_lock], 入户门传感器[contact_sensor], 玄关灯[onoff_light], 玄关运动传感器[occupancy_sensor]
- 房间 kitchen: 厨房灯[onoff_light], 厨房灶具[cook_surface], 厨房烟雾报警器[smoke_co_alarm], 厨房温度传感器[temperature_sensor], 厨房运动传感器[occupancy_sensor], 厨房漏水传感器[water_leak_detector]

## 已选日志说明
以下日志不是整天原始全量心跳，而是围绕关键设备、关键时间窗和跨天模式筛出的训练片段。
- 任务类型: SQ3
- 重点房间: living_room
- 重点设备: bedroom_window_contact, living_room_occupancy, living_room_window_contact
- 已选事件数: 99

## 跨天活动摘要
- 2026-08-14: living_room=211, bedroom=243, kitchen=239, entrance=229, bathroom=62

## 设备事件日志
[2026-08-14T00:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-14T00:55:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2293
[2026-08-14T01:00:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2298
[2026-08-14T01:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-14T01:05:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2290
[2026-08-14T01:10:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2305
[2026-08-14T01:20:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2307
[2026-08-14T01:25:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2314
[2026-08-14T01:30:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2319
[2026-08-14T01:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-14T01:35:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2320
[2026-08-14T01:40:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2323
[2026-08-14T01:45:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2218
[2026-08-14T01:45:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2312
[2026-08-14T01:50:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2316
[2026-08-14T01:50:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2221
[2026-08-14T01:50:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2310
[2026-08-14T01:55:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2324
[2026-08-14T01:55:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2226
[2026-08-14T01:55:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2331
[2026-08-14T02:00:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2331
[2026-08-14T02:00:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2233
[2026-08-14T02:00:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2321
[2026-08-14T02:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-14T02:00:00] bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-14T02:00:00] kitchen_occupancy | OccupancySensing.Occupancy = 0
[2026-08-14T02:00:00] bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-14T02:00:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-08-14T02:05:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2338
[2026-08-14T02:05:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2232
[2026-08-14T02:10:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2227
[2026-08-14T02:10:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2332
[2026-08-14T02:15:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2344
[2026-08-14T02:15:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2240
[2026-08-14T02:15:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2334
[2026-08-14T02:20:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2342
[2026-08-14T02:20:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2238
[2026-08-14T02:20:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2330
[2026-08-14T02:25:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2334
[2026-08-14T02:25:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2243
[2026-08-14T02:25:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2348
[2026-08-14T02:30:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2348
[2026-08-14T02:30:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2239
[2026-08-14T02:30:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2343
[2026-08-14T02:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-14T02:30:00] bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-14T02:30:00] kitchen_occupancy | OccupancySensing.Occupancy = 0
[2026-08-14T02:30:00] bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-14T02:30:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-08-14T02:31:00] living_room_window_contact | BooleanState.StateValue = False
[2026-08-14T02:32:00] bedroom_window_contact | BooleanState.StateValue = False
[2026-08-14T02:34:00] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-08-14T02:35:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2338
[2026-08-14T02:35:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2347
[2026-08-14T02:40:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2346
[2026-08-14T02:40:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2259
[2026-08-14T02:40:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2345
[2026-08-14T02:45:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2347
[2026-08-14T02:45:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2260
[2026-08-14T02:45:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2349
[2026-08-14T02:50:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2350
[2026-08-14T02:50:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2353
[2026-08-14T02:55:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2364
[2026-08-14T02:55:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2264
[2026-08-14T02:55:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2366
[2026-08-14T03:00:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2368
[2026-08-14T03:00:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2258
[2026-08-14T03:00:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2358
[2026-08-14T03:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-14T03:00:00] bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-14T03:00:00] kitchen_occupancy | OccupancySensing.Occupancy = 0
[2026-08-14T03:00:00] bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-14T03:00:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-08-14T03:05:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2355
[2026-08-14T03:05:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2274
[2026-08-14T03:05:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2357
[2026-08-14T03:10:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2377
[2026-08-14T03:10:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2262
[2026-08-14T03:10:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2375
[2026-08-14T03:15:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2379
[2026-08-14T03:15:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2280
[2026-08-14T03:15:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2363
[2026-08-14T03:20:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2374
[2026-08-14T03:20:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2377
[2026-08-14T03:30:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2382
[2026-08-14T03:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-14T03:35:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2390
[2026-08-14T03:40:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2391
[2026-08-14T03:50:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2398
[2026-08-14T04:00:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2396
[2026-08-14T04:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-14T04:05:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2408
[2026-08-14T04:10:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2410
[2026-08-14T09:46:07] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-08-14T12:36:07] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-08-14T15:21:12] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-08-14T18:11:12] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-08-14T21:01:00] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-08-14T23:51:00] living_room_occupancy | OccupancySensing.Occupancy = 1

## 任务
请从下面的时序日志中分析住户或环境是否出现异常模式，不要只看单个事件。

请按以下 JSON 格式回答：

```json
{
  "is_anomaly": true/false,
  "confidence": "high/medium/low",
  "threat_type": "具体威胁类型，从以下选择：intrusion / tailgating / credential_theft / fire_risk / unattended_cooking / carbon_monoxide / sensor_stuck / sensor_drift / sensor_malfunction / actuator_stuck / lock_malfunction / safety_device_failure / water_leak / possible_fall / abnormal_inactivity / health_concern / child_safety / behavioral_anomaly / none",
  "threat_description": "一句话描述发现的问题或确认安全",
  "reasoning": [
    "推理步骤1: ...",
    "推理步骤2: ...",
    "推理步骤3: ..."
  ],
  "key_evidence": [
    "关键证据1",
    "关键证据2"
  ],
  "recommended_actions": [
    "建议措施1",
    "建议措施2"
  ]
}
```

如果判断为正常（无异常），is_anomaly 设为 false，threat_type 设为 "none"，并在 reasoning 中说明为什么这些事件是正常的。

{
  "is_anomaly": true,
  "confidence": "medium",
  "threat_type": "intrusion",
  "threat_description": "多个窗户传感器短时依次触发",
  "reasoning": [
    "推理步骤1: 短时间内两个不同房间窗户先后打开",
    "推理步骤2: 触发时间位于深夜",
    "推理步骤3: 随后出现室内运动"
  ],
  "key_evidence": [
    "短时间内两个不同房间窗户先后打开",
    "触发时间位于深夜",
    "随后出现室内运动"
  ],
  "recommended_actions": [
    "判定为扫描式入侵尝试，建议重点检查窗户和周边摄像头。"
  ]
}

```json
{
  "is_anomaly": true,
  "confidence": "high",
  "threat_type": "fire_risk",
  "threat_description": "凌晨时段检测到窗户被非法开启，随后室内温度持续异常升高且无人活动，存在极高的火灾或入侵后纵火风险。",
  "reasoning": [
    "推理步骤 1: 在凌晨 02:31 和 02:32，客厅 (living_room) 和卧室 (bedroom) 的窗户接触传感器状态变为 False（打开），此时所有房间的运动传感器均报告无人员活动 (Occupancy=0)，表明这是在住户熟睡时发生的非正常开窗行为。",
    "推理步骤 2: 从 02:34 开始，虽然运动传感器短暂检测到一次活动（可能是闯入者或宠物），但随后在 03:00、03:30、04:00 等多次时间点，全屋运动传感器再次全部归零，确认屋内已恢复无人状态。",
    "推理步骤 3: 最关键的异常在于温度数据：在无人活动的情况下，客厅温度从 02:35 的约 23.4°C 持续攀升至 04:10 的约 24.1°C（日志值 2410，单位应为 0.1°C）。对于独居老人家庭，夜间室温通常应下降或保持稳定，这种在无热源（空调/暖气未开启迹象）情况下的持续升温极有可能是外部热源（如入侵者使用明火、加热设备）导致的，符合火灾前兆特征。",
    "推理步骤 4: 结合独居老人的背景，夜间窗户被打开且伴随不明原因的室温上升，属于高危的安全威胁模式，不能简单视为环境波动。"
  ],
  "key_evidence": [
    "02:31-02:32 窗户传感器触发开启事件，而此时全屋 occupancy 为 0。",
    "02:34 之后出现短暂的 occupancy=1，但在 03:00 及后续多次检查中 occupancy 再次变为 0，显示屋内已空。",
    "在无人居住期间 (02:35 - 04:10)，客厅温度呈现单调递增趋势 (2338 -> 2410)，与正常夜间散热规律相反。"
  ],
  "recommended_actions": [
    "立即远程通知家属或紧急联系人，告知可能存在入侵或火灾隐患。",
    "若系统支持联动，尝试自动拨打当地消防部门或报警电话（需人工确认或预设紧急协议）。",
    "建议安保人员在白天尽快上门检查门窗锁具状态及室内是否有烟熏痕迹或异味。",
    "检查并重置相关传感器，排查是否存在传感器故障导致误报的可能性（尽管概率较低，因温度趋势明显）。"
  ]
}
```