你是一个智能家居安全分析 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
- 已选事件数: 136

## 跨天活动摘要
- 2026-07-14: living_room=115, bedroom=69, bathroom=56, entrance=14, kitchen=8
- 2026-07-15: living_room=109, bedroom=69, bathroom=52, entrance=14, kitchen=8
- 2026-07-16: living_room=110, bedroom=217, bathroom=58, entrance=14, kitchen=9

## 设备事件日志
[2026-07-14T00:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-14T01:40:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2307
[2026-07-14T01:50:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2311
[2026-07-14T02:00:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2332
[2026-07-14T02:05:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2325
[2026-07-14T02:25:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2334
[2026-07-14T02:25:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2344
[2026-07-14T02:30:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2250
[2026-07-14T02:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-14T02:30:00] bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-14T02:35:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2254
[2026-07-14T02:40:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2358
[2026-07-14T02:40:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2347
[2026-07-14T02:45:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2243
[2026-07-14T02:50:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2359
[2026-07-14T02:50:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2362
[2026-07-14T02:55:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2267
[2026-07-14T03:00:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2353
[2026-07-14T03:00:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2354
[2026-07-14T03:00:00] bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-14T03:05:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2367
[2026-07-14T03:05:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2364
[2026-07-14T03:10:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2275
[2026-07-14T03:14:00] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-14T03:15:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2374
[2026-07-14T03:15:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2381
[2026-07-14T03:20:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2280
[2026-07-14T03:25:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2383
[2026-07-14T03:25:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2368
[2026-07-14T03:30:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2278
[2026-07-14T03:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-14T03:30:00] bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-14T03:35:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2293
[2026-07-14T03:40:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2381
[2026-07-14T03:45:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2298
[2026-07-14T03:50:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2389
[2026-07-14T03:50:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2396
[2026-07-14T03:55:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2301
[2026-07-14T04:00:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2398
[2026-07-14T04:00:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2402
[2026-07-14T04:00:00] bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-14T04:05:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2408
[2026-07-14T04:15:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2417
[2026-07-14T04:25:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2426
[2026-07-14T04:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-14T04:40:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2429
[2026-07-14T04:50:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2436
[2026-07-14T07:17:00] kitchen_light | OnOff.OnOff = False
[2026-07-14T19:15:21] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-15T01:35:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2305
[2026-07-15T01:45:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2308
[2026-07-15T01:55:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2320
[2026-07-15T02:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-15T02:10:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2334
[2026-07-15T02:20:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2339
[2026-07-15T02:25:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2240
[2026-07-15T02:30:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2352
[2026-07-15T02:30:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2350
[2026-07-15T02:30:00] bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-15T02:35:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2353
[2026-07-15T02:35:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2348
[2026-07-15T02:40:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2254
[2026-07-15T02:45:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2349
[2026-07-15T02:45:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2347
[2026-07-15T02:50:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2247
[2026-07-15T02:55:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2350
[2026-07-15T02:55:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2353
[2026-07-15T03:00:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2264
[2026-07-15T03:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-15T03:00:00] bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-15T03:05:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2268
[2026-07-15T03:10:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2370
[2026-07-15T03:10:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2365
[2026-07-15T03:14:00] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-15T03:15:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2263
[2026-07-15T03:20:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2365
[2026-07-15T03:20:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2372
[2026-07-15T03:25:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2282
[2026-07-15T03:30:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2388
[2026-07-15T03:30:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2375
[2026-07-15T03:30:00] bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-15T03:35:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2378
[2026-07-15T03:35:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2377
[2026-07-15T03:40:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2297
[2026-07-15T03:45:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2389
[2026-07-15T03:45:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2392
[2026-07-15T03:50:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2293
[2026-07-15T03:55:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2387
[2026-07-15T03:55:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2401
[2026-07-15T04:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-15T04:00:00] bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-15T04:10:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2404
[2026-07-15T04:20:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2418
[2026-07-15T04:30:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2425
[2026-07-15T04:35:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2419
[2026-07-15T04:45:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2429
[2026-07-15T06:56:16] kitchen_light | OnOff.OnOff = True
[2026-07-15T18:59:00] kitchen_light | OnOff.OnOff = True
[2026-07-15T23:45:04] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-16T01:40:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2322
[2026-07-16T01:50:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2316
[2026-07-16T02:00:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2326
[2026-07-16T02:05:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2337
[2026-07-16T02:15:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2331
[2026-07-16T02:25:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2346
[2026-07-16T02:25:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2331
[2026-07-16T02:30:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2251
[2026-07-16T02:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-16T02:30:00] bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-16T02:35:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2254
[2026-07-16T02:40:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2359
[2026-07-16T02:40:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2344
[2026-07-16T02:45:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2256
[2026-07-16T02:50:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2354
[2026-07-16T02:50:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2353
[2026-07-16T02:55:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2269
[2026-07-16T03:00:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2369
[2026-07-16T03:00:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2369
[2026-07-16T03:00:00] bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-16T03:05:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2358
[2026-07-16T03:05:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2362
[2026-07-16T03:10:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2265
[2026-07-16T03:14:00] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-16T03:15:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2379
[2026-07-16T03:15:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2368
[2026-07-16T03:15:00] kitchen_light | OnOff.OnOff = True
[2026-07-16T03:20:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2280
[2026-07-16T03:25:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2380
[2026-07-16T03:25:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2387
[2026-07-16T03:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-16T03:30:00] bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-16T03:35:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2274
[2026-07-16T03:40:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2377
[2026-07-16T03:40:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2393
[2026-07-16T03:45:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2291
[2026-07-16T03:50:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2395

## 任务
请从下面 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-07-14 至 03:30 期间，living_room_occupancy 状态长期为 0（无人），bedroom_occupancy 也于 03:00 变为 0，表明此时段房屋处于无人居住状态。",
    "推理步骤 2: 对比同一时间段内的温度数据，卧室温度 (bedroom_temp_sensor) 保持在 22°C 左右（如 2250mK=22.5°C），符合夜间自然降温或恒温逻辑；而厨房温度 (kitchen_temp_sensor) 虽有波动但相对平稳。",
    "推理步骤 3: 关键异常在于客厅温度 (living_room_temp_sensor)，在无人状态下从凌晨 01:40 的 23.07°C 持续线性上升至 04:50 的 24.36°C，且在 03:14 短暂检测到有人 (Occupancy=1) 后迅速归零，但温度并未回落反而继续攀升。这种‘无人却持续升温’且幅度超过正常昼夜温差的现象，不符合空调运行或人员活动的物理规律，极大概率是传感器读数漂移或硬件故障。"
  ],
  "key_evidence": [
    "2026-07-14T02:30:00 至 04:50:00 期间，living_room_occupancy 显示为 0（无人），但 living_room_temp_sensor 读数从 2358mK (23.58°C) 持续上升至 2436mK (24.36°C)。",
    "在同一时间窗口内，卧室温度稳定在 22°C 左右，与客厅的异常升温形成鲜明对比，排除了全屋整体升温的可能性。",
    "2026-07-14T03:14:00 曾短暂记录到 occupancy=1，随后立即变回 0，但紧接着的温度读数继续上升，证明升温并非由该次短暂的人员活动引起。"
  ],
  "recommended_actions": [
    "立即检查并重置客厅温度传感器 (living_room_temp_sensor)，确认其是否松动、接触不良或被遮挡。",
    "若重置无效，建议联系技术支持更换该传感器，以防因数据错误导致错误的 HVAC 控制指令（如误开制冷/制热）或触发虚假警报。",
    "在维修完成前，暂时忽略基于该传感器数据的自动化场景，并手动监控室内实际温度。"
  ]
}
```


你是一个智能家居安全分析 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]

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

## 跨天活动摘要
- 2026-07-28: balcony=2, master_bedroom=232, kids_room=231, entrance=231, dining_room=223, living_room=115

## 设备事件日志
[2026-07-28T00:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-28T00:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-28T01:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-28T01:20:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2304
[2026-07-28T01:20:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2304
[2026-07-28T01:20:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2307
[2026-07-28T01:20:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2306
[2026-07-28T01:25:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2309
[2026-07-28T01:25:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2311
[2026-07-28T01:25:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2297
[2026-07-28T01:25:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2315
[2026-07-28T01:30:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2301
[2026-07-28T01:30:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2309
[2026-07-28T01:30:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2309
[2026-07-28T01:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-28T01:30:00] dining_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-28T01:30:00] master_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-28T01:30:00] second_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-28T01:30:00] kids_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-28T01:30:00] master_bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-28T01:30:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-07-28T01:35:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2321
[2026-07-28T01:35:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2318
[2026-07-28T01:35:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2319
[2026-07-28T01:35:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2305
[2026-07-28T01:40:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2307
[2026-07-28T01:40:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2316
[2026-07-28T01:40:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2308
[2026-07-28T01:45:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2318
[2026-07-28T01:45:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2322
[2026-07-28T01:45:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2324
[2026-07-28T01:50:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2317
[2026-07-28T01:50:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2321
[2026-07-28T01:50:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2315
[2026-07-28T01:50:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2319
[2026-07-28T01:55:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2323
[2026-07-28T01:55:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2315
[2026-07-28T01:55:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2318
[2026-07-28T01:55:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2315
[2026-07-28T02:00:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2328
[2026-07-28T02:00:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2320
[2026-07-28T02:00:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2336
[2026-07-28T02:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-28T02:00:00] dining_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-28T02:00:00] master_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-28T02:00:00] second_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-28T02:00:00] kids_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-28T02:00:00] master_bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-28T02:00:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-07-28T02:05:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2322
[2026-07-28T02:05:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2330
[2026-07-28T02:05:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2335
[2026-07-28T02:07:00] balcony_door_contact | BooleanState.StateValue = False
[2026-07-28T02:08:00] balcony_light | OnOff.OnOff = True
[2026-07-28T02:09:00] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-28T02:10:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2332
[2026-07-28T02:10:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2334
[2026-07-28T02:10:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2322
[2026-07-28T02:10:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2329
[2026-07-28T02:15:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2336
[2026-07-28T02:15:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2339
[2026-07-28T02:15:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2331
[2026-07-28T02:20:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2346
[2026-07-28T02:20:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2329
[2026-07-28T02:20:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2333
[2026-07-28T02:20:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2345
[2026-07-28T02:25:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2331
[2026-07-28T02:25:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2348
[2026-07-28T02:25:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2338
[2026-07-28T02:25:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2341
[2026-07-28T02:30:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2353
[2026-07-28T02:30:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2347
[2026-07-28T02:30:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2343
[2026-07-28T02:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-28T02:30:00] dining_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-28T02:30:00] master_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-28T02:30:00] second_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-28T02:30:00] kids_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-28T02:30:00] master_bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-28T02:30:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-07-28T02:35:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2345
[2026-07-28T02:35:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2340
[2026-07-28T02:35:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2343
[2026-07-28T02:40:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2343
[2026-07-28T02:40:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2352
[2026-07-28T02:40:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2342
[2026-07-28T02:40:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2354
[2026-07-28T02:45:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2350
[2026-07-28T02:45:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2362
[2026-07-28T02:45:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2354
[2026-07-28T02:45:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2344
[2026-07-28T02:50:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2356
[2026-07-28T02:50:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2356
[2026-07-28T02:55:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2354
[2026-07-28T02:55:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2358
[2026-07-28T02:55:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2357
[2026-07-28T02:55:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2368
[2026-07-28T03:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-28T03:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-28T08:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-28T17:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-28T19:17:05] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-28T20:47:05] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-28T22:17:05] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-28T23:47:05] 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 的形式报告。

## 家庭环境信息
家庭布局: 一室一厅 (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
- 已选事件数: 100

## 跨天活动摘要
- 2026-07-16: living_room=111, bedroom=218, bathroom=58, entrance=14, kitchen=8

## 设备事件日志
[2026-07-16T00:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-16T00:55:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2285
[2026-07-16T01:00:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2286
[2026-07-16T01:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-16T01:05:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2306
[2026-07-16T01:10:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2301
[2026-07-16T01:15:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2295
[2026-07-16T01:20:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2297
[2026-07-16T01:25:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2303
[2026-07-16T01:30:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2309
[2026-07-16T01:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-16T01:35:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2306
[2026-07-16T01:40:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2322
[2026-07-16T01:45:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2327
[2026-07-16T01:45:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2224
[2026-07-16T01:45:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2308
[2026-07-16T01:50:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2316
[2026-07-16T01:50:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2216
[2026-07-16T01:50:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2316
[2026-07-16T01:55:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2320
[2026-07-16T01:55:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2225
[2026-07-16T01:55:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2319
[2026-07-16T02:00:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2326
[2026-07-16T02:00:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2230
[2026-07-16T02:00:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2334
[2026-07-16T02:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-16T02:00:00] bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-16T02:00:00] bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-16T02:05:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2337
[2026-07-16T02:05:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2222
[2026-07-16T02:05:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2324
[2026-07-16T02:10:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2229
[2026-07-16T02:10:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2321
[2026-07-16T02:15:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2331
[2026-07-16T02:15:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2233
[2026-07-16T02:15:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2340
[2026-07-16T02:20:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2338
[2026-07-16T02:20:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2246
[2026-07-16T02:20:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2335
[2026-07-16T02:25:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2346
[2026-07-16T02:25:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2234
[2026-07-16T02:25:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2331
[2026-07-16T02:30:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2334
[2026-07-16T02:30:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2251
[2026-07-16T02:30:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2353
[2026-07-16T02:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-16T02:30:00] bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-16T02:30:00] bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-16T02:31:00] living_room_window_contact | BooleanState.StateValue = False
[2026-07-16T02:32:00] bedroom_window_contact | BooleanState.StateValue = False
[2026-07-16T02:34:00] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-16T02:35:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2352
[2026-07-16T02:35:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2254
[2026-07-16T02:35:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2350
[2026-07-16T02:40:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2359
[2026-07-16T02:40:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2252
[2026-07-16T02:40:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2344
[2026-07-16T02:45:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2362
[2026-07-16T02:45:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2256
[2026-07-16T02:45:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2352
[2026-07-16T02:50:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2354
[2026-07-16T02:50:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2259
[2026-07-16T02:55:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2351
[2026-07-16T02:55:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2269
[2026-07-16T02:55:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2349
[2026-07-16T03:00:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2369
[2026-07-16T03:00:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2257
[2026-07-16T03:00:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2369
[2026-07-16T03:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-16T03:00:00] bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-16T03:00:00] bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-16T03:05:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2358
[2026-07-16T03:05:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2258
[2026-07-16T03:05:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2362
[2026-07-16T03:10:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2378
[2026-07-16T03:10:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2265
[2026-07-16T03:10:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2359
[2026-07-16T03:15:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2379
[2026-07-16T03:15:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2276
[2026-07-16T03:15:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2368
[2026-07-16T03:20:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2382
[2026-07-16T03:20:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2280
[2026-07-16T03:20:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2366
[2026-07-16T03:25:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2380
[2026-07-16T03:30:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2372
[2026-07-16T03:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-16T03:35:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2386
[2026-07-16T03:40:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2377
[2026-07-16T03:45:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2396
[2026-07-16T03:50:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2395
[2026-07-16T03:55:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2391
[2026-07-16T04:00:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2407
[2026-07-16T04:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-16T04:05:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2404
[2026-07-16T08:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-16T16:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-16T19:31:10] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-16T20:52:04] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-16T22:17:04] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-16T23:42:04] 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": "sensor_drift",
  "threat_description": "客厅温度传感器读数严重偏离物理常识（显示为 20°C-24°C 范围外的数值，实际应为 22°C-26°C），且伴随异常的温度上升趋势，疑似传感器故障或数据漂移。",
  "reasoning": [
    "推理步骤 1: 分析日志中的温度数据格式。Matter 协议中温度通常以毫开尔文 (mK) 为单位报告。例如 `2285` mK 等于 22.85°C，`2407` mK 等于 24.07°C。虽然数值本身在合理范围内，但需结合上下文判断趋势。",
    "推理步骤 2: 观察时间序列趋势。从凌晨 01:00 到 04:00，在无人员活动（Occupancy=0）的情况下，客厅温度从约 22.85°C 持续上升至 24.07°C，厨房温度也从 23.08°C 升至 23.69°C。这种缓慢升温可能是空调未开启导致的自然散热，但也可能是传感器校准漂移。",
    "推理步骤 3: 识别关键异常点。在 02:31 和 02:32，窗户接触传感器状态变为 False（打开）。随后，尽管没有检测到人员进入（直到 02:34 才短暂检测到人，随后又消失），但温度读数并未因开窗通风而下降，反而继续上升并在 03:10-04:00 期间达到峰值（23.78°C - 24.07°C）。更关键的异常在于：如果这是真实的高温环境，通常会有更剧烈的波动；而此处温度曲线过于平滑且持续单向爬升，符合传感器零点漂移或校准错误的特征。此外，对比卧室温度（22.2°C 左右），客厅温度偏高且变化模式单一，进一步佐证了传感器可能存在问题而非真实环境温度剧变。",
    "推理步骤 4: 综合判断。虽然温度值本身未超过危险阈值（如火灾风险），但传感器数据的非物理一致性（在无热源增加且开窗情况下持续稳定爬升）表明存在 `sensor_drift` 风险，可能导致后续基于此数据的自动化决策（如误判需要制冷或忽略高温预警）失效。"
  ],
  "key_evidence": [
    "在窗户打开（02:31）且无人员活动的情况下，客厅温度持续单调上升，违背热力学常识（应因对流降温或保持稳定）。",
    "温度读数从 22.85°C (01:00) 攀升至 24.07°C (04:00)，增幅达 1.2°C，且曲线过于平滑，缺乏真实环境噪声特征，疑似传感器漂移。",
    "多房间温度传感器同时出现类似的不一致趋势（客厅偏高且持续上升，卧室相对稳定），增加了系统性传感器故障的可能性。"
  ],
  "recommended_actions": [
    "立即检查并重新校准客厅及厨房的温度传感器，确认其硬件连接是否正常。",
    "暂时禁用依赖该温度传感器的自动化场景（如恒温控制、高温报警），改用备用传感器或人工监测。",
    "联系设备制造商或技术支持，排查是否存在固件 Bug 导致的数据上报错误。"
  ]
}
```


你是一个智能家居安全分析 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
- 重点设备: front_door_lock, kitchen_light, living_room_occupancy
- 已选事件数: 34

## 跨天活动摘要
- 2026-07-23: entrance=229, living_room=114, bathroom=55, master_bedroom=48, second_bedroom=48, kitchen=9

## 设备事件日志
[2026-07-23T00:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-23T06:54:10] kitchen_light | OnOff.OnOff = True
[2026-07-23T07:35:00] kitchen_light | OnOff.OnOff = False
[2026-07-23T07:35:13] front_door_lock | Event: LockOperation(LockOperationType=1, OperationSource=Manual)
[2026-07-23T07:35:13] front_door_lock | DoorLock.LockState = 2
[2026-07-23T07:35:23] front_door_lock | Event: LockOperation(LockOperationType=0, OperationSource=Manual)
[2026-07-23T07:35:23] front_door_lock | DoorLock.LockState = 1
[2026-07-23T09:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-23T18:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-23T18:05:00] front_door_lock | Event: LockOperation(LockOperationType=1, OperationSource=Manual)
[2026-07-23T18:05:00] front_door_lock | DoorLock.LockState = 2
[2026-07-23T18:47:00] kitchen_light | OnOff.OnOff = True
[2026-07-23T19:30:22] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-23T20:56:02] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-23T21:50:06] entrance_occupancy | OccupancySensing.Occupancy = 1
[2026-07-23T21:51:02] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-23T22:10:06] entrance_occupancy | OccupancySensing.Occupancy = 1
[2026-07-23T22:10:08] entrance_light | OnOff.OnOff = False
[2026-07-23T22:10:40] front_door_contact | BooleanState.StateValue = True
[2026-07-23T22:10:41] front_door_lock | Event: LockOperation(LockOperationType=0, OperationSource=Manual)
[2026-07-23T22:10:41] front_door_lock | DoorLock.LockState = 1
[2026-07-23T22:11:02] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-23T22:30:06] entrance_occupancy | OccupancySensing.Occupancy = 1
[2026-07-23T22:31:02] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-23T22:50:06] entrance_occupancy | OccupancySensing.Occupancy = 1
[2026-07-23T22:51:02] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-23T22:55:27] bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-23T23:00:00] master_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-23T23:00:00] second_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-23T23:10:06] entrance_occupancy | OccupancySensing.Occupancy = 1
[2026-07-23T23:11:02] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-23T23:18:00] front_door_lock | DoorLock.LockState = 2
[2026-07-23T23:24:00] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-23T23:25:00] kitchen_light | OnOff.OnOff = True

## 任务
监控系统标记了潜在异常。请分析下面的日志，判断是否需要采取响应措施，并给出建议。

请按以下 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: 先出现远程解锁结果",
    "推理步骤2: 几分钟后才有室内活动",
    "推理步骤3: 中间缺乏正常进门链路"
  ],
  "key_evidence": [
    "先出现远程解锁结果",
    "几分钟后才有室内活动",
    "中间缺乏正常进门链路"
  ],
  "recommended_actions": [
    "标记为可疑远程开锁事件，建议核查账户凭证与远程授权。"
  ]
}

```json
{
  "is_anomaly": false,
  "confidence": "high",
  "threat_type": "none",
  "threat_description": "日志显示正常的家庭出入活动模式，未发现入侵、尾随或其他安全威胁迹象。",
  "reasoning": [
    "推理步骤 1: 分析入户门锁 (front_door_lock) 事件序列。在 07:35:13 检测到手动上锁 (LockOperationType=1)，随后在 07:35:23 检测到手动解锁 (LockOperationType=0)。这种短时间内先锁后解的模式符合住户短暂离开（如去厨房或阳台）后立即返回并重新确认门锁状态的行为，属于正常操作。",
    "推理步骤 2: 检查夜间及晚间活动逻辑。日志显示 22:10:40 门传感器触发 (StateValue=True)，紧接着在 07:35:23 之后（此处时间线需注意，实际是 22:10 开门，22:11 关门？不，看日志顺序：22:10:40 门开，22:10:41 门锁状态变为 1(解锁/未锁)？这里需要仔细核对 Matter 标准定义。通常 LockState 1=Unlocked, 2=Locked。日志中 22:10:41 LockState=1 表示解锁。结合 22:10:40 门接触传感器 True(Open)，这表示有人开门进入或离开。随后 22:11:02 客厅有人，说明住户在家内活动。",
    "修正推理步骤 2: 重新梳理 22:10 的时间线。22:10:40 门接触传感器变真 (Open)，22:10:41 门锁状态变为 1 (Unlocked)。这表明有人打开了门。考虑到此时客厅和玄关都有人 (Occupancy=1)，且后续没有再次上锁的记录直到第二天早上，这可能是一次临时的开门（例如取快递或短暂外出），或者之前的“上锁”记录被覆盖。但关键在于，没有发现‘门开了很久没关’或‘门开了没人’的情况。",
    "推理步骤 3: 综合 occupancy 数据。从 19:30 开始，living_room_occupancy 持续为 1，直到 23:00 左右卧室无人，但客厅仍有人。整个过程中，运动传感器和门窗传感器的状态变化与人员在场时间高度吻合，没有出现传感器卡死（如门已关闭但传感器一直报开）或异常长时间无人的情况。",
    "结论：所有设备行为均符合住户日常作息规律，未见异常模式。"
  ],
  "key_evidence": [
    "07:35:13 至 07:35:23 之间门锁出现快速的上锁 - 解锁循环，符合住户临时移动后的习惯。",
    "22:10:40 门开启后，22:11:02 即检测到客厅有人，表明住户并未离家，而是处于室内活动状态。",
    "整段日志中 OccupancySensing.Occupancy 状态变化平滑，无长时间零值伴随门窗开启的异常情况。"
  ],
  "recommended_actions": [
    "无需采取紧急措施，系统运行正常。",
    "建议定期查看完整日志以建立更精确的住户行为基线，以便未来更好地识别真正的异常。"
  ]
}
```


你是一个智能家居安全分析 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]

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

## 设备事件日志
[2026-08-22T00:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-22T01:25:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2315
[2026-08-22T01:30:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2308
[2026-08-22T01:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-22T01:35:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2312
[2026-08-22T01:40:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2316
[2026-08-22T01:45:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2311
[2026-08-22T01:50:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2327
[2026-08-22T01:55:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2326
[2026-08-22T02:00:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2322
[2026-08-22T02:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-22T02:00:00] bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-22T02:00:00] bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-22T02:05:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2324
[2026-08-22T02:10:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2323
[2026-08-22T02:15:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2329
[2026-08-22T02:20:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2346
[2026-08-22T02:25:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2349
[2026-08-22T02:30:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2351
[2026-08-22T02:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-22T02:30:00] bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-22T02:30:00] bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-22T02:31:00] living_room_window_contact | BooleanState.StateValue = False
[2026-08-22T02:32:00] bedroom_window_contact | BooleanState.StateValue = False
[2026-08-22T02:34:00] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-08-22T02:35:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2348
[2026-08-22T02:40:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2343
[2026-08-22T02:45:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2358
[2026-08-22T02:50:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2357
[2026-08-22T02:55:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2360
[2026-08-22T03:00:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2372
[2026-08-22T03:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-22T03:00:00] bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-22T03:00:00] bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-22T03:05:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2369
[2026-08-22T03:10:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2368
[2026-08-22T03:15:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2366
[2026-08-22T03:20:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2382
[2026-08-22T03:25:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2380
[2026-08-22T03:30:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2381
[2026-08-22T03:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-22T03:35:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2375
[2026-08-22T10:58:00] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-08-22T13:33:00] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-08-22T16:08:00] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-08-22T18:43:00] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-08-22T21:18:00] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-08-22T23:53: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": "low",
  "threat_type": "fire_risk",
  "threat_description": "存在异常，但原因更可能属于其他类别。",
  "reasoning": [
    "推理步骤1: 日志里有异常，但我把它归因为另一类威胁。"
  ],
  "key_evidence": [
    "短时间内两个不同房间窗户先后打开"
  ],
  "recommended_actions": [
    "建议按该错误类别处理。"
  ]
}


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

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

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

## 家庭环境信息
家庭布局: 两室一厅 (2BR)
- 重点房间 living_room: 客厅主灯[dimmable_light], 客厅落地灯[onoff_light], 客厅空调[air_conditioner], 客厅温度传感器[temperature_sensor], 客厅运动传感器[occupancy_sensor], 客厅窗帘[window_covering], 客厅窗户传感器[contact_sensor]
- 房间 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]
- 房间 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
- 重点房间: living_room
- 重点设备: kitchen_light, living_room_occupancy
- 已选事件数: 136

## 跨天活动摘要
- 2026-08-27: living_room=115, entrance=230, master_bedroom=228, second_bedroom=48, bathroom=48, kitchen=11
- 2026-08-28: living_room=114, master_bedroom=232, entrance=227, second_bedroom=48, bathroom=48, kitchen=11
- 2026-08-29: living_room=49, master_bedroom=48, second_bedroom=48, bathroom=48, entrance=48, kitchen=1

## 设备事件日志
[2026-08-27T00:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-27T01:40:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2308
[2026-08-27T01:50:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2321
[2026-08-27T02:00:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2330
[2026-08-27T02:05:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2332
[2026-08-27T02:15:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2342
[2026-08-27T02:25:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2348
[2026-08-27T02:25:00] second_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2332
[2026-08-27T02:30:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2338
[2026-08-27T02:30:00] second_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2352
[2026-08-27T02:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-27T02:30:00] second_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-27T02:30:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-08-27T02:35:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2336
[2026-08-27T02:35:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2339
[2026-08-27T02:40:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2348
[2026-08-27T02:40:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2355
[2026-08-27T02:45:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2351
[2026-08-27T02:45:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2362
[2026-08-27T02:50:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2359
[2026-08-27T02:55:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2368
[2026-08-27T02:55:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2364
[2026-08-27T03:00:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2363
[2026-08-27T03:00:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2360
[2026-08-27T03:00:00] master_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-27T03:00:00] bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-27T03:05:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2355
[2026-08-27T03:05:00] second_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2366
[2026-08-27T03:10:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2363
[2026-08-27T03:10:00] second_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2368
[2026-08-27T03:14:00] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-08-27T03:15:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2378
[2026-08-27T03:15:00] second_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2367
[2026-08-27T03:20:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2367
[2026-08-27T03:25:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2368
[2026-08-27T03:25:00] second_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2382
[2026-08-27T03:30:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2377
[2026-08-27T03:30:00] second_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2389
[2026-08-27T03:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-27T03:30:00] second_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-27T03:30:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-08-27T03:35:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2388
[2026-08-27T03:35:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2386
[2026-08-27T03:40:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2391
[2026-08-27T03:40:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2380
[2026-08-27T03:45:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2393
[2026-08-27T03:45:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2398
[2026-08-27T03:50:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2398
[2026-08-27T03:50:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2399
[2026-08-27T03:55:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2406
[2026-08-27T03:55:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2402
[2026-08-27T04:00:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2392
[2026-08-27T04:00:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2409
[2026-08-27T04:00:00] master_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-27T04:00:00] bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-27T04:05:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2406
[2026-08-27T04:15:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2404
[2026-08-27T04:25:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2424
[2026-08-27T04:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-27T04:40:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2431
[2026-08-27T04:50:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2439
[2026-08-27T07:20:03] kitchen_light | OnOff.OnOff = False
[2026-08-27T18:31:00] kitchen_light | OnOff.OnOff = True
[2026-08-28T01:35:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2304
[2026-08-28T01:45:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2313
[2026-08-28T01:55:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2323
[2026-08-28T02:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-28T02:10:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2326
[2026-08-28T02:20:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2340
[2026-08-28T02:25:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2343
[2026-08-28T02:25:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2334
[2026-08-28T02:30:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2338
[2026-08-28T02:30:00] master_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-28T02:30:00] bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-28T02:35:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2351
[2026-08-28T02:35:00] second_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2347
[2026-08-28T02:40:00] second_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2356
[2026-08-28T02:45:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2356
[2026-08-28T02:45:00] second_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2350
[2026-08-28T02:50:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2355
[2026-08-28T02:50:00] second_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2361
[2026-08-28T02:55:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2349
[2026-08-28T02:55:00] second_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2367
[2026-08-28T03:00:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2369
[2026-08-28T03:00:00] second_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2364
[2026-08-28T03:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-28T03:00:00] second_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-28T03:00:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-08-28T03:05:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2363
[2026-08-28T03:05:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2371
[2026-08-28T03:10:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2370
[2026-08-28T03:10:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2370
[2026-08-28T03:14:00] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-08-28T03:15:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2364
[2026-08-28T03:15:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2369
[2026-08-28T03:20:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2366
[2026-08-28T03:20:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2376
[2026-08-28T03:25:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2388
[2026-08-28T03:25:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2377
[2026-08-28T03:30:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2376
[2026-08-28T03:30:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2382
[2026-08-28T03:30:00] master_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-28T03:30:00] bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-28T03:35:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2387
[2026-08-28T03:35:00] second_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2378
[2026-08-28T03:40:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2397
[2026-08-28T03:40:00] second_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2391
[2026-08-28T03:45:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2392
[2026-08-28T03:45:00] second_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2384
[2026-08-28T03:50:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2403
[2026-08-28T03:50:00] second_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2400
[2026-08-28T03:55:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2393
[2026-08-28T03:55:00] second_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2401
[2026-08-28T04:00:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2390
[2026-08-28T04:00:00] second_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2405
[2026-08-28T04:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-28T04:00:00] second_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-28T04:00:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-08-28T04:10:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2408
[2026-08-28T04:20:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2416
[2026-08-28T04:30:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2418
[2026-08-28T04:35:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2430
[2026-08-28T04:45:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2435
[2026-08-28T06:51:07] kitchen_light | OnOff.OnOff = True
[2026-08-28T10:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-28T20:21:09] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-08-29T01:35:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2306
[2026-08-29T01:45:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2325
[2026-08-29T01:55:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2331
[2026-08-29T02:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-29T02:10:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2329
[2026-08-29T02:20:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2339
[2026-08-29T02:25:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2341
[2026-08-29T02:25:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2337
[2026-08-29T03:14:00] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-08-29T03:15:00] kitchen_light | OnOff.OnOff = True

## 任务
请从下面 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": "客厅温度传感器读数严重偏离物理现实，显示异常高温（2308-2439），而实际环境应处于正常室温范围，表明传感器存在漂移或故障。",
  "reasoning": [
    "推理步骤 1: 分析日志中的温度数据，发现 living_room_temp_sensor 的 MeasuredValue 在 2026-08-27 至 2026-08-28 期间数值高达 2308 至 2439。根据 Matter 协议标准及常识，TemperatureMeasurement.MeasuredValue 通常以 0.01°C 为单位，因此该数值代表 23.08°C 至 24.39°C，属于正常的夏季室内温度范围。",
    "推理步骤 2: 然而，仔细观察同一时间段内其他房间（如 second_bedroom、master_bedroom、kitchen）的温度传感器读数，其数值也同步呈现类似的'高位'特征（例如 second_bedroom 达到 2405）。如果这是真实的高温天气，所有房间应同时升高，但需结合 occupancy 事件判断。",
    "推理步骤 3: 关键矛盾点在于：在 2026-08-27T02:30:00 和 2026-08-28T02:00:00 等时间点，多个房间的 occupancy 传感器明确报告为 0（无人），且此时段通常为夜间睡眠或离家时间。若真有人活动导致温度变化，应有相应的 occupancy 记录。更关键的证据是，虽然数值看似正常（23-24度），但在某些上下文中，如果系统配置错误将单位误读为整数摄氏度（即认为室内有 2300 多度），则会导致严重的逻辑冲突。",
    "推理步骤 4: 重新审视任务描述中的'异常模式'提示。对比 2026-08-29 的数据，温度读数回落至 2306-2331 区间，且 occupancy 行为符合常规作息。而在前两天的深夜/凌晨时段，温度读数持续维持在较高位（23xx-24xx），且伴随频繁的传感器上报。考虑到这是一个安全分析场景，最可能的解释并非真实的极端高温，而是**传感器校准漂移（Sensor Drift）**或**固件 Bug 导致的数值偏移**。特别是当多个传感器同时出现非线性的数值跳变或长期维持在不合理的‘高位’（相对于历史基线或预期值）时，极大概率是硬件故障或通信干扰导致的读数失真。",
    "推理步骤 5: 进一步确认：如果这些数值真的是 2300+ 摄氏度，那么烟雾报警器（smoke_co_alarm）和漏水传感器早已触发警报并切断电源，日志中不会出现如此平静的状态。因此，排除真实火灾风险，判定为传感器数据异常（Drift/Malfunction），可能导致自动化空调控制失效或误报。"
  ],
  "key_evidence": [
    "living_room_temp_sensor 在无人占用（Occupancy=0）的深夜时段持续报告异常高数值（2308-2439），与正常室温波动规律不符。",
    "多房间温度传感器（living_room, second_bedroom, master_bedroom, kitchen）在同一时间段内出现同步的数值异常，排除了局部热源干扰的可能性，指向系统性传感器故障或漂移。",
    "尽管温度读数极高，但厨房烟雾报警器和家庭整体未触发紧急响应，说明该数值未被系统正确解读为火灾风险，进一步证实是数据层面的漂移而非真实物理现象。"
  ],
  "recommended_actions": [
    "立即检查客厅及各房间温度传感器的硬件连接和电池状态，排除接触不良导致的信号噪声。",
    "重置受影响的温度传感器设备，并尝试通过 Matter 网络进行固件更新以修复潜在的校准 Bug。",
    "暂时禁用基于该温度数据的自动化场景（如自动开空调），改用手动控制或等待维修人员现场校准，防止因误判温度导致能源浪费或舒适度下降。"
  ]
}
```


你是一个智能家居安全分析 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]

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

## 跨天活动摘要
- 2026-07-22: entrance=232, master_bedroom=232, kids_room=230, dining_room=220, living_room=113, master_bathroom=53

## 设备事件日志
[2026-07-22T00:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-22T06:51:07] kitchen_light | OnOff.OnOff = True
[2026-07-22T07:22:05] kitchen_light | OnOff.OnOff = False
[2026-07-22T07:22:28] front_door_lock | Event: LockOperation(LockOperationType=1, OperationSource=Manual)
[2026-07-22T07:22:28] front_door_lock | DoorLock.LockState = 2
[2026-07-22T07:22:31] front_door_lock | Event: LockOperation(LockOperationType=0, OperationSource=Manual)
[2026-07-22T07:22:31] front_door_lock | DoorLock.LockState = 1
[2026-07-22T09:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-22T16:08:00] front_door_lock | Event: LockOperation(LockOperationType=1, OperationSource=Manual)
[2026-07-22T16:08:00] front_door_lock | DoorLock.LockState = 2
[2026-07-22T18:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-22T18:09:00] front_door_lock | Event: LockOperation(LockOperationType=1, OperationSource=Manual)
[2026-07-22T18:09:00] front_door_lock | DoorLock.LockState = 2
[2026-07-22T18:12:00] kitchen_light | OnOff.OnOff = True
[2026-07-22T19:34:03] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-22T21:04:03] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-22T21:49:03] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-22T21:49:03] entrance_occupancy | OccupancySensing.Occupancy = 1
[2026-07-22T22:09:03] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-22T22:09:03] entrance_occupancy | OccupancySensing.Occupancy = 1
[2026-07-22T22:22:26] front_door_contact | BooleanState.StateValue = True
[2026-07-22T22:22:27] front_door_lock | Event: LockOperation(LockOperationType=0, OperationSource=Manual)
[2026-07-22T22:22:27] front_door_lock | DoorLock.LockState = 1
[2026-07-22T22:29:03] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-22T22:29:03] entrance_occupancy | OccupancySensing.Occupancy = 1
[2026-07-22T22:33:05] kids_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-22T22:35:05] dining_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-22T22:37:11] master_bedroom_occupancy | OccupancySensing.Occupancy = 1
[2026-07-22T22:49:03] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-22T22:49:03] entrance_occupancy | OccupancySensing.Occupancy = 1
[2026-07-22T22:52:16] master_bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-22T22:53:05] kids_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-22T22:55:05] dining_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-22T22:57:11] master_bedroom_occupancy | OccupancySensing.Occupancy = 1
[2026-07-22T23:00:00] second_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-22T23:18:00] front_door_lock | DoorLock.LockState = 2
[2026-07-22T23:24:00] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-22T23:25:00] kitchen_light | OnOff.OnOff = True

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

请按以下 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: 先出现远程解锁结果",
    "推理步骤2: 几分钟后才有室内活动",
    "推理步骤3: 中间缺乏正常进门链路"
  ],
  "key_evidence": [
    "先出现远程解锁结果",
    "几分钟后才有室内活动",
    "中间缺乏正常进门链路"
  ],
  "recommended_actions": [
    "标记为可疑远程开锁事件，建议核查账户凭证与远程授权。"
  ]
}

```json
{
  "is_anomaly": false,
  "confidence": "high",
  "threat_type": "none",
  "threat_description": "日志显示正常的家庭晚间活动模式，包括入户、室内活动及睡前锁门，未发现安全威胁。",
  "reasoning": [
    "推理步骤 1: 时间线分析显示，用户在 07:22 手动上锁（LockState=2），随后在 16:08 和 18:09 两次手动解锁并进入家中（结合后续 occupancy 变化），符合典型的下班回家流程。",
    "推理步骤 2: 晚间活动（21:49 - 23:25）中，客厅、玄关、儿童房、餐厅、主卧等区域的运动传感器依次触发，表明家庭成员正常在屋内移动并进行日常活动（如洗漱、休息）。",
    "推理步骤 3: 关键安全事件发生在 23:18，前门状态变为锁定（LockState=2），且之后未再出现开门或异常入侵迹象，确认用户已安全完成夜间安防设置。",
    "推理步骤 4: 厨房灯光在 23:25 开启，可能是睡前准备或误触，但无烟雾报警、漏水或灶具异常操作记录，属于低风险行为。"
  ],
  "key_evidence": [
    "23:18 front_door_lock LockState 变为 2 (Locked)，确认夜间安防已激活。",
    "21:49 至 23:25 期间多个房间 occupancy 传感器正常序列触发，符合家庭作息规律。",
    "全时段无 door_contact 异常开启、smoke_co_alarm 触发或 unauthorized lock operation 记录。"
  ],
  "recommended_actions": [
    "无需紧急干预，系统运行正常。",
    "建议保持当前监控策略，继续观察后续夜间活动直至次日早晨。"
  ]
}
```


你是一个智能家居安全分析 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
- 已选事件数: 96

## 跨天活动摘要
- 2026-07-06: living_room=210, bedroom=243, kitchen=239, entrance=231, bathroom=60

## 设备事件日志
[2026-07-06T00:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-06T00:55:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2293
[2026-07-06T01:00:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2299
[2026-07-06T01:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-06T01:05:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2305
[2026-07-06T01:10:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2303
[2026-07-06T01:15:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2296
[2026-07-06T01:20:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2294
[2026-07-06T01:25:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2300
[2026-07-06T01:30:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2318
[2026-07-06T01:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-06T01:35:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2309
[2026-07-06T01:40:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2305
[2026-07-06T01:45:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2327
[2026-07-06T01:45:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2220
[2026-07-06T01:45:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2321
[2026-07-06T01:50:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2329
[2026-07-06T01:50:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2318
[2026-07-06T01:55:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2326
[2026-07-06T01:55:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2216
[2026-07-06T01:55:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2327
[2026-07-06T02:00:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2328
[2026-07-06T02:00:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2234
[2026-07-06T02:00:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2328
[2026-07-06T02:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-06T02:00:00] bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-06T02:00:00] kitchen_occupancy | OccupancySensing.Occupancy = 0
[2026-07-06T02:00:00] bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-06T02:00:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-07-06T02:05:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2320
[2026-07-06T02:05:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2238
[2026-07-06T02:10:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2322
[2026-07-06T02:10:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2322
[2026-07-06T02:15:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2337
[2026-07-06T02:15:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2230
[2026-07-06T02:15:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2333
[2026-07-06T02:20:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2339
[2026-07-06T02:20:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2233
[2026-07-06T02:20:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2329
[2026-07-06T02:25:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2342
[2026-07-06T02:25:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2340
[2026-07-06T02:30:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2336
[2026-07-06T02:30:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2349
[2026-07-06T02:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-06T02:30:00] bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-06T02:30:00] kitchen_occupancy | OccupancySensing.Occupancy = 0
[2026-07-06T02:30:00] bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-06T02:30:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-07-06T02:31:00] living_room_window_contact | BooleanState.StateValue = False
[2026-07-06T02:32:00] bedroom_window_contact | BooleanState.StateValue = False
[2026-07-06T02:34:00] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-06T02:35:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2249
[2026-07-06T02:35:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2353
[2026-07-06T02:40:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2340
[2026-07-06T02:40:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2256
[2026-07-06T02:40:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2344
[2026-07-06T02:45:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2344
[2026-07-06T02:45:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2243
[2026-07-06T02:45:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2358
[2026-07-06T02:50:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2346
[2026-07-06T02:50:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2245
[2026-07-06T02:50:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2361
[2026-07-06T02:55:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2355
[2026-07-06T02:55:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2267
[2026-07-06T02:55:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2357
[2026-07-06T03:00:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2357
[2026-07-06T03:00:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2362
[2026-07-06T03:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-06T03:00:00] bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-06T03:00:00] kitchen_occupancy | OccupancySensing.Occupancy = 0
[2026-07-06T03:00:00] bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-06T03:00:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-07-06T03:05:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2261
[2026-07-06T03:05:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2373
[2026-07-06T03:10:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2374
[2026-07-06T03:10:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2260
[2026-07-06T03:10:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2360
[2026-07-06T03:15:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2368
[2026-07-06T03:15:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2263
[2026-07-06T03:15:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2381
[2026-07-06T03:20:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2277
[2026-07-06T03:25:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2383
[2026-07-06T03:30:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2381
[2026-07-06T03:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-06T03:35:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2390
[2026-07-06T03:40:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2395
[2026-07-06T03:45:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2398
[2026-07-06T03:50:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2401
[2026-07-06T04:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-06T04:05:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2409
[2026-07-06T09:49:07] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-06T12:39:07] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-06T15:26:10] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-06T18:16:10] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-06T21:06:00] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-06T23: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": "凌晨时段（02:30-04:00）客厅窗户被打开，且室内温度持续异常升高至 24°C+，同时检测到人员短暂进入，存在极高的火灾或非法入侵风险。",
  "reasoning": [
    "时间异常：事件发生在凌晨 02:31 至 04:05 之间，这是独居老人通常的睡眠深度期，此时窗户突然打开（living_room_window_contact 变为 False）极不寻常。",
    "环境恶化：在窗户打开后，客厅温度传感器读数从正常的 22-23°C 迅速攀升并稳定在 23.8°C - 24.1°C（即 2380mK-2410mK），这种升温模式不符合夜间自然降温规律，反而符合外部热源侵入或内部火源加热的特征。",
    "行为矛盾：在温度急剧上升和窗户开启期间（02:34），运动传感器检测到有人进入（Occupancy=1），但随后在 03:00、03:30、04:00 多次显示无人（Occupancy=0）。对于独居老人，深夜独自进出房间且伴随高温异常，高度疑似遭遇非法入侵者，或者发生了未被察觉的电气/燃气火灾导致热空气聚集。",
    "数据佐证：厨房温度也同步升高至 23.6°C-23.8°C，表明整个房屋环境温度失控，进一步排除了单一设备故障的可能性，指向系统性环境威胁。"
  ],
  "key_evidence": [
    "[2026-07-06T02:31:00] living_room_window_contact | BooleanState.StateValue = False (凌晨窗户意外开启)",
    "[2026-07-06T02:34:00] living_room_occupancy | OccupancySensing.Occupancy = 1 (深夜有人进入)",
    "[2026-07-06T03:50:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2401 (凌晨室温异常高达 24.01°C)"
  ],
  "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-29T03:00:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-08-29T03:30:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-08-29T04:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-29T04:00:00] master_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-29T04:00:00] second_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-29T04:00:00] bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-29T04:00:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-08-29T04:06:00] front_door_lock | DoorLock.LockState = 2
[2026-08-29T04:07:00] front_door_lock | DoorLock.LockState = 1
[2026-08-29T04:09:00] living_room_light_1 | OnOff.OnOff = True
[2026-08-29T04:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-29T04:30:00] master_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-29T04:30:00] second_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-29T04:30:00] bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-29T04:30:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-08-29T05:00:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-08-29T10:14:06] living_room_light_1 | OnOff.OnOff = True
[2026-08-29T22:46:00] living_room_light_1 | OnOff.OnOff = False
[2026-08-29T22:46:14] front_door_lock | Event: LockOperation(LockOperationType=0, OperationSource=Manual)
[2026-08-29T22:46:14] 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": [
    "判为异常门锁状态切换，建议核查锁日志与物理门状态。"
  ]
}

{
  "is_anomaly": true,
  "confidence": "low",
  "threat_type": "fire_risk",
  "threat_description": "存在异常，但原因更可能属于其他类别。",
  "reasoning": [
    "推理步骤1: 日志里有异常，但我把它归因为另一类威胁。"
  ],
  "key_evidence": [
    "门锁状态先解锁再回锁"
  ],
  "recommended_actions": [
    "建议按该错误类别处理。"
  ]
}