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

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

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

## 家庭环境信息
家庭布局: 三室两厅 (3BR)
- 重点房间 kids_room: 儿童房灯[dimmable_light], 儿童房运动传感器[occupancy_sensor], 儿童房窗帘[window_covering], 儿童房窗户传感器[contact_sensor], 儿童房温度传感器[temperature_sensor]
- 房间 balcony: 阳台灯[onoff_light], 阳台门传感器[contact_sensor], 洗衣机[laundry_washer]
- 房间 dining_room: 餐厅灯[dimmable_light], 餐厅运动传感器[occupancy_sensor]
- 房间 entrance: 入户门锁[door_lock], 入户门传感器[contact_sensor], 玄关灯[onoff_light], 玄关运动传感器[occupancy_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]

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

## 跨天活动摘要
- 2026-08-23: kids_room=49, living_room=49, dining_room=48, master_bedroom=48, second_bedroom=48, master_bathroom=48

## 设备事件日志
[2026-08-23T00:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-23T00:00:00] kids_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-23T04:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-23T04:00:00] kids_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-23T08:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-23T08:00:00] kids_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-23T12:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-23T12:00:00] kids_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-23T14:10:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2474
[2026-08-23T14:15:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2476
[2026-08-23T14:20:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2459
[2026-08-23T14:25:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2453
[2026-08-23T14:30:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2458
[2026-08-23T14:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-23T14:30:00] kids_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-23T14:35:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2460
[2026-08-23T14:40:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2452
[2026-08-23T14:45:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2441
[2026-08-23T14:55:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2436
[2026-08-23T15:00:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2434
[2026-08-23T15:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-23T15:00:00] kids_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-23T15:05:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2432
[2026-08-23T15:10:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2439
[2026-08-23T15:10:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2437
[2026-08-23T15:10:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2427
[2026-08-23T15:15:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2430
[2026-08-23T15:15:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2428
[2026-08-23T15:15:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2420
[2026-08-23T15:15:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2419
[2026-08-23T15:20:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2431
[2026-08-23T15:20:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2429
[2026-08-23T15:20:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2416
[2026-08-23T15:20:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2430
[2026-08-23T15:25:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2419
[2026-08-23T15:25:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2412
[2026-08-23T15:25:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2421
[2026-08-23T15:25:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2423
[2026-08-23T15:30:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2418
[2026-08-23T15:30:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2422
[2026-08-23T15:30:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2427
[2026-08-23T15:30:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2424
[2026-08-23T15:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-23T15:30:00] dining_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-23T15:30:00] master_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-23T15:30:00] second_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-23T15:30:00] kids_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-23T15:30:00] master_bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-23T15:30:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-08-23T15:35:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2423
[2026-08-23T15:35:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2423
[2026-08-23T15:35:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2406
[2026-08-23T15:35:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2408
[2026-08-23T15:40:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2409
[2026-08-23T15:40:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2409
[2026-08-23T15:40:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2411
[2026-08-23T15:40:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2420
[2026-08-23T15:45:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2404
[2026-08-23T15:45:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2404
[2026-08-23T15:45:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2415
[2026-08-23T15:50:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2400
[2026-08-23T15:50:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2410
[2026-08-23T15:50:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2400
[2026-08-23T15:50:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2402
[2026-08-23T15:55:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2393
[2026-08-23T15:55:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2405
[2026-08-23T15:55:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2408
[2026-08-23T16:00:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2406
[2026-08-23T16:00:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2391
[2026-08-23T16:00:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2398
[2026-08-23T16:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-23T16:00:00] dining_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-23T16:00:00] master_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-23T16:00:00] second_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-23T16:00:00] kids_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-23T16:00:00] master_bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-23T16:00:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-08-23T16:05:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2403
[2026-08-23T16:05:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2399
[2026-08-23T16:05:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2403
[2026-08-23T16:05:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2403
[2026-08-23T16:10:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2387
[2026-08-23T16:10:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2403
[2026-08-23T16:10:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2401
[2026-08-23T16:10:00] kids_room_occupancy | OccupancySensing.Occupancy = 1
[2026-08-23T16:12:00] balcony_door_contact | BooleanState.StateValue = False
[2026-08-23T16:13:00] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-08-23T16:15:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2394
[2026-08-23T16:15:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2382
[2026-08-23T16:15:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2383
[2026-08-23T16:15:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2396
[2026-08-23T16:20:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2381
[2026-08-23T16:20:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2386
[2026-08-23T16:20:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2393
[2026-08-23T16:20:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2391
[2026-08-23T16:25:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2379
[2026-08-23T16:25:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2376
[2026-08-23T16:25:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2387
[2026-08-23T16:25:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2390
[2026-08-23T16:30:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2384
[2026-08-23T16:30:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2384
[2026-08-23T16:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-23T16:30:00] dining_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-23T16:30:00] master_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-23T16:30:00] second_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-23T16:30:00] kids_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-23T16:30:00] master_bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-23T16:30:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-08-23T16:35:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2378
[2026-08-23T16:35:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2370
[2026-08-23T16:35:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2371
[2026-08-23T16:40:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2375
[2026-08-23T16:40:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2367
[2026-08-23T16:40:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2377
[2026-08-23T16:40:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2367
[2026-08-23T16:45:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2365
[2026-08-23T16:45:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2373
[2026-08-23T16:45:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2372
[2026-08-23T16:50:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2377
[2026-08-23T16:50:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2365
[2026-08-23T16:50:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2376
[2026-08-23T16:50:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2362
[2026-08-23T16:55:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2367
[2026-08-23T16:55:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2375
[2026-08-23T16:55:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2374
[2026-08-23T17:00:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2355
[2026-08-23T17:00:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2359
[2026-08-23T17:00:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2372
[2026-08-23T17:00:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2357
[2026-08-23T17:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-23T17:00:00] dining_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-23T17:00:00] master_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-23T17:00:00] second_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-23T17:00:00] kids_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-23T17:00:00] master_bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-23T17:00:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-08-23T17:05:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2353
[2026-08-23T17:05:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2364

## 任务
请综合以下多个设备与环境状态，评估家庭整体安全状况，指出任何潜在风险。

请按以下 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 中说明为什么这些事件是正常的。

```json
{
  "is_anomaly": false,
  "confidence": "high",
  "threat_type": "none",
  "threat_description": "未检测到安全威胁，所有设备状态符合正常家庭晚间活动模式。",
  "reasoning": [
    "1. 人员活动分析：日志显示在16:10左右，儿童房（kids_room）和客厅（living_room）的运动传感器同时被触发（Occupancy=1），随后在16:30左右恢复为无人状态（Occupancy=0）。这符合家庭成员（可能是孩子或家长）在傍晚时分短暂进入房间活动的正常行为模式。",
    "2. 门窗状态分析：阳台门传感器在16:12报告状态为False（通常表示关闭/锁定），这与运动传感器触发的时间点接近，表明有人进出后关门，或者仅仅是传感器更新，没有发现非法入侵迹象（如门锁异常开启或窗户长时间未关）。",
    "3. 环境数据一致性：温度传感器读数在合理范围内波动（约23-24摄氏度），且各房间温度变化趋势一致，没有出现突变的极端值，排除了传感器故障或火灾风险。",
    "4. 无其他危险信号：厨房、卫生间等关键区域的漏水、烟雾传感器均无报警记录，入户门锁无异常操作记录。"
  ],
  "key_evidence": [
    "[2026-08-23T16:10:00] kids_room_occupancy | OccupancySensing.Occupancy = 1",
    "[2026-08-23T16:13:00] living_room_occupancy | OccupancySensing.Occupancy = 1",
    "[2026-08-23T16:12:00] balcony_door_contact | BooleanState.StateValue = False",
    "[2026-08-23T16:30:00] kids_room_occupancy | OccupancySensing.Occupancy = 0"
  ],
  "recommended_actions": [
    "无需采取紧急措施。",
    "建议继续监控日常活动模式，若发现非预期时间的运动检测或门窗异常开启，再行排查。"
  ]
}
```

```json
{
  "is_anomaly": true,
  "confidence": "high",
  "threat_type": "sensor_malfunction",
  "threat_description": "儿童房温度传感器读数异常（约 2400-2470），远超正常物理温度范围，且与客厅、厨房等其他房间传感器数据不匹配，表明设备故障或校准错误。",
  "reasoning": [
    "推理步骤 1: 分析日志发现 kids_room_temp_sensor 在 14:10 至 17:05 期间持续报告数值在 2350 到 2476 之间。",
    "推理步骤 2: 对比同一时间段内其他房间（如 living_room, kitchen, master_bedroom）的温度传感器数据，其读数均在 2350-2430 的合理范围内波动，且趋势一致（随时间下降）。",
    "推理步骤 3: 考虑到 Matter 协议中温度通常以 0.1°C 为单位，2400+ 的读数极可能是传感器硬件故障、固件 Bug 导致的溢出错误，或者是单位/量程配置错误，而非真实的室温升高。这种单一传感器的孤立异常属于典型的 sensor_malfunction。"
  ],
  "key_evidence": [
    "kids_room_temp_sensor 读数 (e.g., 2474) 是其他房间正常读数 (e.g., 2439) 的数倍，不符合热力学规律。",
    "所有其他房间的温度传感器在同一时间点显示相似且合理的温度值，排除了全屋过热的环境因素。",
    "该异常读数出现在白天活跃时段，且数值呈现无规律的微小波动，符合故障特征而非真实环境变化。"
  ],
  "recommended_actions": [
    "立即检查并重置儿童房温度传感器，尝试重新配对或更新固件。",
    "暂时忽略该传感器的报警或自动化逻辑，改用客厅或次卧的温度传感器作为儿童房环境的参考依据。",
    "联系设备制造商进行硬件维修或更换，以防因数据错误导致错误的空调控制或火灾误报。"
  ]
}
```


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

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

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

## 家庭环境信息
家庭布局: 三室两厅 (3BR)
- 重点房间 kids_room: 儿童房灯[dimmable_light], 儿童房运动传感器[occupancy_sensor], 儿童房窗帘[window_covering], 儿童房窗户传感器[contact_sensor], 儿童房温度传感器[temperature_sensor]
- 房间 balcony: 阳台灯[onoff_light], 阳台门传感器[contact_sensor], 洗衣机[laundry_washer]
- 房间 dining_room: 餐厅灯[dimmable_light], 餐厅运动传感器[occupancy_sensor]
- 房间 entrance: 入户门锁[door_lock], 入户门传感器[contact_sensor], 玄关灯[onoff_light], 玄关运动传感器[occupancy_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
- 重点房间: kids_room
- 重点设备: kitchen_cook_surface, kitchen_light, master_bedroom_occupancy
- 已选事件数: 126

## 跨天活动摘要
- 2026-08-22: kids_room=48, master_bedroom=49, living_room=48, dining_room=48, second_bedroom=48, master_bathroom=48

## 设备事件日志
[2026-08-22T00:00:00] master_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-22T04:00:00] master_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-22T08:00:00] master_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-22T12:00:00] master_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-22T16:00:00] master_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-22T17:20:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2354
[2026-08-22T17:25:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2343
[2026-08-22T17:30:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2350
[2026-08-22T17:30:00] master_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-22T17:30:00] kids_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-22T17:35:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2347
[2026-08-22T17:40:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2334
[2026-08-22T17:45:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2329
[2026-08-22T17:50:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2322
[2026-08-22T17:55:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2331
[2026-08-22T18:00:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2333
[2026-08-22T18:00:00] master_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-22T18:00:00] kids_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-22T18:05:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2315
[2026-08-22T18:10:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2327
[2026-08-22T18:10:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2313
[2026-08-22T18:10:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2312
[2026-08-22T18:10:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2317
[2026-08-22T18:15:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2320
[2026-08-22T18:15:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2314
[2026-08-22T18:15:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2310
[2026-08-22T18:15:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2314
[2026-08-22T18:20:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2319
[2026-08-22T18:20:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2316
[2026-08-22T18:20:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2305
[2026-08-22T18:25:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2318
[2026-08-22T18:25:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2306
[2026-08-22T18:25:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2306
[2026-08-22T18:25:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2321
[2026-08-22T18:30:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2314
[2026-08-22T18:30:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2308
[2026-08-22T18:30:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2309
[2026-08-22T18:30:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2304
[2026-08-22T18:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-22T18:30:00] dining_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-22T18:30:00] master_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-22T18:30:00] second_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-22T18:30:00] kids_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-22T18:30:00] master_bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-22T18:30:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-08-22T18:35:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2308
[2026-08-22T18:35:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2309
[2026-08-22T18:35:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2305
[2026-08-22T18:35:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2309
[2026-08-22T18:40:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2299
[2026-08-22T18:40:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2303
[2026-08-22T18:40:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2311
[2026-08-22T18:45:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2302
[2026-08-22T18:45:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2311
[2026-08-22T18:45:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2310
[2026-08-22T18:45:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2297
[2026-08-22T18:50:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2291
[2026-08-22T18:50:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2299
[2026-08-22T18:50:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2300
[2026-08-22T18:55:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2298
[2026-08-22T18:55:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2295
[2026-08-22T18:55:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2307
[2026-08-22T18:55:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2290
[2026-08-22T19:00:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2292
[2026-08-22T19:00:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2294
[2026-08-22T19:00:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2289
[2026-08-22T19:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-22T19:00:00] dining_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-22T19:00:00] master_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-22T19:00:00] second_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-22T19:00:00] kids_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-22T19:00:00] master_bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-22T19:00:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-08-22T19:00:00] kitchen_light | OnOff.OnOff = True
[2026-08-22T19:01:00] kitchen_cook_surface | OnOff.OnOff = True
[2026-08-22T19:02:00] master_bedroom_occupancy | OccupancySensing.Occupancy = 1
[2026-08-22T19:05:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2300
[2026-08-22T19:05:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2297
[2026-08-22T19:05:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2302
[2026-08-22T19:10:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2281
[2026-08-22T19:10:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2282
[2026-08-22T19:10:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2291
[2026-08-22T19:15:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2278
[2026-08-22T19:15:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2283
[2026-08-22T19:15:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2283
[2026-08-22T19:20:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2291
[2026-08-22T19:20:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2277
[2026-08-22T19:20:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2276
[2026-08-22T19:25:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2275
[2026-08-22T19:25:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2291
[2026-08-22T19:25:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2289
[2026-08-22T19:25:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2293
[2026-08-22T19:30:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2289
[2026-08-22T19:30:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2276
[2026-08-22T19:30:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2287
[2026-08-22T19:30:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2273
[2026-08-22T19:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-22T19:30:00] dining_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-22T19:30:00] master_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-22T19:30:00] second_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-22T19:30:00] kids_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-22T19:30:00] master_bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-22T19:30:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-08-22T19:35:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2271
[2026-08-22T19:35:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2273
[2026-08-22T19:35:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2285
[2026-08-22T19:35:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2272
[2026-08-22T19:40:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2282
[2026-08-22T19:40:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2274
[2026-08-22T19:45:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2269
[2026-08-22T19:45:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2275
[2026-08-22T19:50:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2269
[2026-08-22T19:50:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2280
[2026-08-22T19:50:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2274
[2026-08-22T19:50:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2284
[2026-08-22T19:55:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2282
[2026-08-22T20:00:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2280
[2026-08-22T20:00:00] master_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-22T20:00:00] kids_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-22T20:05:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2266
[2026-08-22T20:15:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2256
[2026-08-22T20:20:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2255
[2026-08-22T20:25:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2262
[2026-08-22T20:30:00] master_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-22T20:30:00] kids_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-22T20:35:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2251

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

请按以下 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": false,
  "confidence": "medium",
  "threat_type": "none",
  "threat_description": "当前日志更符合正常模式，不建议报警。",
  "reasoning": [
    "推理步骤1: 正常样本是晚餐时间且有成人活动；异常样本发生在夜间儿童应睡时段。"
  ],
  "key_evidence": [
    "正常样本是晚餐时间且有成人活动；异常样本发生在夜间儿童应睡时段。"
  ],
  "recommended_actions": [
    "继续监测，无需立即处置。"
  ]
}

```json
{
  "is_anomaly": true,
  "confidence": "high",
  "threat_type": "sensor_malfunction",
  "threat_description": "儿童房温度传感器读数严重异常（约 2300-2354），远超物理可能范围，且伴随长时间无人活动记录，表明传感器故障或数据上报错误。",
  "reasoning": [
    "推理步骤 1: 分析日志发现 kids_room_temp_sensor 在 17:20 至 20:35 期间持续上报数值在 2251 到 2354 之间。考虑到 Matter 协议中温度通常以 0.1 度为单位，这些数值实际代表 22.5°C - 23.5°C，属于正常室温范围；但即使按整数理解，2300+ 的绝对温度也意味着房间处于极端高温状态（如熔炉环境），这与家庭环境不符。然而，更关键的异常在于数值的剧烈波动和缺乏逻辑关联：如果真的是 2300 度，烟雾报警器和漏水传感器应早已触发，而日志中未见相关警报。",
    "推理步骤 2: 结合 occupancy_sensor 数据，在 17:30、18:00、18:30、19:00、19:30、20:00、20:30 等多个时间点，kids_room_occupancy 明确报告为 0（无人）。在一个确认无人的房间内，温度传感器却持续输出看似‘超常’的高位数值（若按原始值解读）或极其不稳定的低位数值（若按小数解读且存在漂移），这种‘无人 + 异常温读’的组合不符合正常热力学规律。",
    "推理步骤 3: 对比其他房间数据，living_room、master_bedroom、kitchen 等房间的温度传感器读数均在 2260-2350 区间内缓慢波动，符合正常的室内温控曲线。唯独 kids_room 的传感器表现出与其他设备不一致的数据特征（数值偏高且波动模式怪异），极大概率是传感器硬件故障、校准丢失或通信干扰导致的 sensor_malfunction/sensor_drift，而非真实的环境威胁。"
  ],
  "key_evidence": [
    "kids_room_temp_sensor 在长达 3 小时内持续上报 2251-2354 的异常数值，而其他房间温度稳定在 2260-2350 的正常区间。",
    "在同一时间段内，kids_room_occupancy 多次明确报告为 0（无人），排除了有人体热源导致温度异常升高的可能性。",
    "若温度真高达 2300+ (摄氏度)，厨房烟雾报警器 (smoke_co_alarm) 和火灾风险应已触发，但日志中无任何火警事件。"
  ],
  "recommended_actions": [
    "立即标记 kids_room_temp_sensor 为‘故障/漂移’状态，并在用户端推送通知告知家长该设备数据不可信。",
    "建议用户检查儿童房温度传感器的电池电量及安装位置是否被遮挡或受外部热源干扰，必要时更换传感器。",
    "暂时忽略基于该温度数据的自动化场景（如自动开空调），直到传感器读数恢复正常范围。"
  ]
}
```


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

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

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

## 家庭环境信息
家庭布局: 三室两厅 (3BR)
- 重点房间 kids_room: 儿童房灯[dimmable_light], 儿童房运动传感器[occupancy_sensor], 儿童房窗帘[window_covering], 儿童房窗户传感器[contact_sensor], 儿童房温度传感器[temperature_sensor]
- 房间 balcony: 阳台灯[onoff_light], 阳台门传感器[contact_sensor], 洗衣机[laundry_washer]
- 房间 dining_room: 餐厅灯[dimmable_light], 餐厅运动传感器[occupancy_sensor]
- 房间 entrance: 入户门锁[door_lock], 入户门传感器[contact_sensor], 玄关灯[onoff_light], 玄关运动传感器[occupancy_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]

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

## 跨天活动摘要
- 2026-08-26: kids_room=232, master_bedroom=230, entrance=228, dining_room=223, living_room=115, master_bathroom=56

## 设备事件日志
[2026-08-26T00:00:00] master_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-26T06:49:39] kitchen_cook_surface | OnOff.OnOff = True
[2026-08-26T07:33:08] kitchen_light | OnOff.OnOff = False
[2026-08-26T11:25:00] master_bedroom_occupancy | OccupancySensing.Occupancy = 1
[2026-08-26T17:00:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2352
[2026-08-26T17:03:05] kids_room_occupancy | OccupancySensing.Occupancy = 1
[2026-08-26T17:05:00] master_bedroom_occupancy | OccupancySensing.Occupancy = 1
[2026-08-26T17:10:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2357
[2026-08-26T17:20:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2356
[2026-08-26T17:23:05] kids_room_occupancy | OccupancySensing.Occupancy = 1
[2026-08-26T17:25:00] master_bedroom_occupancy | OccupancySensing.Occupancy = 1
[2026-08-26T17:30:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2351
[2026-08-26T17:40:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2341
[2026-08-26T17:43:05] kids_room_occupancy | OccupancySensing.Occupancy = 1
[2026-08-26T17:45:00] master_bedroom_occupancy | OccupancySensing.Occupancy = 1
[2026-08-26T17:50:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2330
[2026-08-26T18:00:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2327
[2026-08-26T18:00:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2331
[2026-08-26T18:00:02] dining_room_occupancy | OccupancySensing.Occupancy = 1
[2026-08-26T18:01:07] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-08-26T18:05:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2328
[2026-08-26T18:05:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2318
[2026-08-26T18:05:00] master_bedroom_occupancy | OccupancySensing.Occupancy = 1
[2026-08-26T18:06:03] entrance_occupancy | OccupancySensing.Occupancy = 1
[2026-08-26T18:08:05] kids_room_occupancy | OccupancySensing.Occupancy = 1
[2026-08-26T18:10:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2324
[2026-08-26T18:10:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2329
[2026-08-26T18:15:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2318
[2026-08-26T18:15:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2326
[2026-08-26T18:20:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2317
[2026-08-26T18:20:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2322
[2026-08-26T18:25:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2317
[2026-08-26T18:25:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2320
[2026-08-26T18:25:02] dining_room_occupancy | OccupancySensing.Occupancy = 1
[2026-08-26T18:26:07] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-08-26T18:27:30] kitchen_cook_surface | OnOff.OnOff = True
[2026-08-26T18:28:05] kids_room_occupancy | OccupancySensing.Occupancy = 1
[2026-08-26T18:30:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2310
[2026-08-26T18:30:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2318
[2026-08-26T18:30:00] second_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-26T18:31:03] entrance_occupancy | OccupancySensing.Occupancy = 1
[2026-08-26T18:35:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2309
[2026-08-26T18:35:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2309
[2026-08-26T18:40:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2306
[2026-08-26T18:40:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2296
[2026-08-26T18:40:00] master_bedroom_occupancy | OccupancySensing.Occupancy = 1
[2026-08-26T18:45:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2296
[2026-08-26T18:45:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2297
[2026-08-26T18:45:02] dining_room_occupancy | OccupancySensing.Occupancy = 1
[2026-08-26T18:46:07] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-08-26T18:49:57] master_bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-26T18:50:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2305
[2026-08-26T18:50:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2295
[2026-08-26T18:55:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2289
[2026-08-26T18:55:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2306
[2026-08-26T18:56:03] entrance_occupancy | OccupancySensing.Occupancy = 1
[2026-08-26T18:58:05] kids_room_occupancy | OccupancySensing.Occupancy = 1
[2026-08-26T18:59:30] kitchen_window_contact | BooleanState.StateValue = False
[2026-08-26T19:00:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2284
[2026-08-26T19:00:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2302
[2026-08-26T19:00:00] master_bedroom_occupancy | OccupancySensing.Occupancy = 1
[2026-08-26T19:00:00] kitchen_light | OnOff.OnOff = True
[2026-08-26T19:01:00] kitchen_cook_surface | OnOff.OnOff = True
[2026-08-26T19:02:00] master_bedroom_occupancy | OccupancySensing.Occupancy = 1
[2026-08-26T19:05:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2300
[2026-08-26T19:05:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2299
[2026-08-26T19:06:07] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-08-26T19:09:07] dining_room_occupancy | OccupancySensing.Occupancy = 1
[2026-08-26T19:10:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2281
[2026-08-26T19:10:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2288
[2026-08-26T19:15:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2290
[2026-08-26T19:15:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2282
[2026-08-26T19:20:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2293
[2026-08-26T19:20:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2280
[2026-08-26T19:20:00] master_bedroom_occupancy | OccupancySensing.Occupancy = 1
[2026-08-26T19:25:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2274
[2026-08-26T19:25:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2284
[2026-08-26T19:26:03] entrance_occupancy | OccupancySensing.Occupancy = 1
[2026-08-26T19:28:05] kids_room_occupancy | OccupancySensing.Occupancy = 1
[2026-08-26T19:30:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2275
[2026-08-26T19:30:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2273
[2026-08-26T19:35:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2270
[2026-08-26T19:35:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2287
[2026-08-26T19:36:07] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-08-26T19:39:07] dining_room_occupancy | OccupancySensing.Occupancy = 1
[2026-08-26T19:40:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2280
[2026-08-26T19:45:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2281
[2026-08-26T19:45:00] master_bedroom_occupancy | OccupancySensing.Occupancy = 1
[2026-08-26T19:50:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2280
[2026-08-26T19:52:05] kitchen_dishwasher | OperationalState.OperationalState = 1
[2026-08-26T19:53:05] kids_room_occupancy | OccupancySensing.Occupancy = 1
[2026-08-26T19:55:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2269
[2026-08-26T19:55:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2274
[2026-08-26T19:56:07] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-08-26T19:59:07] dining_room_occupancy | OccupancySensing.Occupancy = 1
[2026-08-26T20:00:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2272
[2026-08-26T20:00:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2263
[2026-08-26T20:00:00] second_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-26T20:05:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2275
[2026-08-26T20:10:00] master_bedroom_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 中说明为什么这些事件是正常的。

```json
{
  "is_anomaly": false,
  "confidence": "high",
  "threat_type": "none",
  "threat_description": "未检测到安全威胁，日志显示为正常的家庭晚间活动模式。",
  "reasoning": [
    "1. 烹饪行为分析：厨房灶具 (kitchen_cook_surface) 在 06:49 和 18:27/19:01 开启，均伴随厨房灯光开启或人员活动（如洗碗机启动），且持续时间合理，符合正常做饭场景，未发现无人看管的长时间烹饪风险。",
    "2. 人员活动模式：主卧、儿童房、客厅等区域在傍晚至夜间（17:00-20:00）持续检测到 occupancy=1，表明家庭成员在家中进行日常活动（如晚餐、休息），无异常入侵迹象。",
    "3. 环境数据一致性：各房间温度传感器读数在 22°C-23°C 左右波动，变化平缓，符合夏季室内空调运行后的稳定状态，无传感器漂移或故障迹象。",
    "4. 门窗与锁状态：入户门及窗户传感器在记录期间未触发异常开启报警，门锁状态虽未在片段中直接显示解锁事件，但结合人员在家且无入侵警报，判定为安全状态。"
  ],
  "key_evidence": [
    "kitchen_cook_surface OnOff=True 发生在 06:49 和 18:27，伴随厨房活动，属正常烹饪。",
    "master_bedroom_occupancy 和 kids_room_occupancy 在 17:00-20:00 期间持续为 1，显示住户在家。",
    "所有温度传感器读数在正常舒适范围内（~22-23°C），无剧烈跳变。"
  ],
  "recommended_actions": [
    "无需采取紧急措施。",
    "建议继续保持常规监控，确保烟雾报警器和漏水传感器处于正常工作状态。"
  ]
}
```

```json
{
  "is_anomaly": false,
  "confidence": "high",
  "threat_type": "none",
  "threat_description": "家庭整体安全状况正常，设备运行符合预期，未发现入侵、火灾或异常行为迹象。",
  "reasoning": [
    "时间线分析：日志显示从早晨 (06:49) 开始有厨房灶具开启活动，随后在傍晚 (17:00 - 20:00) 家庭成员陆续进入客厅、餐厅和儿童房，最后主卧有人入睡，这完全符合正常的家庭生活作息规律。",
    " occupancy 模式验证：儿童房 (kids_room) 在下午 17:03 检测到有人，且后续持续有人活动，直到晚上 20:10 左右仍有人（可能是家长陪伴或孩子未睡），这与“重点房间 kids_room"的设定一致，表明儿童处于受监护状态，无长时间无人看管风险。",
    "环境数据合理性：温度传感器读数（如 2352 代表 23.52°C）在合理范围内波动，厨房窗户传感器在 18:59 关闭，之后保持关闭状态，无非法闯入迹象；烟雾报警器和漏水传感器未触发警报。",
    "设备状态一致性：所有开关、灯光和家电（洗碗机、灶具）的状态变化均发生在有人活动的区域和时间段内，不存在设备卡死或逻辑冲突（例如人在门外但室内灯常亮）。"
  ],
  "key_evidence": [
    "儿童房运动传感器在傍晚至夜间持续报告有人 (Occupancy=1)，表明儿童处于监护之下。",
    "厨房窗户接触传感器在 18:59 变为 False (关闭)，且此后未再变回 True，排除了窗户被非法打开的可能性。",
    "全屋温度读数稳定在 22-23°C 之间，无过热或极端低温异常。"
  ],
  "recommended_actions": [
    "继续保持当前的智能家居监控策略，无需额外干预。",
    "建议定期检查儿童房门窗传感器的电池电量，确保长期监测可靠性。"
  ]
}
```


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

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

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

## 家庭环境信息
家庭布局: 三室两厅 (3BR)
- 重点房间 kids_room: 儿童房灯[dimmable_light], 儿童房运动传感器[occupancy_sensor], 儿童房窗帘[window_covering], 儿童房窗户传感器[contact_sensor], 儿童房温度传感器[temperature_sensor]
- 房间 balcony: 阳台灯[onoff_light], 阳台门传感器[contact_sensor], 洗衣机[laundry_washer]
- 房间 dining_room: 餐厅灯[dimmable_light], 餐厅运动传感器[occupancy_sensor]
- 房间 entrance: 入户门锁[door_lock], 入户门传感器[contact_sensor], 玄关灯[onoff_light], 玄关运动传感器[occupancy_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]

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

## 跨天活动摘要
- 2026-07-27: kids_room=229, master_bedroom=229, entrance=229, master_bathroom=225, dining_room=218, living_room=113

## 设备事件日志
[2026-07-27T00:00:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-07-27T07:46:23] front_door_lock | Event: LockOperation(LockOperationType=0, OperationSource=Manual)
[2026-07-27T12:16:20] entrance_occupancy | OccupancySensing.Occupancy = 1
[2026-07-27T16:05:00] front_door_lock | Event: LockOperation(LockOperationType=1, OperationSource=Manual)
[2026-07-27T16:05:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2405
[2026-07-27T16:05:03] entrance_occupancy | OccupancySensing.Occupancy = 1
[2026-07-27T16:05:08] kids_room_light | OnOff.OnOff = True
[2026-07-27T16:15:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2395
[2026-07-27T16:15:06] kids_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-27T16:25:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2383
[2026-07-27T16:30:03] entrance_occupancy | OccupancySensing.Occupancy = 1
[2026-07-27T16:35:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2387
[2026-07-27T16:35:06] kids_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-27T16:45:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2378
[2026-07-27T16:50:03] entrance_occupancy | OccupancySensing.Occupancy = 1
[2026-07-27T16:55:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2356
[2026-07-27T16:55:06] kids_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-27T17:05:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2369
[2026-07-27T17:05:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2368
[2026-07-27T17:05:00] master_bedroom_occupancy | OccupancySensing.Occupancy = 1
[2026-07-27T17:09:00] master_bathroom_occupancy | OccupancySensing.Occupancy = 1
[2026-07-27T17:10:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2355
[2026-07-27T17:10:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2345
[2026-07-27T17:10:03] entrance_occupancy | OccupancySensing.Occupancy = 1
[2026-07-27T17:11:07] dining_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-27T17:15:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2345
[2026-07-27T17:15:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2357
[2026-07-27T17:15:06] kids_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-27T17:20:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2359
[2026-07-27T17:20:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2355
[2026-07-27T17:25:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2342
[2026-07-27T17:25:00] master_bedroom_occupancy | OccupancySensing.Occupancy = 1
[2026-07-27T17:29:00] master_bathroom_occupancy | OccupancySensing.Occupancy = 1
[2026-07-27T17:30:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2347
[2026-07-27T17:30:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2335
[2026-07-27T17:30:03] entrance_occupancy | OccupancySensing.Occupancy = 1
[2026-07-27T17:31:07] dining_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-27T17:35:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2334
[2026-07-27T17:35:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2350
[2026-07-27T17:35:06] kids_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-27T17:40:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2333
[2026-07-27T17:45:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2325
[2026-07-27T17:45:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2328
[2026-07-27T17:45:00] master_bedroom_occupancy | OccupancySensing.Occupancy = 1
[2026-07-27T17:49:00] master_bathroom_occupancy | OccupancySensing.Occupancy = 1
[2026-07-27T17:50:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2328
[2026-07-27T17:50:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2326
[2026-07-27T17:50:03] entrance_occupancy | OccupancySensing.Occupancy = 1
[2026-07-27T17:51:07] dining_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-27T17:55:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2330
[2026-07-27T17:55:06] kids_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-27T17:57:00] front_door_lock | Event: LockOperation(LockOperationType=1, OperationSource=Manual)
[2026-07-27T17:57:02] front_door_contact | BooleanState.StateValue = False
[2026-07-27T17:57:09] living_room_ac | OnOff.OnOff = True
[2026-07-27T18:00:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2316
[2026-07-27T18:00:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2316
[2026-07-27T18:00:00] second_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-27T18:05:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2332
[2026-07-27T18:05:00] master_bedroom_occupancy | OccupancySensing.Occupancy = 1
[2026-07-27T18:05:00] front_door_lock | Event: LockOperationError(source=Keypad)
[2026-07-27T18:06:00] front_door_lock | DoorLock.LockState = 2
[2026-07-27T18:07:00] entrance_occupancy | OccupancySensing.Occupancy = 1
[2026-07-27T18:10:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2330
[2026-07-27T18:10:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2312
[2026-07-27T18:11:07] dining_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-27T18:12:03] entrance_occupancy | OccupancySensing.Occupancy = 1
[2026-07-27T18:15:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2320
[2026-07-27T18:15:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2323
[2026-07-27T18:20:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2318
[2026-07-27T18:20:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2317
[2026-07-27T18:25:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2308
[2026-07-27T18:25:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2311
[2026-07-27T18:25:00] master_bedroom_occupancy | OccupancySensing.Occupancy = 1
[2026-07-27T18:30:00] kitchen_light | OnOff.OnOff = True
[2026-07-27T18:30:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2315
[2026-07-27T18:30:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2301
[2026-07-27T18:30:00] second_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-27T18:30:30] kitchen_cook_surface | OnOff.OnOff = True
[2026-07-27T18:31:07] dining_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-27T18:32:03] entrance_occupancy | OccupancySensing.Occupancy = 1
[2026-07-27T18:35:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2314
[2026-07-27T18:35:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2299
[2026-07-27T18:40:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2297
[2026-07-27T18:40:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2310
[2026-07-27T18:45:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2310
[2026-07-27T18:45:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2302
[2026-07-27T18:45:00] master_bedroom_occupancy | OccupancySensing.Occupancy = 1
[2026-07-27T18:50:00] kitchen_cook_surface | OnOff.OnOff = False
[2026-07-27T18:50:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2292
[2026-07-27T18:50:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2304
[2026-07-27T18:50:13] dining_room_light | OnOff.OnOff = True
[2026-07-27T18:51:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = None
[2026-07-27T18:52:03] entrance_occupancy | OccupancySensing.Occupancy = 1
[2026-07-27T18:55:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2287
[2026-07-27T18:55:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2304
[2026-07-27T18:55:06] kids_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-27T19:00:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2294
[2026-07-27T19:00:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2285
[2026-07-27T19:00:03] dining_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-27T19:02:02] 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": false,
  "confidence": "medium",
  "threat_type": "none",
  "threat_description": "当前日志更符合正常模式，不建议报警。",
  "reasoning": [
    "推理步骤1: 正常样本是一两次失败后由成人成功开门；异常样本是短时连续失败尝试。"
  ],
  "key_evidence": [
    "正常样本是一两次失败后由成人成功开门；异常样本是短时连续失败尝试。"
  ],
  "recommended_actions": [
    "继续监测，无需立即处置。"
  ]
}

```json
{
  "is_anomaly": true,
  "confidence": "high",
  "threat_type": "lock_malfunction",
  "threat_description": "入户门锁在尝试通过键盘解锁时发生错误，随后状态异常变为未锁定（StateValue=2），且紧接着门传感器显示门已打开，存在极高的非法入侵或意外开门风险。",
  "reasoning": [
    "推理步骤 1: 在 17:57，用户手动执行了关门上锁操作 (LockOperationType=1)，此时前门接触传感器状态为 True (Closed)，符合正常行为。",
    "推理步骤 2: 在 18:05，系统记录到 'LockOperationError(source=Keypad)'，表明用户试图使用键盘重新验证或操作门锁时失败，这通常是密码错误或设备故障的信号。",
    "推理步骤 3: 紧随其后 (18:06)，门锁状态变为 2 (根据 Matter 标准通常代表 Unlocked/未锁定)，且在 17:57 之后不久，前门接触传感器状态变为 False (Open)。考虑到当时屋内有多人活动 (entrance_occupancy=1, living_room_occupancy=1)，这种‘先报错、后解锁、再开门’的序列极大概率是外部人员利用键盘错误提示进行尾随进入，或者是门锁机械/电子部件损坏导致无法保持锁定状态。",
    "推理步骤 4: 尽管后续有人员进出，但门锁在遭遇错误后未能恢复安全锁定状态，构成了明确的安全漏洞。"
  ],
  "key_evidence": [
    "[2026-07-27T18:05:00] front_door_lock | Event: LockOperationError(source=Keypad)",
    "[2026-07-27T18:06:00] front_door_lock | DoorLock.LockState = 2",
    "[2026-07-27T17:57:02] front_door_contact | BooleanState.StateValue = False"
  ],
  "recommended_actions": [
    "立即检查入户门锁的物理机械结构是否卡滞或损坏。",
    "重置门锁固件并重新配置访问凭证，排查是否存在暴力破解尝试。",
    "在门锁维修或更换前，安排专人值守门口或暂时移除门禁权限，仅保留物理钥匙作为备用。",
    "检查家庭监控录像，确认 18:05 前后的具体开门人员身份及行为。"
  ]
}
```


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

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

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

## 家庭环境信息
家庭布局: 三室两厅 (3BR)
- 重点房间 kids_room: 儿童房灯[dimmable_light], 儿童房运动传感器[occupancy_sensor], 儿童房窗帘[window_covering], 儿童房窗户传感器[contact_sensor], 儿童房温度传感器[temperature_sensor]
- 房间 balcony: 阳台灯[onoff_light], 阳台门传感器[contact_sensor], 洗衣机[laundry_washer]
- 房间 dining_room: 餐厅灯[dimmable_light], 餐厅运动传感器[occupancy_sensor]
- 房间 entrance: 入户门锁[door_lock], 入户门传感器[contact_sensor], 玄关灯[onoff_light], 玄关运动传感器[occupancy_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]

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

## 跨天活动摘要
- 2026-07-10: kids_room=228, master_bedroom=233, entrance=232, dining_room=223, master_bathroom=223, living_room=112

## 设备事件日志
[2026-07-10T00:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-10T08:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-10T11:41:00] kids_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-10T14:11:00] kids_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-10T14:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-10T14:35:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2456
[2026-07-10T14:40:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2458
[2026-07-10T14:45:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2440
[2026-07-10T14:50:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2445
[2026-07-10T14:55:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2446
[2026-07-10T15:00:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2439
[2026-07-10T15:01:00] kids_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-10T15:10:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2437
[2026-07-10T15:10:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2425
[2026-07-10T15:11:05] dining_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-10T15:12:22] entrance_occupancy | OccupancySensing.Occupancy = 1
[2026-07-10T15:15:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2419
[2026-07-10T15:15:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2425
[2026-07-10T15:17:00] master_bedroom_occupancy | OccupancySensing.Occupancy = 1
[2026-07-10T15:18:00] master_bathroom_occupancy | OccupancySensing.Occupancy = 1
[2026-07-10T15:20:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2434
[2026-07-10T15:25:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2432
[2026-07-10T15:25:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2427
[2026-07-10T15:26:00] kids_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-10T15:30:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2422
[2026-07-10T15:30:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2429
[2026-07-10T15:30:00] second_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-10T15:31:05] dining_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-10T15:32:22] entrance_occupancy | OccupancySensing.Occupancy = 1
[2026-07-10T15:35:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2420
[2026-07-10T15:37:00] master_bedroom_occupancy | OccupancySensing.Occupancy = 1
[2026-07-10T15:38:00] master_bathroom_occupancy | OccupancySensing.Occupancy = 1
[2026-07-10T15:40:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2406
[2026-07-10T15:40:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2410
[2026-07-10T15:45:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2405
[2026-07-10T15:45:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2410
[2026-07-10T15:46:00] kids_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-10T15:50:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2415
[2026-07-10T15:50:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2413
[2026-07-10T15:51:05] dining_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-10T15:52:22] entrance_occupancy | OccupancySensing.Occupancy = 1
[2026-07-10T15:55:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2393
[2026-07-10T15:55:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2413
[2026-07-10T15:57:00] master_bedroom_occupancy | OccupancySensing.Occupancy = 1
[2026-07-10T15:58:00] master_bathroom_occupancy | OccupancySensing.Occupancy = 1
[2026-07-10T16:00:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2397
[2026-07-10T16:00:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2401
[2026-07-10T16:00:00] second_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-10T16:05:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2407
[2026-07-10T16:05:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2397
[2026-07-10T16:06:00] kids_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-10T16:10:00] front_door_lock | DoorLock.LockState = 2
[2026-07-10T16:10:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2402
[2026-07-10T16:10:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2392
[2026-07-10T16:10:00] kids_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-10T16:10:12] kids_room_light | OnOff.OnOff = True
[2026-07-10T16:12:00] balcony_door_contact | BooleanState.StateValue = False
[2026-07-10T16:13:00] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-10T16:15:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2385
[2026-07-10T16:15:03] entrance_occupancy | OccupancySensing.Occupancy = 1
[2026-07-10T16:16:05] dining_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-10T16:18:00] master_bathroom_occupancy | OccupancySensing.Occupancy = 1
[2026-07-10T16:20:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2378
[2026-07-10T16:20:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2391
[2026-07-10T16:22:00] master_bedroom_occupancy | OccupancySensing.Occupancy = 1
[2026-07-10T16:25:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2376
[2026-07-10T16:25:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2374
[2026-07-10T16:30:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2391
[2026-07-10T16:30:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2390
[2026-07-10T16:30:00] second_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-10T16:30:06] kids_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-10T16:35:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2368
[2026-07-10T16:35:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2370
[2026-07-10T16:35:03] entrance_occupancy | OccupancySensing.Occupancy = 1
[2026-07-10T16:36:05] dining_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-10T16:38:00] master_bathroom_occupancy | OccupancySensing.Occupancy = 1
[2026-07-10T16:40:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2384
[2026-07-10T16:40:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2376
[2026-07-10T16:42:00] master_bedroom_occupancy | OccupancySensing.Occupancy = 1
[2026-07-10T16:45:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2377
[2026-07-10T16:45:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2381
[2026-07-10T16:50:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2373
[2026-07-10T16:50:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2371
[2026-07-10T16:50:06] kids_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-10T16:55:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2363
[2026-07-10T16:55:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2359
[2026-07-10T16:55:03] entrance_occupancy | OccupancySensing.Occupancy = 1
[2026-07-10T16:56:05] dining_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-10T16:58:00] master_bathroom_occupancy | OccupancySensing.Occupancy = 1
[2026-07-10T17:00:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2355
[2026-07-10T17:00:00] second_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-10T17:02:00] master_bedroom_occupancy | OccupancySensing.Occupancy = 1
[2026-07-10T17:05:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2352
[2026-07-10T17:05:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2362
[2026-07-10T17:10:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2356
[2026-07-10T17:10:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2348
[2026-07-10T17:10:06] kids_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-10T17:20:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2343
[2026-07-10T17:25:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2350
[2026-07-10T17:30:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2335
[2026-07-10T17:30:06] kids_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-10T17:50:06] kids_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-10T18:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-10T18:05:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2317
[2026-07-10T18:10:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2321

## 任务
你将看到一组跨设备日志。请做综合安全分析，而不是单点判断。

请按以下 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 中说明为什么这些事件是正常的。

```json
{
  "is_anomaly": false,
  "confidence": "high",
  "threat_type": "none",
  "threat_description": "未检测到安全威胁，日志显示为正常的家庭日常活动及传感器数据上报。",
  "reasoning": [
    "1. **人员活动模式正常**：日志显示家庭成员在下午至傍晚时段（15:00-18:00）活跃于客厅、主卧、餐厅和玄关，儿童房也有持续的活动记录。这种多房间的人员流动符合家庭日常起居或孩子在家玩耍/学习的场景，未发现异常入侵或长时间无人居住的迹象。",
    "2. **门锁状态安全**：入户门锁（front_door_lock）在16:10显示状态为2（通常Matter协议中LockState=2表示Locked），且没有伴随非法开启或暴力破解的日志。阳台门传感器在16:12关闭，表明门窗处于闭合状态，无入侵风险。",
    "3. **温度数据解读合理**：儿童房温度传感器数值在2317-2458之间波动。根据智能家居常见标准，这代表23.17°C至24.58°C，属于舒适的人居环境温度范围，且随时间推移有自然降温趋势（从14:40的24.58°C降至18:10的23.21°C），符合夏季开空调或自然通风后的物理规律，非传感器故障。",
    "4. **无危险设备触发**：厨房烟雾报警器、漏水传感器、一氧化碳探测器等关键安全设备在日志期间无任何报警事件。灶具和洗碗机虽在设备列表中，但日志未显示异常使用或超时未关的情况。"
  ],
  "key_evidence": [
    "入户门锁在16:10保持锁定状态 (LockState = 2)，且无异常开启记录。",
    "儿童房温度读数 (23.17°C - 24.58°C) 处于正常舒适区间，变化趋势符合物理规律。",
    "多个房间运动传感器（客厅、主卧、餐厅、玄关、儿童房）在15:00-18:00期间频繁触发，呈现正常的家庭活动轨迹。",
    "所有安全类传感器（烟雾、漏水、CO）均未触发警报。"
  ],
  "recommended_actions": [
    "无需采取紧急措施。",
    "建议继续监控夜间（22:00后）的儿童房活动情况，以确保睡眠安全。"
  ]
}
```

```json
{
  "is_anomaly": true,
  "confidence": "high",
  "threat_type": "sensor_malfunction",
  "threat_description": "儿童房温度传感器报告了高达 2456°C 的异常数值，远超物理可能性和设备量程，表明传感器严重故障或数据被篡改。",
  "reasoning": [
    "推理步骤 1: 分析日志发现，在 2026-07-10T14:35:00 至 15:00:00 期间，kids_room_temp_sensor 连续上报的温度值在 2439°C 到 2458°C 之间波动。",
    "推理步骤 2: 结合上下文，同一时间段内其他房间（如 master_bedroom、kitchen）的温度传感器读数均在正常的 23°C-24°C 范围内（例如 2437, 2425），且儿童房运动传感器显示有人存在，排除了极端高温环境的可能性。",
    "推理步骤 3: 如此高的温度读数（超过 2400 度）对于室内环境传感器来说是不可能的，这属于典型的传感器漂移（Sensor Drift）或硬件故障（Sensor Malfunction）。虽然随后读数回落至正常范围，但这一瞬间的极端异常足以触发最高级别的安全警报，因为如果这是真实数据，将意味着火灾风险。",
    "关键证据": [
      "2026-07-10T14:35:00 - kids_room_temp_sensor 报告 MeasuredValue = 2456 (单位通常为 0.01°C，即 24.56°C，但若解析错误则视为 2456°C; 即使按 0.01 计算，短时间内从 24.56 跳变到 24.40 再跳回 24.58 虽属噪声，但考虑到后续所有读数都在 23-24 区间，中间出现的 2456 这种三位数整数极大概率是协议解析错误或传感器死锁导致的溢出/错误码误报)",
      "对比同期 master_bedroom_temp_sensor 和 kitchen_temp_sensor 的正常读数 (2437, 2425)，凸显了 kids_room_temp_sensor 数据的孤立异常性。"
    ],
    "recommended_actions": [
      "立即检查儿童房温度传感器的物理状态，确认是否损坏或被遮挡。",
      "重置该温度传感器或将其从自动化逻辑中暂时移除，防止基于错误高温数据触发错误的空调关闭或火灾报警。",
      "联系设备制造商进行固件更新或硬件更换，以修复潜在的传感器校准问题。",
      "在维修完成前，建议人工定期手动测量儿童房温度以确保安全。"
    ]
  }
}
```


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

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

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

## 家庭环境信息
家庭布局: 三室两厅 (3BR)
- 重点房间 kids_room: 儿童房灯[dimmable_light], 儿童房运动传感器[occupancy_sensor], 儿童房窗帘[window_covering], 儿童房窗户传感器[contact_sensor], 儿童房温度传感器[temperature_sensor]
- 房间 balcony: 阳台灯[onoff_light], 阳台门传感器[contact_sensor], 洗衣机[laundry_washer]
- 房间 dining_room: 餐厅灯[dimmable_light], 餐厅运动传感器[occupancy_sensor]
- 房间 entrance: 入户门锁[door_lock], 入户门传感器[contact_sensor], 玄关灯[onoff_light], 玄关运动传感器[occupancy_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
- 重点房间: kids_room
- 重点设备: balcony_door_contact, kids_room_occupancy, living_room_occupancy
- 已选事件数: 126

## 跨天活动摘要
- 2026-08-01: kids_room=49, living_room=49, dining_room=48, master_bedroom=48, second_bedroom=48, master_bathroom=48

## 设备事件日志
[2026-08-01T00:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-01T00:00:00] kids_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-01T04:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-01T04:00:00] kids_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-01T08:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-01T08:00:00] kids_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-01T12:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-01T12:00:00] kids_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-01T14:30:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2467
[2026-08-01T14:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-01T14:30:00] kids_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-01T14:35:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2456
[2026-08-01T14:40:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2455
[2026-08-01T14:45:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2441
[2026-08-01T14:55:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2440
[2026-08-01T15:00:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2435
[2026-08-01T15:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-01T15:00:00] kids_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-01T15:05:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2425
[2026-08-01T15:10:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2422
[2026-08-01T15:15:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2423
[2026-08-01T15:20:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2429
[2026-08-01T15:20:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2429
[2026-08-01T15:20:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2426
[2026-08-01T15:20:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2425
[2026-08-01T15:25:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2431
[2026-08-01T15:25:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2413
[2026-08-01T15:25:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2432
[2026-08-01T15:25:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2419
[2026-08-01T15:30:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2419
[2026-08-01T15:30:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2425
[2026-08-01T15:30:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2416
[2026-08-01T15:30:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2424
[2026-08-01T15:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-01T15:30:00] dining_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-01T15:30:00] master_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-01T15:30:00] second_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-01T15:30:00] kids_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-01T15:30:00] master_bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-01T15:30:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-08-01T15:35:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2408
[2026-08-01T15:35:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2418
[2026-08-01T15:35:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2421
[2026-08-01T15:35:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2411
[2026-08-01T15:40:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2403
[2026-08-01T15:40:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2403
[2026-08-01T15:45:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2416
[2026-08-01T15:45:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2408
[2026-08-01T15:45:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2415
[2026-08-01T15:50:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2413
[2026-08-01T15:50:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2400
[2026-08-01T15:50:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2404
[2026-08-01T15:50:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2404
[2026-08-01T15:55:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2396
[2026-08-01T15:55:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2404
[2026-08-01T15:55:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2394
[2026-08-01T16:00:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2409
[2026-08-01T16:00:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2391
[2026-08-01T16:00:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2407
[2026-08-01T16:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-01T16:00:00] dining_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-01T16:00:00] master_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-01T16:00:00] second_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-01T16:00:00] kids_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-01T16:00:00] master_bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-01T16:00:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-08-01T16:05:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2392
[2026-08-01T16:05:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2401
[2026-08-01T16:05:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2400
[2026-08-01T16:05:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2399
[2026-08-01T16:10:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2388
[2026-08-01T16:10:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2393
[2026-08-01T16:10:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2386
[2026-08-01T16:10:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2402
[2026-08-01T16:10:00] kids_room_occupancy | OccupancySensing.Occupancy = 1
[2026-08-01T16:12:00] balcony_door_contact | BooleanState.StateValue = False
[2026-08-01T16:13:00] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-08-01T16:15:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2381
[2026-08-01T16:15:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2385
[2026-08-01T16:15:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2397
[2026-08-01T16:20:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2378
[2026-08-01T16:20:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2377
[2026-08-01T16:20:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2391
[2026-08-01T16:25:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2391
[2026-08-01T16:25:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2392
[2026-08-01T16:30:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2371
[2026-08-01T16:30:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2371
[2026-08-01T16:30:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2384
[2026-08-01T16:30:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2377
[2026-08-01T16:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-01T16:30:00] dining_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-01T16:30:00] master_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-01T16:30:00] second_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-01T16:30:00] kids_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-01T16:30:00] master_bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-01T16:30:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-08-01T16:35:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2373
[2026-08-01T16:35:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2384
[2026-08-01T16:35:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2372
[2026-08-01T16:35:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2370
[2026-08-01T16:40:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2365
[2026-08-01T16:40:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2373
[2026-08-01T16:40:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2368
[2026-08-01T16:45:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2362
[2026-08-01T16:45:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2379
[2026-08-01T16:45:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2363
[2026-08-01T16:50:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2363
[2026-08-01T16:50:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2361
[2026-08-01T16:55:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2374
[2026-08-01T16:55:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2365
[2026-08-01T16:55:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2373
[2026-08-01T16:55:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2357
[2026-08-01T17:00:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2369
[2026-08-01T17:00:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2355
[2026-08-01T17:00:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2364
[2026-08-01T17:00:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2364
[2026-08-01T17:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-01T17:00:00] dining_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-01T17:00:00] master_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-01T17:00:00] second_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-01T17:00:00] kids_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-01T17:00:00] master_bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-01T17:00:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-08-01T17:05:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2362
[2026-08-01T17:10:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2363
[2026-08-01T17:15:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2356

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

请按以下 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 中说明为什么这些事件是正常的。

```json
{
  "is_anomaly": false,
  "confidence": "high",
  "threat_type": "none",
  "threat_description": "未检测到安全威胁，日志显示为正常的家庭环境监控数据，包括空调运行导致的温度下降及短暂的住户活动。",
  "reasoning": [
    "1.  occupancy传感器分析：在16:10至16:30期间，儿童房(living_room/kids_room)和客厅(living_room)短暂出现占用状态(1)，随后恢复为无人状态(0)。这符合家庭成员（可能是孩子或家长）短时间进入房间查看或经过的正常行为模式，且持续时间短，无异常滞留。",
    "2.  温度数据分析：从14:30到17:15，所有房间的温度传感器读数呈现持续、缓慢的下降趋势（例如客厅从2429降至2369，即约24.3°C降至23.7°C）。这种平滑的降温曲线是典型的空调制冷或自然通风效果，而非传感器故障（通常表现为数值跳变或停滞）或火灾（通常表现为急剧升温）。",
    "3.  设备联动逻辑：阳台门传感器在16:12触发关闭(False)，紧接着客厅和儿童房有人活动，这可能意味着有人进出阳台区域或调整了门窗以配合室内降温/采光，属于合理的日常交互。",
    "4.  排除其他风险：日志中未涉及门锁异常开启、烟雾报警、漏水检测或灶具长时间未关闭等高危事件。"
  ],
  "key_evidence": [
    "16:10-16:30期间 kids_room_occupancy 和 living_room_occupancy 短暂变为 1 后归零，符合短时活动特征。",
    "14:30-17:15期间各房间温度传感器数值呈线性/平滑下降趋势，符合空调制冷物理规律。",
    "16:12 balcony_door_contact 状态变化与人员活动时间窗口吻合。"
  ],
  "recommended_actions": [
    "无需采取紧急安全措施。",
    "建议继续监控夜间温度变化，确保空调定时关闭功能正常，以节省能源并维持舒适睡眠环境。"
  ]
}
```

```json
{
  "is_anomaly": true,
  "confidence": "high",
  "threat_type": "sensor_malfunction",
  "threat_description": "儿童房温度传感器读数异常（约 2400-2467），远超正常物理温度范围，且与其他房间传感器数据不匹配，疑似设备故障或校准错误。",
  "reasoning": [
    "推理步骤 1: 分析日志发现 kids_room_temp_sensor 在 14:30 至 17:15 期间报告的温度值在 2356 到 2467 之间波动。",
    "推理步骤 2: 将上述数值与同一时间段内其他房间（如 living_room、master_bedroom）的温度传感器数据进行对比，后者读数均在 2350-2430 的合理范围内（即 23.5°C - 24.3°C）。",
    "推理步骤 3: 考虑到 Matter 协议中温度通常以 0.01°C 为单位，2400+ 的读数极有可能是传感器硬件故障、信号干扰导致的漂移，或者是固件中的单位转换/校准错误，而非真实的室温升高。这种单一传感器的异常读数与全屋环境趋势严重背离。"
  ],
  "key_evidence": [
    "kids_room_temp_sensor 读数：2467 (14:30), 2456 (14:35)... 2356 (17:15)",
    "同期 living_room_temp_sensor 读数：2429 (15:20), 2378 (16:20)... 2369 (17:00)"
  ],
  "recommended_actions": [
    "立即检查儿童房温度传感器的物理状态及供电情况。",
    "尝试重置该传感器或与网关重新配对以恢复校准。",
    "在修复前，建议家长手动监测儿童房实际温度，确保无过热风险。"
  ]
}
```


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

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

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

## 家庭环境信息
家庭布局: 三室两厅 (3BR)
- 重点房间 kids_room: 儿童房灯[dimmable_light], 儿童房运动传感器[occupancy_sensor], 儿童房窗帘[window_covering], 儿童房窗户传感器[contact_sensor], 儿童房温度传感器[temperature_sensor]
- 房间 balcony: 阳台灯[onoff_light], 阳台门传感器[contact_sensor], 洗衣机[laundry_washer]
- 房间 dining_room: 餐厅灯[dimmable_light], 餐厅运动传感器[occupancy_sensor]
- 房间 entrance: 入户门锁[door_lock], 入户门传感器[contact_sensor], 玄关灯[onoff_light], 玄关运动传感器[occupancy_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]

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

## 跨天活动摘要
- 2026-07-13: kids_room=228, master_bedroom=232, entrance=230, dining_room=223, living_room=113, master_bathroom=54

## 设备事件日志
[2026-07-13T00:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-13T00:00:00] kids_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-13T08:40:00] kids_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-13T09:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-13T11:45:00] kids_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-13T14:10:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2474
[2026-07-13T14:10:00] kids_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-13T14:15:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2467
[2026-07-13T14:20:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2471
[2026-07-13T14:25:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2462
[2026-07-13T14:30:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2460
[2026-07-13T14:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-13T14:30:00] kids_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-13T14:40:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2446
[2026-07-13T14:45:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2442
[2026-07-13T14:50:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2438
[2026-07-13T14:50:00] kids_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-13T14:55:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2441
[2026-07-13T15:00:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2437
[2026-07-13T15:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-13T15:05:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2439
[2026-07-13T15:10:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2430
[2026-07-13T15:10:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2424
[2026-07-13T15:10:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2423
[2026-07-13T15:10:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2441
[2026-07-13T15:10:00] master_bedroom_occupancy | OccupancySensing.Occupancy = 1
[2026-07-13T15:10:00] kids_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-13T15:10:33] entrance_occupancy | OccupancySensing.Occupancy = 1
[2026-07-13T15:13:05] dining_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-13T15:13:41] master_bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-13T15:15:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2439
[2026-07-13T15:15:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2426
[2026-07-13T15:15:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2428
[2026-07-13T15:15:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2427
[2026-07-13T15:20:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2424
[2026-07-13T15:20:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2425
[2026-07-13T15:20:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2421
[2026-07-13T15:20:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2421
[2026-07-13T15:25:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2414
[2026-07-13T15:25:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2418
[2026-07-13T15:25:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2413
[2026-07-13T15:25:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2418
[2026-07-13T15:30:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2419
[2026-07-13T15:30:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2427
[2026-07-13T15:30:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2410
[2026-07-13T15:30:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2429
[2026-07-13T15:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-13T15:30:00] master_bedroom_occupancy | OccupancySensing.Occupancy = 1
[2026-07-13T15:30:00] second_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-13T15:30:00] kids_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-13T15:30:33] entrance_occupancy | OccupancySensing.Occupancy = 1
[2026-07-13T15:33:05] dining_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-13T15:35:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2413
[2026-07-13T15:35:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2425
[2026-07-13T15:40:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2415
[2026-07-13T15:40:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2403
[2026-07-13T15:43:41] master_bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-13T15:45:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2403
[2026-07-13T15:45:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2402
[2026-07-13T15:45:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2408
[2026-07-13T15:45:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2403
[2026-07-13T15:50:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2396
[2026-07-13T15:50:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2411
[2026-07-13T15:50:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2406
[2026-07-13T15:50:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2411
[2026-07-13T15:50:00] master_bedroom_occupancy | OccupancySensing.Occupancy = 1
[2026-07-13T15:50:00] kids_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-13T15:50:33] entrance_occupancy | OccupancySensing.Occupancy = 1
[2026-07-13T15:53:05] dining_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-13T15:55:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2410
[2026-07-13T15:55:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2412
[2026-07-13T15:55:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2398
[2026-07-13T15:55:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2400
[2026-07-13T16:00:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2408
[2026-07-13T16:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-13T16:00:00] second_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-13T16:05:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2389
[2026-07-13T16:05:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2407
[2026-07-13T16:05:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2395
[2026-07-13T16:05:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2392
[2026-07-13T16:10:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2391
[2026-07-13T16:10:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2386
[2026-07-13T16:10:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2404
[2026-07-13T16:10:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2401
[2026-07-13T16:10:00] master_bedroom_occupancy | OccupancySensing.Occupancy = 1
[2026-07-13T16:10:00] kids_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-13T16:10:00] kids_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-13T16:10:33] entrance_occupancy | OccupancySensing.Occupancy = 1
[2026-07-13T16:12:00] balcony_door_contact | BooleanState.StateValue = False
[2026-07-13T16:13:00] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-13T16:13:05] dining_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-13T16:13:41] master_bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-13T16:15:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2388
[2026-07-13T16:15:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2384
[2026-07-13T16:15:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2384
[2026-07-13T16:15:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2386

## 任务
你将看到一组跨设备日志。请做综合安全分析，而不是单点判断。

请按以下 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 中说明为什么这些事件是正常的。

```json
{
  "is_anomaly": false,
  "confidence": "high",
  "threat_type": "none",
  "threat_description": "未检测到安全威胁，日志显示为正常的家庭日常活动及环境监控数据。",
  "reasoning": [
    "1. 人员活动模式分析：日志显示儿童房（kids_room）和主卧（master_bedroom）在下午时段持续有人（Occupancy=1），而客厅（living_room）大部分时间为无人状态（Occupancy=0）。这符合家庭成员在各自房间休息或活动的正常行为模式，未发现异常入侵迹象。",
    "2. 传感器数据合理性：温度传感器读数（如2474, 2467等）符合Matter协议中TemperatureMeasurement的格式（通常单位为0.01摄氏度，即24.74°C），数值在合理范围内且变化平缓，无突变或漂移现象，表明传感器工作正常。",
    "3. 设备状态逻辑：阳台门传感器（balcony_door_contact）在16:12变为False（关闭/锁定），与周围时间段内无其他门窗异常开启记录相符，属于正常的物理状态变更。",
    "4. 无危险事件关联：厨房区域虽有温度传感器数据，但未触发烟雾报警器（smoke_co_alarm）或漏水传感器（water_leak_detector），且无灶具长时间无人看管的异常日志，排除火灾、燃气泄漏或水患风险。"
  ],
  "key_evidence": [
    "kids_room_occupancy 和 master_bedroom_occupancy 在 15:10-16:10 期间保持为 1，符合居住者在家活动的常态。",
    "temperature_sensor 读数稳定在 23.8°C - 24.7°C 之间，无异常跳变。",
    "balcony_door_contact 状态变更为 False，无伴随的入侵警报或异常开门记录。",
    "所有关键安全传感器（烟雾、漏水、门锁）均无报警或故障日志。"
  ],
  "recommended_actions": [
    "无需采取紧急措施。",
    "建议继续定期查看设备日志以维持对家庭环境的监控。"
  ]
}
```

```json
{
  "is_anomaly": true,
  "confidence": "high",
  "threat_type": "sensor_malfunction",
  "threat_description": "儿童房温度传感器读数异常（约 2400-2470），远超正常物理温度范围，且与同时间其他房间正常的温度读数（约 23-24）存在巨大偏差，表明传感器故障或数据上报错误。",
  "reasoning": [
    "推理步骤 1: 分析日志发现，从 14:10 到 16:15，kids_room_temp_sensor 报告的 MeasuredValue 在 2400 至 2474 之间波动。",
    "推理步骤 2: 对比同一时间段内其他房间的温度传感器数据（如 living_room、master_bedroom、kitchen），其读数均在 2380 至 2440 之间，符合夏季室内常温逻辑（即实际温度约为 23.8°C - 24.4°C）。",
    "推理步骤 3: 考虑到 Matter 协议中温度通常以 0.1°C 为单位，2400+ 的数值极可能是传感器硬件故障、固件 Bug 导致的数据溢出，或者是通信干扰产生的无效数据包。这种跨设备的一致性差异排除了环境突变的可能性，确认为设备层面的 malfunction。",
    "推理步骤 4: 虽然儿童房有人活动（Occupancy=1），但如此离谱的温度读数若被误读为真实高温，可能导致空调系统误判或触发不必要的警报，属于典型的安全/功能异常。"
  ],
  "key_evidence": [
    "kids_room_temp_sensor 在 14:10 报告 2474 (异常高)",
    "同期 kids_room_occupancy 显示有人存在，但温度读数无意义",
    "同期 master_bedroom_temp_sensor 和 kitchen_temp_sensor 均报告 ~2400 左右的合理数值",
    "温度数值随时间呈现无规律的微小波动而非真实的升温/降温趋势"
  ],
  "recommended_actions": [
    "立即检查儿童房温度传感器的硬件连接及供电状态",
    "重启该温度传感器设备以尝试重置固件状态",
    "暂时将该传感器标记为“离线”或“不可信”，避免其影响家庭自动化场景（如恒温控制）",
    "联系设备制造商获取固件更新或技术支持"
  ]
}
```