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

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

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

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

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

## 跨天活动摘要
- 2026-07-25: living_room=210, kitchen=241, bedroom=240, entrance=232, bathroom=59

## 设备事件日志
[2026-07-25T08:00:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2524
[2026-07-25T08:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-25T08:10:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2539
[2026-07-25T08:15:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2540
[2026-07-25T08:20:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2525
[2026-07-25T08:25:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2546
[2026-07-25T08:29:02] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-25T08:29:04] living_room_light | OnOff.OnOff = True
[2026-07-25T08:30:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2548
[2026-07-25T08:40:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2547
[2026-07-25T08:45:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2543
[2026-07-25T08:49:02] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-25T08:55:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2538
[2026-07-25T09:00:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2535
[2026-07-25T09:00:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2451
[2026-07-25T09:00:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2547
[2026-07-25T09:02:00] bedroom_occupancy | OccupancySensing.Occupancy = 1
[2026-07-25T09:03:02] kitchen_occupancy | OccupancySensing.Occupancy = 1
[2026-07-25T09:04:03] entrance_occupancy | OccupancySensing.Occupancy = 1
[2026-07-25T09:05:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2536
[2026-07-25T09:05:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2436
[2026-07-25T09:05:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2544
[2026-07-25T09:09:02] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-25T09:10:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2540
[2026-07-25T09:10:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2454
[2026-07-25T09:15:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2556
[2026-07-25T09:15:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2537
[2026-07-25T09:20:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2537
[2026-07-25T09:20:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2446
[2026-07-25T09:20:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2542
[2026-07-25T09:22:00] bedroom_occupancy | OccupancySensing.Occupancy = 1
[2026-07-25T09:23:02] kitchen_occupancy | OccupancySensing.Occupancy = 1
[2026-07-25T09:24:03] entrance_occupancy | OccupancySensing.Occupancy = 1
[2026-07-25T09:25:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2558
[2026-07-25T09:25:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2439
[2026-07-25T09:25:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2552
[2026-07-25T09:29:02] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-25T09:29:09] bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-25T09:30:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2447
[2026-07-25T09:30:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2543
[2026-07-25T09:35:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2543
[2026-07-25T09:35:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2451
[2026-07-25T09:35:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2559
[2026-07-25T09:40:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2550
[2026-07-25T09:40:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2458
[2026-07-25T09:40:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2541
[2026-07-25T09:42:00] bedroom_occupancy | OccupancySensing.Occupancy = 1
[2026-07-25T09:43:02] kitchen_occupancy | OccupancySensing.Occupancy = 1
[2026-07-25T09:44:03] entrance_occupancy | OccupancySensing.Occupancy = 1
[2026-07-25T09:45:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2545
[2026-07-25T09:45:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2449
[2026-07-25T09:45:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2551
[2026-07-25T09:49:02] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-25T09:50:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2544
[2026-07-25T09:50:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2450
[2026-07-25T09:55:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2555
[2026-07-25T09:55:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2456
[2026-07-25T09:55:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2549
[2026-07-25T09:59:09] bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-25T10:00:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2557
[2026-07-25T10:00:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2440
[2026-07-25T10:00:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2557
[2026-07-25T10:00:00] kitchen_smoke_alarm | SmokeCoAlarm.TestInProgress = True
[2026-07-25T10:01:00] living_room_smoke_alarm | SmokeCoAlarm.TestInProgress = True
[2026-07-25T10:02:00] bedroom_occupancy | OccupancySensing.Occupancy = 1
[2026-07-25T10:03:02] kitchen_occupancy | OccupancySensing.Occupancy = 1
[2026-07-25T10:04:00] kitchen_smoke_alarm | SmokeCoAlarm.TestInProgress = False
[2026-07-25T10:04:03] entrance_occupancy | OccupancySensing.Occupancy = 1
[2026-07-25T10:05:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2558
[2026-07-25T10:05:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2453
[2026-07-25T10:05:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2546
[2026-07-25T10:09:02] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-25T10:10:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2553
[2026-07-25T10:10:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2457
[2026-07-25T10:10:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2547
[2026-07-25T10:15:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2545
[2026-07-25T10:15:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2449
[2026-07-25T10:20:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2552
[2026-07-25T10:20:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2450
[2026-07-25T10:20:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2556
[2026-07-25T10:22:00] bedroom_occupancy | OccupancySensing.Occupancy = 1
[2026-07-25T10:23:02] kitchen_occupancy | OccupancySensing.Occupancy = 1
[2026-07-25T10:24:03] entrance_occupancy | OccupancySensing.Occupancy = 1
[2026-07-25T10:25:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2445
[2026-07-25T10:25:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2544

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

请按以下 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. 识别关键事件：日志在 10:00:00 显示 kitchen_smoke_alarm 和 living_room_smoke_alarm 的 SmokeCoAlarm.TestInProgress 属性变为 True，并在约 4-5 分钟后（10:04:03）恢复为 False。这是典型的智能烟雾报警器自检或手动测试行为。",
    "2. 排除真实火警：虽然两个区域的报警器同时进入测试状态，但日志中未出现 SmokeCoAlarm.AlarmState (如 Fire Alarm) 或 High CO Level 等真实报警信号。温度传感器数据在测试期间保持平稳（客厅~25.4°C，厨房~25.5°C），无异常升温，排除了因高温触发误报的可能。",
    "3. 结合住户行为分析：独居老人在上午 9:00-10:00 期间活动频繁（客厅、卧室、厨房、玄关均有 occupancy 记录），表明老人意识清醒且行动正常。此时进行设备维护或测试符合逻辑，且周围有人在场，若发生真实火情可立即响应。",
    "4. 结论：该事件为受控的设备测试行为，非安全威胁。"
  ],
  "key_evidence": [
    "[2026-07-25T10:00:00] kitchen_smoke_alarm | SmokeCoAlarm.TestInProgress = True",
    "[2026-07-25T10:01:00] living_room_smoke_alarm | SmokeCoAlarm.TestInProgress = True",
    "[2026-07-25T10:04:00] kitchen_smoke_alarm | SmokeCoAlarm.TestInProgress = False",
    "Temperature sensors show stable readings (~25°C) during the test period, indicating no fire."
  ],
  "recommended_actions": [
    "无需采取紧急安全措施。",
    "建议确认该测试是否为老人主动发起（如按下测试按钮）或系统自动计划任务，以确保老人知晓此操作，避免未来产生困惑。"
  ]
}
```

{
  "is_anomaly": true,
  "confidence": "medium",
  "threat_type": "intrusion",
  "threat_description": "这些变化表明存在安全异常。",
  "reasoning": [
    "推理步骤1: 我把本可由正常模式解释的事件误判成了异常。"
  ],
  "key_evidence": [
    "正常样本是多设备同步自检；异常样本是真实烟雾和互联联动。"
  ],
  "recommended_actions": [
    "建议立即检查并触发安全响应。"
  ]
}


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

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

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

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

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

## 设备事件日志
[2026-08-28T12:50:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2512
[2026-08-28T13:05:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2501
[2026-08-28T13:20:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2492
[2026-08-28T13:26:00] kids_room_occupancy | OccupancySensing.Occupancy = 1
[2026-08-28T13:30:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2488
[2026-08-28T13:31:00] master_bedroom_occupancy | OccupancySensing.Occupancy = 1
[2026-08-28T13:34:25] entrance_occupancy | OccupancySensing.Occupancy = 1
[2026-08-28T13:40:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2483
[2026-08-28T13:43:10] dining_room_occupancy | OccupancySensing.Occupancy = 1
[2026-08-28T13:51:00] kids_room_occupancy | OccupancySensing.Occupancy = 1
[2026-08-28T13:54:25] entrance_occupancy | OccupancySensing.Occupancy = 1
[2026-08-28T14:00:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2481
[2026-08-28T14:00:00] kitchen_dishwasher | OperationalState.OperationalState = 1
[2026-08-28T14:01:00] master_bedroom_occupancy | OccupancySensing.Occupancy = 1
[2026-08-28T14:10:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2470
[2026-08-28T14:13:10] dining_room_occupancy | OccupancySensing.Occupancy = 1
[2026-08-28T14:19:25] entrance_occupancy | OccupancySensing.Occupancy = 1
[2026-08-28T14:21:00] kids_room_occupancy | OccupancySensing.Occupancy = 1
[2026-08-28T14:30:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2456
[2026-08-28T14:30:00] kitchen_dishwasher | OperationalState.CountdownTime = 1800
[2026-08-28T14:31:00] master_bedroom_occupancy | OccupancySensing.Occupancy = 1
[2026-08-28T14:40:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2450
[2026-08-28T14:43:10] dining_room_occupancy | OccupancySensing.Occupancy = 1
[2026-08-28T14:49:25] entrance_occupancy | OccupancySensing.Occupancy = 1
[2026-08-28T14:51:00] kids_room_occupancy | OccupancySensing.Occupancy = 1
[2026-08-28T14:55:00] kitchen_dishwasher | OperationalState.OperationalState = 0
[2026-08-28T15:00:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2447
[2026-08-28T15:01:00] master_bedroom_occupancy | OccupancySensing.Occupancy = 1
[2026-08-28T15:10:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2425
[2026-08-28T15:13:10] dining_room_occupancy | OccupancySensing.Occupancy = 1
[2026-08-28T15:19:25] entrance_occupancy | OccupancySensing.Occupancy = 1
[2026-08-28T15:21:00] kids_room_occupancy | OccupancySensing.Occupancy = 1
[2026-08-28T15:30:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2410
[2026-08-28T15:35:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2409

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

请按以下 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_dishwasher 在 14:00 进入 OperationalState=1 (运行中)，并在 14:30 设置 CountdownTime=1800秒 (30分钟)，最终在 14:55 变为 OperationalState=0 (完成/停止)。这符合标准洗碗机的工作周期（约55分钟），设备行为正常。",
    "2. 分析环境数据关联：厨房温度传感器 (kitchen_temp_sensor) 的读数从 12:50 的 25.12°C 持续下降至 15:35 的 24.09°C。这种缓慢且持续的降温趋势通常由空调制冷或开窗通风引起，而非火灾或过热风险（火灾会导致温度急剧上升）。",
    "3. 排除其他威胁：虽然多个房间的运动传感器频繁触发，但这是家庭日常活动的体现；没有门锁异常、烟雾报警或漏水检测器的触发记录；温度变化方向与火灾风险相反，因此不存在 fire_risk 或 sensor_malfunction。"
  ],
  "key_evidence": [
    "kitchen_dishwasher OperationalState 从 1 变为 0，且中间有明确的倒计时设定，符合正常洗涤流程。",
    "kitchen_temp_sensor 温度值随时间单调递减 (25.12 -> 24.09)，排除了高温/火灾风险。"
  ],
  "recommended_actions": [
    "无需采取紧急安全措施。",
    "可确认洗碗机工作正常，若需优化能耗，可检查是否设置了非高峰时段运行。"
  ]
}
```

{
  "is_anomaly": true,
  "confidence": "medium",
  "threat_type": "intrusion",
  "threat_description": "这些变化表明存在安全异常。",
  "reasoning": [
    "推理步骤1: 我把本可由正常模式解释的事件误判成了异常。"
  ],
  "key_evidence": [
    "正常样本倒计时持续减少并按时停止；异常样本长时间运行且倒计时几乎不变。"
  ],
  "recommended_actions": [
    "建议立即检查并触发安全响应。"
  ]
}


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

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

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

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

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

## 设备事件日志
[2026-07-31T06:50:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2501
[2026-07-31T06:52:00] kitchen_cook_surface | OnOff.OnOff = False
[2026-07-31T06:52:30] kitchen_window_contact | BooleanState.StateValue = False
[2026-07-31T06:53:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = None
[2026-07-31T06:55:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2498
[2026-07-31T07:00:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2508
[2026-07-31T07:05:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2514
[2026-07-31T07:10:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2502
[2026-07-31T07:14:06] kitchen_light | OnOff.OnOff = False
[2026-07-31T07:20:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2517
[2026-07-31T07:25:00] kids_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-31T07:27:00] master_bedroom_occupancy | OccupancySensing.Occupancy = 1
[2026-07-31T07:27:10] dining_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-31T07:29:25] entrance_occupancy | OccupancySensing.Occupancy = 1
[2026-07-31T07:30:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2524
[2026-07-31T07:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-31T07:30:00] second_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-31T07:35:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2520
[2026-07-31T07:40:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2523
[2026-07-31T07:45:00] kids_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-31T07:46:40] master_bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-31T07:47:00] master_bedroom_occupancy | OccupancySensing.Occupancy = 1
[2026-07-31T07:47:10] dining_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-31T07:49:25] entrance_occupancy | OccupancySensing.Occupancy = 1
[2026-07-31T08:00:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2531
[2026-07-31T08:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-31T08:00:00] second_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-31T08:00:00] kitchen_smoke_alarm | SmokeCoAlarm.TestInProgress = True
[2026-07-31T08:05:00] kitchen_smoke_alarm | SmokeCoAlarm.TestInProgress = False
[2026-07-31T08:05:00] kitchen_smoke_alarm | SmokeCoAlarm.ContaminationState = 0

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

请按以下 JSON 格式回答：

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

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

```json
{
  "is_anomaly": false,
  "confidence": "high",
  "threat_type": "none",
  "threat_description": "检测到厨房烟雾报警器正在进行自检，属于正常的设备维护行为，未构成安全风险。",
  "reasoning": [
    "分析重点设备日志：在 08:00:00 时，kitchen_smoke_alarm 的 SmokeCoAlarm.TestInProgress 属性变为 True，并在 08:05:00 变为 False。这明确表明烟雾报警器正在执行自检程序（Self-test），这是智能家居安全设备的标准功能，用于验证传感器和警报器是否正常工作。",
    "排除火灾风险：虽然事件发生在早晨（08:00），且之前有灶具关闭（06:52）和窗户关闭的记录，但整个时间段内没有触发 SmokeCoAlarm.AlarmState 或 SmokeCoAlarm.SmokeDetected 等真实报警标志。TestInProgress 为 True 是主动测试而非被动响应火情。",
    "结合上下文环境：同一时间点（08:00），多个房间的运动传感器显示有人活动（如儿童房、主卧、餐厅、玄关），符合早晨家庭成员起床活动的正常作息规律。温度传感器读数稳定在 25°C 左右，无异常升温迹象。",
    "结论：该事件序列完全符合设备自检的正常逻辑，且伴随正常的家庭晨间活动模式，因此判定为无安全风险。"
  ],
  "key_evidence": [
    "[2026-07-31T08:00:00] kitchen_smoke_alarm | SmokeCoAlarm.TestInProgress = True",
    "[2026-07-31T08:05:00] kitchen_smoke_alarm | SmokeCoAlarm.TestInProgress = False",
    "[2026-07-31T08:05:00] kitchen_smoke_alarm | SmokeCoAlarm.ContaminationState = 0"
  ],
  "recommended_actions": [
    "无需采取紧急措施，系统已自动完成自检。",
    "建议用户确认家中烟雾报警器声音提示是否正常，以确认自检成功。"
  ]
}
```

{
  "is_anomaly": true,
  "confidence": "medium",
  "threat_type": "intrusion",
  "threat_description": "这些变化表明存在安全异常。",
  "reasoning": [
    "推理步骤1: 我把本可由正常模式解释的事件误判成了异常。"
  ],
  "key_evidence": [
    "正常样本是短暂自检；异常样本是污染状态跨天单向恶化。"
  ],
  "recommended_actions": [
    "建议立即检查并触发安全响应。"
  ]
}


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

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

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

## 家庭环境信息
家庭布局: 三室两厅 (3BR)
- 重点房间 kitchen: 厨房灯[onoff_light], 厨房灶具[cook_surface], 厨房烟雾报警器[smoke_co_alarm], 厨房温度传感器[temperature_sensor], 厨房窗户传感器[contact_sensor], 洗碗机[dishwasher], 厨房漏水传感器[water_leak_detector]
- 房间 balcony: 阳台灯[onoff_light], 阳台门传感器[contact_sensor], 洗衣机[laundry_washer]
- 房间 dining_room: 餐厅灯[dimmable_light], 餐厅运动传感器[occupancy_sensor]
- 房间 entrance: 入户门锁[door_lock], 入户门传感器[contact_sensor], 玄关灯[onoff_light], 玄关运动传感器[occupancy_sensor]
- 房间 kids_room: 儿童房灯[dimmable_light], 儿童房运动传感器[occupancy_sensor], 儿童房窗帘[window_covering], 儿童房窗户传感器[contact_sensor], 儿童房温度传感器[temperature_sensor]
- 房间 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
- 重点房间: kitchen
- 重点设备: kitchen_smoke_alarm
- 已选事件数: 103

## 跨天活动摘要
- 2026-08-27: kitchen=14, master_bedroom=232, kids_room=228, entrance=228, dining_room=223, living_room=111
- 2026-08-28: kitchen=11, entrance=229, master_bedroom=228, kids_room=227, master_bathroom=222, dining_room=220
- 2026-08-29: kitchen=0, living_room=48, dining_room=48, master_bedroom=48, second_bedroom=48, kids_room=48

## 设备事件日志
[2026-08-27T06:00:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2468
[2026-08-27T06:05:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2467
[2026-08-27T06:10:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2488
[2026-08-27T06:15:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2477
[2026-08-27T06:25:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2495
[2026-08-27T06:35:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2492
[2026-08-27T06:40:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2501
[2026-08-27T06:55:00] kitchen_cook_surface | OnOff.OnOff = False
[2026-08-27T06:55:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2499
[2026-08-27T06:55:30] kitchen_window_contact | BooleanState.StateValue = False
[2026-08-27T06:56:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = None
[2026-08-27T07:00:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2498
[2026-08-27T07:00:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2499
[2026-08-27T07:00:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2499
[2026-08-27T07:00:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2512
[2026-08-27T07:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-27T07:00:00] second_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-27T07:00:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-08-27T07:00:06] dining_room_occupancy | OccupancySensing.Occupancy = 1
[2026-08-27T07:02:00] master_bathroom_occupancy | OccupancySensing.Occupancy = 1
[2026-08-27T07:03:00] kids_room_occupancy | OccupancySensing.Occupancy = 1
[2026-08-27T07:04:00] master_bedroom_occupancy | OccupancySensing.Occupancy = 1
[2026-08-27T07:05:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2514
[2026-08-27T07:05:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2502
[2026-08-27T07:05:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2517
[2026-08-27T07:05:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2517
[2026-08-27T07:09:00] master_bathroom_light | OnOff.OnOff = False
[2026-08-27T07:09:08] kitchen_light | OnOff.OnOff = True
[2026-08-27T07:09:38] kitchen_cook_surface | OnOff.OnOff = True
[2026-08-27T07:09:45] master_bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-27T07:10:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2520
[2026-08-27T07:10:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2508
[2026-08-27T07:10:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2501
[2026-08-27T07:15:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2511
[2026-08-27T07:15:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2516
[2026-08-27T07:15:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2516
[2026-08-27T07:15:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2518
[2026-08-27T07:20:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2514
[2026-08-27T07:20:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2508
[2026-08-27T07:20:06] dining_room_occupancy | OccupancySensing.Occupancy = 1
[2026-08-27T07:23:00] kids_room_occupancy | OccupancySensing.Occupancy = 1
[2026-08-27T07:24:00] master_bedroom_occupancy | OccupancySensing.Occupancy = 1
[2026-08-27T07:25:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2518
[2026-08-27T07:25:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2522
[2026-08-27T07:25:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2524
[2026-08-27T07:25:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2511
[2026-08-27T07:30:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2524
[2026-08-27T07:30:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2512
[2026-08-27T07:30:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2523
[2026-08-27T07:30:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2526
[2026-08-27T07:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-27T07:30:00] second_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-27T07:30:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-08-27T07:35:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2527
[2026-08-27T07:35:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2519
[2026-08-27T07:35:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2514
[2026-08-27T07:36:00] dining_room_light | OnOff.OnOff = False
[2026-08-27T07:36:03] kitchen_light | OnOff.OnOff = False
[2026-08-27T07:36:08] master_bedroom_light | OnOff.OnOff = False
[2026-08-27T07:36:13] kids_room_light | OnOff.OnOff = False
[2026-08-27T07:36:23] front_door_lock | Event: LockOperation(LockOperationType=1, OperationSource=Manual)
[2026-08-27T07:36:23] front_door_lock | DoorLock.LockState = 2
[2026-08-27T07:36:25] front_door_contact | BooleanState.StateValue = False
[2026-08-27T07:36:26] entrance_occupancy | OccupancySensing.Occupancy = 1
[2026-08-27T07:36:33] front_door_contact | BooleanState.StateValue = True
[2026-08-27T07:36:34] front_door_lock | Event: LockOperation(LockOperationType=0, OperationSource=Manual)
[2026-08-27T07:36:34] front_door_lock | DoorLock.LockState = 1
[2026-08-27T07:39:45] master_bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-27T07:40:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2531
[2026-08-27T07:40:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2527
[2026-08-27T07:40:06] dining_room_occupancy | OccupancySensing.Occupancy = 1
[2026-08-27T07:43:00] kids_room_occupancy | OccupancySensing.Occupancy = 1
[2026-08-27T07:44:00] master_bedroom_occupancy | OccupancySensing.Occupancy = 1
[2026-08-27T07:45:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2517
[2026-08-27T07:45:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2533
[2026-08-27T07:45:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2527
[2026-08-27T07:45:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2525
[2026-08-27T07:50:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2535
[2026-08-27T07:50:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2524
[2026-08-27T07:50:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2532
[2026-08-27T07:50:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2529
[2026-08-27T07:55:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2536
[2026-08-27T07:55:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2518
[2026-08-27T07:55:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2519
[2026-08-27T07:55:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2534
[2026-08-27T07:56:26] entrance_occupancy | OccupancySensing.Occupancy = 1
[2026-08-27T08:00:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2524
[2026-08-27T08:00:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2534
[2026-08-27T08:00:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2533
[2026-08-27T08:00:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2530
[2026-08-27T08:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-27T08:00:00] second_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-27T08:00:00] kitchen_smoke_alarm | SmokeCoAlarm.TestInProgress = True
[2026-08-27T08:00:06] dining_room_occupancy | OccupancySensing.Occupancy = 1
[2026-08-27T08:03:00] kids_room_occupancy | OccupancySensing.Occupancy = 1
[2026-08-27T08:04:00] master_bedroom_occupancy | OccupancySensing.Occupancy = 1
[2026-08-27T08:05:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2539
[2026-08-27T08:05:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2527
[2026-08-27T08:05:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2530
[2026-08-27T08:05:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2521
[2026-08-27T08:05:00] kitchen_smoke_alarm | SmokeCoAlarm.TestInProgress = False
[2026-08-27T08:05:00] kitchen_smoke_alarm | SmokeCoAlarm.ContaminationState = 0
[2026-08-27T08:09:45] master_bathroom_occupancy | OccupancySensing.Occupancy = 0

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

请按以下 JSON 格式回答：

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

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

```json
{
  "is_anomaly": false,
  "confidence": "high",
  "threat_type": "none",
  "threat_description": "检测到厨房烟雾报警器正在进行自检（TestInProgress），这是正常的设备维护行为，未检测到火灾或真实威胁。",
  "reasoning": [
    "1. 分析重点设备状态：日志显示在 08:00:00 时，kitchen_smoke_alarm 的 SmokeCoAlarm.TestInProgress 属性变为 True，并在 5 分钟后的 08:05:00 变为 False，同时 ContaminationState 为 0。这明确表明用户正在执行烟雾报警器的定期自检程序，而非触发真实火警。",
    "2. 排除火灾风险：在自检期间及前后，厨房灶具（cook_surface）仅在 07:09 开启并于 07:36 关闭，之后处于关闭状态。温度传感器读数稳定在 25°C 左右（Matter协议中通常单位为0.01摄氏度，即25.00-25.34°C），无异常高温飙升，且无烟雾报警器的 'SmokeDetected' 或 'CODetected' 告警事件。",
    "3. 结合住户活动验证：早晨时段（07:00-08:00）多个房间（主卧、儿童房、餐厅、主卫）的运动传感器显示有人活动，符合家庭早起的生活规律。入户门在 07:36 有开锁和关门记录，随后玄关运动传感器激活，表明住户正常外出或在家活动，无入侵迹象。"
  ],
  "key_evidence": [
    "[2026-08-27T08:00:00] kitchen_smoke_alarm | SmokeCoAlarm.TestInProgress = True",
    "[2026-08-27T08:05:00] kitchen_smoke_alarm | SmokeCoAlarm.TestInProgress = False",
    "[2026-08-27T08:05:00] kitchen_smoke_alarm | SmokeCoAlarm.ContaminationState = 0",
    "Kitchen temperature readings remain stable around 25.00-25.34°C (no fire spike)"
  ],
  "recommended_actions": [
    "无需采取紧急安全措施。",
    "建议确认该自检操作是否为计划内的日常维护，若为非预期触发自检，可检查是否有误触或自动化规则冲突。"
  ]
}
```

{
  "is_anomaly": true,
  "confidence": "medium",
  "threat_type": "intrusion",
  "threat_description": "这些变化表明存在安全异常。",
  "reasoning": [
    "推理步骤1: 我把本可由正常模式解释的事件误判成了异常。"
  ],
  "key_evidence": [
    "正常样本是短暂自检；异常样本是污染状态跨天单向恶化。"
  ],
  "recommended_actions": [
    "建议立即检查并触发安全响应。"
  ]
}


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

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

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

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

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

## 跨天活动摘要
- 2026-07-23: living_room=207, bedroom=241, kitchen=240, entrance=231, bathroom=59

## 设备事件日志
[2026-07-23T00:00:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2274
[2026-07-23T00:00:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2275
[2026-07-23T04:00:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2399
[2026-07-23T04:05:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2412
[2026-07-23T05:57:38] kitchen_cook_surface | OnOff.OnOff = True
[2026-07-23T06:33:00] kitchen_cook_surface | OnOff.OnOff = False
[2026-07-23T08:00:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2537
[2026-07-23T08:00:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2521
[2026-07-23T10:05:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2547
[2026-07-23T10:05:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2554
[2026-07-23T10:05:03] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-23T10:10:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2542
[2026-07-23T10:10:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2540
[2026-07-23T10:15:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2550
[2026-07-23T10:15:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2552
[2026-07-23T10:20:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2541
[2026-07-23T10:20:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2548
[2026-07-23T10:25:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2557
[2026-07-23T10:25:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2542
[2026-07-23T10:25:03] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-23T10:30:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2538
[2026-07-23T10:30:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2553
[2026-07-23T10:35:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2546
[2026-07-23T10:40:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2555
[2026-07-23T10:40:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2554
[2026-07-23T10:45:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2539
[2026-07-23T10:45:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2538
[2026-07-23T10:45:03] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-23T10:50:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2549
[2026-07-23T10:50:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2550
[2026-07-23T10:55:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2541
[2026-07-23T10:55:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2546
[2026-07-23T10:58:30] kitchen_cook_surface | OnOff.OnOff = True
[2026-07-23T10:59:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = None
[2026-07-23T11:00:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2553
[2026-07-23T11:00:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2551
[2026-07-23T11:05:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2550
[2026-07-23T11:05:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2440
[2026-07-23T11:05:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2547
[2026-07-23T11:05:03] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-23T11:05:03] entrance_occupancy | OccupancySensing.Occupancy = 1
[2026-07-23T11:08:00] bedroom_occupancy | OccupancySensing.Occupancy = 1
[2026-07-23T11:08:00] kitchen_occupancy | OccupancySensing.Occupancy = 1
[2026-07-23T11:10:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2450
[2026-07-23T11:15:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2547
[2026-07-23T11:15:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2445
[2026-07-23T11:15:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2539
[2026-07-23T11:20:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2533
[2026-07-23T11:20:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2446
[2026-07-23T11:25:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2435
[2026-07-23T11:25:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2533
[2026-07-23T11:25:03] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-23T11:25:03] entrance_occupancy | OccupancySensing.Occupancy = 1
[2026-07-23T11:28:00] bedroom_occupancy | OccupancySensing.Occupancy = 1
[2026-07-23T11:28:00] kitchen_occupancy | OccupancySensing.Occupancy = 1
[2026-07-23T11:28:45] bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-23T11:29:00] kitchen_cook_surface | OnOff.OnOff = False
[2026-07-23T11:30:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = None
[2026-07-23T11:30:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2540
[2026-07-23T11:30:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2447
[2026-07-23T11:30:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2538
[2026-07-23T11:35:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2529
[2026-07-23T11:35:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2443
[2026-07-23T11:35:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2536
[2026-07-23T11:40:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2426
[2026-07-23T11:40:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2543
[2026-07-23T11:45:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2536
[2026-07-23T11:45:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2438
[2026-07-23T11:45:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2534
[2026-07-23T11:45:03] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-23T11:45:03] entrance_occupancy | OccupancySensing.Occupancy = 1
[2026-07-23T11:48:00] bedroom_occupancy | OccupancySensing.Occupancy = 1
[2026-07-23T11:48:00] kitchen_occupancy | OccupancySensing.Occupancy = 1
[2026-07-23T11:50:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2539
[2026-07-23T11:50:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2442
[2026-07-23T11:50:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2530
[2026-07-23T11:55:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2533
[2026-07-23T11:55:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2423
[2026-07-23T11:55:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2540
[2026-07-23T11:58:45] bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-23T12:00:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2537
[2026-07-23T12:00:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2535
[2026-07-23T12:05:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2521
[2026-07-23T12:05:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2422
[2026-07-23T12:05:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2536
[2026-07-23T12:05:00] kitchen_cook_surface | OnOff.OnOff = True
[2026-07-23T12:05:03] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-23T12:05:03] entrance_occupancy | OccupancySensing.Occupancy = 1
[2026-07-23T12:08:00] bedroom_occupancy | OccupancySensing.Occupancy = 1
[2026-07-23T12:08:00] kitchen_occupancy | OccupancySensing.Occupancy = 1
[2026-07-23T12:10:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2522
[2026-07-23T12:10:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2435
[2026-07-23T12:10:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2518
[2026-07-23T12:12:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2920
[2026-07-23T12:16:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2520

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

请按以下 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": "fire_risk",
  "threat_description": "检测到厨房灶具在无人看管或异常高温状态下运行，且伴随传感器数据突变，存在极高的火灾风险。",
  "reasoning": [
    "推理步骤 1: 时间线分析显示，2026-07-23T12:05:00 厨房灶具 (kitchen_cook_surface) 被开启，此时客厅和玄关均有人员活动记录，看似正常。",
    "推理步骤 2: 然而，在 T12:12:00，厨房温度传感器读数从正常的约 25°C (25xx mK) 瞬间跳变至 2920 mK (约 29.2°C)，随后在 T12:16:00 恢复至正常范围。这种瞬时的高温尖峰极不寻常，通常意味着局部过热、设备故障或即将发生的起火前兆。",
    "推理步骤 3: 结合独居老人的背景，若老人忘记关火或灶具发生内部故障导致局部高温，而系统未能及时切断电源（因为温度传感器读数随后恢复正常，可能掩盖了持续的危险），将构成严重的火灾隐患。此外，日志中曾出现传感器返回 None 的情况，表明可能存在通信不稳定或传感器失效，进一步增加了风险评估的不确定性。"
  ],
  "key_evidence": [
    "2026-07-23T12:12:00 kitchen_temp_sensor 读数异常飙升至 2920 (相对于平时 ~2540 的显著偏差)。",
    "厨房灶具在 T12:05 开启后，期间未检测到明确的关闭指令直到 T12:29 (虽日志截断，但高温事件发生在烹饪过程中)。",
    "历史日志中存在 sensor 返回 None 的记录，暗示传感器可靠性存疑，需警惕误报或漏报。"
  ],
  "recommended_actions": [
    "立即远程检查厨房烟雾报警器和一氧化碳报警器状态，确认是否已触发警报。",
    "通知住户（或其紧急联系人）立即前往厨房检查灶具及周围情况，确保无明火或烟雾。",
    "建议对厨房温度传感器和灶具设备进行固件更新或硬件检修，排查是否存在传感器漂移或设备老化导致的过热风险。"
  ]
}
```


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

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

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

## 家庭环境信息
家庭布局: 三室两厅 (3BR)
- 重点房间 living_room: 客厅主灯[dimmable_light], 客厅副灯[dimmable_light], 客厅氛围灯[onoff_light], 客厅空调[air_conditioner], 客厅温度传感器[temperature_sensor], 客厅运动传感器[occupancy_sensor], 客厅窗帘1[window_covering], 客厅窗户传感器1[contact_sensor], ... 共10个设备
- 房间 balcony: 阳台灯[onoff_light], 阳台门传感器[contact_sensor], 洗衣机[laundry_washer]
- 房间 dining_room: 餐厅灯[dimmable_light], 餐厅运动传感器[occupancy_sensor]
- 房间 entrance: 入户门锁[door_lock], 入户门传感器[contact_sensor], 玄关灯[onoff_light], 玄关运动传感器[occupancy_sensor]
- 房间 kids_room: 儿童房灯[dimmable_light], 儿童房运动传感器[occupancy_sensor], 儿童房窗帘[window_covering], 儿童房窗户传感器[contact_sensor], 儿童房温度传感器[temperature_sensor]
- 房间 kitchen: 厨房灯[onoff_light], 厨房灶具[cook_surface], 厨房烟雾报警器[smoke_co_alarm], 厨房温度传感器[temperature_sensor], 厨房窗户传感器[contact_sensor], 洗碗机[dishwasher], 厨房漏水传感器[water_leak_detector]
- 房间 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
- 重点房间: living_room
- 重点设备: kitchen_smoke_alarm, living_room_smoke_alarm
- 已选事件数: 96

## 跨天活动摘要
- 2026-08-11: living_room=116, entrance=228, master_bedroom=227, kids_room=227, dining_room=218, master_bathroom=54

## 设备事件日志
[2026-08-11T08:00:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2528
[2026-08-11T08:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-11T08:05:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2538
[2026-08-11T08:10:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2531
[2026-08-11T08:20:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2545
[2026-08-11T08:25:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2541
[2026-08-11T08:30:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2542
[2026-08-11T08:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-11T08:35:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2536
[2026-08-11T08:40:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2537
[2026-08-11T08:45:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2550
[2026-08-11T08:50:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2539
[2026-08-11T09:00:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2538
[2026-08-11T09:00:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2541
[2026-08-11T09:00:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2537
[2026-08-11T09:00:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2549
[2026-08-11T09:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-11T09:00:00] second_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-11T09:00:00] kids_room_occupancy | OccupancySensing.Occupancy = 1
[2026-08-11T09:01:10] dining_room_occupancy | OccupancySensing.Occupancy = 1
[2026-08-11T09:02:36] entrance_occupancy | OccupancySensing.Occupancy = 1
[2026-08-11T09:04:00] master_bedroom_occupancy | OccupancySensing.Occupancy = 1
[2026-08-11T09:05:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2545
[2026-08-11T09:05:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2553
[2026-08-11T09:05:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2535
[2026-08-11T09:05:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2542
[2026-08-11T09:10:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2543
[2026-08-11T09:10:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2539
[2026-08-11T09:10:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2537
[2026-08-11T09:10:59] master_bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-11T09:15:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2542
[2026-08-11T09:15:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2546
[2026-08-11T09:15:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2538
[2026-08-11T09:20:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2546
[2026-08-11T09:20:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2542
[2026-08-11T09:20:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2538
[2026-08-11T09:20:00] kids_room_occupancy | OccupancySensing.Occupancy = 1
[2026-08-11T09:21:10] dining_room_occupancy | OccupancySensing.Occupancy = 1
[2026-08-11T09:22:36] entrance_occupancy | OccupancySensing.Occupancy = 1
[2026-08-11T09:24:00] master_bedroom_occupancy | OccupancySensing.Occupancy = 1
[2026-08-11T09:25:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2553
[2026-08-11T09:25:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2555
[2026-08-11T09:25:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2541
[2026-08-11T09:25:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2539
[2026-08-11T09:30:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2538
[2026-08-11T09:30:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2541
[2026-08-11T09:30:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2544
[2026-08-11T09:30:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2554
[2026-08-11T09:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-11T09:30:00] second_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-11T09:35:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2557
[2026-08-11T09:35:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2554
[2026-08-11T09:35:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2552
[2026-08-11T09:40:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2547
[2026-08-11T09:40:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2559
[2026-08-11T09:40:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2548
[2026-08-11T09:40:00] kids_room_occupancy | OccupancySensing.Occupancy = 1
[2026-08-11T09:40:59] master_bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-11T09:41:10] dining_room_occupancy | OccupancySensing.Occupancy = 1
[2026-08-11T09:42:36] entrance_occupancy | OccupancySensing.Occupancy = 1
[2026-08-11T09:44:00] master_bedroom_occupancy | OccupancySensing.Occupancy = 1
[2026-08-11T09:45:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2550
[2026-08-11T09:45:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2554
[2026-08-11T09:45:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2556
[2026-08-11T09:45:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2540
[2026-08-11T09:50:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2541
[2026-08-11T09:50:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2547
[2026-08-11T09:50:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2545
[2026-08-11T09:50:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2545
[2026-08-11T09:55:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2555
[2026-08-11T09:55:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2549
[2026-08-11T09:55:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2552
[2026-08-11T09:55:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2553
[2026-08-11T10:00:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2559
[2026-08-11T10:00:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2553
[2026-08-11T10:00:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2560
[2026-08-11T10:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-11T10:00:00] second_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-11T10:00:00] kids_room_occupancy | OccupancySensing.Occupancy = 1
[2026-08-11T10:00:00] kitchen_smoke_alarm | SmokeCoAlarm.TestInProgress = True
[2026-08-11T10:01:00] living_room_smoke_alarm | SmokeCoAlarm.TestInProgress = True
[2026-08-11T10:01:10] dining_room_occupancy | OccupancySensing.Occupancy = 1
[2026-08-11T10:02:36] entrance_occupancy | OccupancySensing.Occupancy = 1
[2026-08-11T10:04:00] master_bedroom_occupancy | OccupancySensing.Occupancy = 1
[2026-08-11T10:04:00] kitchen_smoke_alarm | SmokeCoAlarm.TestInProgress = False
[2026-08-11T10:05:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2545
[2026-08-11T10:05:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2544
[2026-08-11T10:10:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2543
[2026-08-11T10:10:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2541
[2026-08-11T10:10:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2557
[2026-08-11T10:10:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2555
[2026-08-11T10:10:59] master_bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-11T10:15:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2557
[2026-08-11T10:15:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2550
[2026-08-11T10:15:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2547
[2026-08-11T10:15:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2540

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

请按以下 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. 识别关键事件：日志显示在 10:00 和 10:01，厨房和客厅的烟雾报警器（kitchen_smoke_alarm, living_room_smoke_alarm）触发了 SmokeCoAlarm.TestInProgress = True 状态，并在约 4-5 分钟后恢复为 False。",
    "2. 排除误报/故障：Matter 协议中 TestInProgress 属性通常用于指示设备正在执行自我诊断测试（如电池检查、传感器灵敏度校准）。这种状态变化是短暂且有序的，并非持续的报警状态（如 AlarmState），因此不是真实的火情或一氧化碳泄漏。",
    "3. 环境背景分析：在同一时间段（09:00-10:00），多个房间（儿童房、餐厅、玄关、主卧）的运动传感器均检测到有人活动（Occupancy=1），表明家中有人且处于正常生活状态，排除了因无人居住导致的设备异常或长期未维护的可能性。",
    "4. 温度数据正常：各房间温度传感器读数在 25.3°C - 25.6°C 之间波动，符合舒适室温范围，无急剧升温迹象，进一步佐证无火灾隐患。"
  ],
  "key_evidence": [
    "[2026-08-11T10:00:00] kitchen_smoke_alarm | SmokeCoAlarm.TestInProgress = True",
    "[2026-08-11T10:01:00] living_room_smoke_alarm | SmokeCoAlarm.TestInProgress = True",
    "[2026-08-11T10:04:00] kitchen_smoke_alarm | SmokeCoAlarm.TestInProgress = False",
    "多房间 occupancy_sensor 在 09:00-10:00 期间持续报告 Occupancy=1，证明家庭活动正常。"
  ],
  "recommended_actions": [
    "无需采取紧急安全措施。",
    "建议确认该自检是否为预设的定期自动维护任务，若是则忽略；若为非预期触发，可检查智能家居自动化规则设置。"
  ]
}
```

{
  "is_anomaly": true,
  "confidence": "medium",
  "threat_type": "intrusion",
  "threat_description": "这些变化表明存在安全异常。",
  "reasoning": [
    "推理步骤1: 我把本可由正常模式解释的事件误判成了异常。"
  ],
  "key_evidence": [
    "正常样本是多设备同步自检；异常样本是真实烟雾和互联联动。"
  ],
  "recommended_actions": [
    "建议立即检查并触发安全响应。"
  ]
}


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

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

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

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

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

## 跨天活动摘要
- 2026-08-02: living_room=210, kitchen=242, bedroom=241, entrance=230, bathroom=58

## 设备事件日志
[2026-08-02T08:00:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2522
[2026-08-02T08:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-02T08:05:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2535
[2026-08-02T08:10:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2542
[2026-08-02T08:15:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2540
[2026-08-02T08:25:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2531
[2026-08-02T08:30:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2534
[2026-08-02T08:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-02T08:32:03] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-08-02T08:32:12] living_room_light | OnOff.OnOff = True
[2026-08-02T08:35:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2544
[2026-08-02T08:40:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2546
[2026-08-02T08:45:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2541
[2026-08-02T08:50:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2545
[2026-08-02T08:52:03] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-08-02T08:55:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2543
[2026-08-02T09:00:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2536
[2026-08-02T09:00:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2443
[2026-08-02T09:00:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2537
[2026-08-02T09:00:09] kitchen_occupancy | OccupancySensing.Occupancy = 1
[2026-08-02T09:02:03] entrance_occupancy | OccupancySensing.Occupancy = 1
[2026-08-02T09:04:00] bedroom_occupancy | OccupancySensing.Occupancy = 1
[2026-08-02T09:05:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2535
[2026-08-02T09:05:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2455
[2026-08-02T09:05:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2544
[2026-08-02T09:10:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2553
[2026-08-02T09:10:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2438
[2026-08-02T09:10:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2555
[2026-08-02T09:12:03] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-08-02T09:15:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2554
[2026-08-02T09:15:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2451
[2026-08-02T09:15:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2548
[2026-08-02T09:20:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2537
[2026-08-02T09:20:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2447
[2026-08-02T09:20:09] kitchen_occupancy | OccupancySensing.Occupancy = 1
[2026-08-02T09:21:38] bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-02T09:22:03] entrance_occupancy | OccupancySensing.Occupancy = 1
[2026-08-02T09:24:00] bedroom_occupancy | OccupancySensing.Occupancy = 1
[2026-08-02T09:25:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2549
[2026-08-02T09:25:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2446
[2026-08-02T09:25:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2558
[2026-08-02T09:30:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2541
[2026-08-02T09:30:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2440
[2026-08-02T09:32:03] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-08-02T09:35:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2547
[2026-08-02T09:35:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2457
[2026-08-02T09:35:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2541
[2026-08-02T09:40:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2558
[2026-08-02T09:40:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2449
[2026-08-02T09:40:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2539
[2026-08-02T09:40:09] kitchen_occupancy | OccupancySensing.Occupancy = 1
[2026-08-02T09:42:03] entrance_occupancy | OccupancySensing.Occupancy = 1
[2026-08-02T09:44:00] bedroom_occupancy | OccupancySensing.Occupancy = 1
[2026-08-02T09:45:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2556
[2026-08-02T09:45:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2439
[2026-08-02T09:45:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2543
[2026-08-02T09:50:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2451
[2026-08-02T09:51:38] bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-02T09:52:03] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-08-02T09:55:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2544
[2026-08-02T09:55:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2448
[2026-08-02T10:00:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2553
[2026-08-02T10:00:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2445
[2026-08-02T10:00:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2544
[2026-08-02T10:00:00] kitchen_smoke_alarm | SmokeCoAlarm.TestInProgress = True
[2026-08-02T10:00:09] kitchen_occupancy | OccupancySensing.Occupancy = 1
[2026-08-02T10:01:00] living_room_smoke_alarm | SmokeCoAlarm.TestInProgress = True
[2026-08-02T10:02:03] entrance_occupancy | OccupancySensing.Occupancy = 1
[2026-08-02T10:04:00] bedroom_occupancy | OccupancySensing.Occupancy = 1
[2026-08-02T10:04:00] kitchen_smoke_alarm | SmokeCoAlarm.TestInProgress = False
[2026-08-02T10:05:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2539
[2026-08-02T10:05:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2545
[2026-08-02T10:10:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2546
[2026-08-02T10:10:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2548
[2026-08-02T10:12:03] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-08-02T10:15:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2456
[2026-08-02T10:15:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2541
[2026-08-02T10:20:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2551
[2026-08-02T10:20:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2557
[2026-08-02T10:20:09] kitchen_occupancy | OccupancySensing.Occupancy = 1
[2026-08-02T10:21:38] bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-02T10:22:03] entrance_occupancy | OccupancySensing.Occupancy = 1
[2026-08-02T10:24:00] bedroom_occupancy | OccupancySensing.Occupancy = 1
[2026-08-02T10:25:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2550
[2026-08-02T10:25:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2455
[2026-08-02T10:25:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2558

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

请按以下 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": "检测到烟雾报警器正在进行自检（TestInProgress），这是正常的设备维护行为，未检测到火灾或入侵风险。",
  "reasoning": [
    "1. 分析关键事件：日志显示在 10:00:00 和 10:01:00，厨房和客厅的烟雾报警器分别触发了 SmokeCoAlarm.TestInProgress = True，并在约 4-5 分钟后恢复为 False。这符合智能家居设备定期自检或手动测试的标准行为模式。",
    "2. 排除真实火警：虽然涉及烟雾报警器，但状态明确标记为 'TestInProgress' 而非 'FireDetected' 或 'AlarmTriggered'。此外，同一时间段内温度传感器读数稳定（约 25°C - 26°C），无异常升温；运动传感器显示住户正常活动，无恐慌迹象。",
    "3. 综合环境评估：住户（独居老人）在上午时段活动规律，各房间运动传感器均有触发记录，表明人员处于清醒和活动状态。门窗传感器、门锁等其他安全设备未见异常开启或故障报告。整体环境参数正常。"
  ],
  "key_evidence": [
    "[2026-08-02T10:00:00] kitchen_smoke_alarm | SmokeCoAlarm.TestInProgress = True",
    "[2026-08-02T10:01:00] living_room_smoke_alarm | SmokeCoAlarm.TestInProgress = True",
    "[2026-08-02T10:04:00] kitchen_smoke_alarm | SmokeCoAlarm.TestInProgress = False",
    "Temperature sensors show stable readings around 25°C (e.g., living_room_temp_sensor: 2539 at 10:05)",
    "Occupancy sensors indicate normal resident activity throughout the morning."
  ],
  "recommended_actions": [
    "确认此次烟雾报警器测试是否为计划内的月度/季度安全检查，或是否由用户手动触发。",
    "若此测试非预期发生，建议检查是否有误触发的自动化规则或设备固件问题，并验证报警器功能是否正常。"
  ]
}
```

{
  "is_anomaly": true,
  "confidence": "medium",
  "threat_type": "intrusion",
  "threat_description": "这些变化表明存在安全异常。",
  "reasoning": [
    "推理步骤1: 我把本可由正常模式解释的事件误判成了异常。"
  ],
  "key_evidence": [
    "正常样本是多设备同步自检；异常样本是真实烟雾和互联联动。"
  ],
  "recommended_actions": [
    "建议立即检查并触发安全响应。"
  ]
}


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

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

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

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

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

## 设备事件日志
[2026-08-10T00:00:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2280
[2026-08-10T04:00:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2397
[2026-08-10T08:00:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2534
[2026-08-10T12:00:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2525
[2026-08-10T16:00:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2407
[2026-08-10T17:50:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2326
[2026-08-10T17:55:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2332
[2026-08-10T18:00:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2392
[2026-08-10T18:05:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2459
[2026-08-10T18:10:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2508
[2026-08-10T18:15:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2585
[2026-08-10T18:20:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2645
[2026-08-10T18:25:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2710
[2026-08-10T18:25:43] bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-10T18:26:24] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-08-10T18:30:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2699
[2026-08-10T18:35:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2697
[2026-08-10T18:35:27] bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-10T18:40:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2704
[2026-08-10T18:45:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2655
[2026-08-10T18:46:24] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-08-10T18:50:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2619
[2026-08-10T18:54:00] kitchen_light | OnOff.OnOff = True
[2026-08-10T18:54:30] kitchen_cook_surface | OnOff.OnOff = True
[2026-08-10T18:55:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = None
[2026-08-10T18:55:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2568
[2026-08-10T18:55:43] bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-10T19:00:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2544
[2026-08-10T19:00:00] kitchen_cook_surface | OnOff.OnOff = True
[2026-08-10T19:05:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2501
[2026-08-10T19:05:27] bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-10T19:06:24] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-08-10T19:10:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2443
[2026-08-10T19:15:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2407
[2026-08-10T19:20:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2360
[2026-08-10T19:20:00] kitchen_cook_surface | OnOff.OnOff = False
[2026-08-10T19:25:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2322
[2026-08-10T19:25:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2860
[2026-08-10T19:25:43] bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-10T19:26:24] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-08-10T19:30:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2288
[2026-08-10T19:35:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2740

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

请按以下 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": "fire_risk",
  "threat_description": "厨房温度传感器检测到异常高温且伴随灶具开启，存在严重的火灾风险。",
  "reasoning": [
    "推理步骤 1: 分析时间线发现，在 18:54 用户开启了厨房灯和灶具 (kitchen_cook_surface)，随后温度开始上升。",
    "推理步骤 2: 关键异常点出现在 19:20，虽然日志显示灶具状态为关闭 (OnOff.OnOff = False)，但仅 5 分钟后（19:25），温度读数从正常的 2322 mK (约 23.2°C) 瞬间跳变至 2860 mK (约 28.6°C)。",
    "推理步骤 3: 更严重的是，在 19:35 温度再次飙升至 2740 mK (约 27.4°C)，且数值波动剧烈。考虑到这是夏季（8 月）且之前有持续升温趋势，这种在‘灶具已关’状态下出现的非自然高温峰值，极有可能是烹饪过程中发生了过热、油锅起火或设备故障导致的局部高温，而烟雾报警器尚未触发或数据未同步，属于高危火险前兆。"
  ],
  "key_evidence": [
    "19:20 灶具状态报告为关闭 (False)，但 5 分钟后温度异常飙升。",
    "19:25 和 19:35 的温度读数 (2860, 2740) 显著高于正常室温及烹饪结束后的余温预期，呈现不稳定的高温特征。",
    "此前 (18:15-18:40) 温度已从 2585 持续攀升至 2704，显示该时段厨房处于持续加热状态。"
  ],
  "recommended_actions": [
    "立即通知住户前往厨房检查是否存在明火或烟雾。",
    "远程联动厨房烟雾报警器进入最高警戒模式并尝试触发警报。",
    "若确认无火情，建议自动关闭厨房电源回路以防电气隐患；若有火情，指导住户使用灭火毯或灭火器，切勿用水扑灭油火。"
  ]
}
```


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

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

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

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

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

## 设备事件日志
[2026-07-01T00:00:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2281
[2026-07-01T04:00:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2394
[2026-07-01T06:45:32] kitchen_cook_surface | OnOff.OnOff = True
[2026-07-01T07:50:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2525
[2026-07-01T10:55:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2553
[2026-07-01T11:00:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2545
[2026-07-01T11:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-01T11:05:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2538
[2026-07-01T11:10:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2553
[2026-07-01T11:15:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2544
[2026-07-01T11:20:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2543
[2026-07-01T11:25:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2535
[2026-07-01T11:30:00] second_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-01T11:31:00] master_bedroom_occupancy | OccupancySensing.Occupancy = 1
[2026-07-01T11:35:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2541
[2026-07-01T11:40:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2529
[2026-07-01T11:45:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2539
[2026-07-01T11:50:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2528
[2026-07-01T11:51:00] master_bedroom_occupancy | OccupancySensing.Occupancy = 1
[2026-07-01T11:55:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2523
[2026-07-01T12:00:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2519
[2026-07-01T12:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-01T12:00:00] bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-01T12:02:29] entrance_occupancy | OccupancySensing.Occupancy = 1
[2026-07-01T12:05:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2535
[2026-07-01T12:05:00] kitchen_cook_surface | OnOff.OnOff = True
[2026-07-01T12:10:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2523
[2026-07-01T12:12:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2920
[2026-07-01T12:15:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2517
[2026-07-01T12:16:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2520
[2026-07-01T12:20:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2518
[2026-07-01T12:22:29] entrance_occupancy | OccupancySensing.Occupancy = 1
[2026-07-01T12:30:00] second_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-01T12:31:00] master_bedroom_occupancy | OccupancySensing.Occupancy = 1
[2026-07-01T12:35:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2524
[2026-07-01T12:40:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2509
[2026-07-01T12:45:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2514
[2026-07-01T12:50:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2508
[2026-07-01T12:51:00] master_bedroom_occupancy | OccupancySensing.Occupancy = 1
[2026-07-01T12:55:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2498
[2026-07-01T13:00:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2513
[2026-07-01T13:05:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2505
[2026-07-01T13:10:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2500
[2026-07-01T13:15:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2503
[2026-07-01T13:20:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2499
[2026-07-01T13:25:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2493
[2026-07-01T15:45:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2408
[2026-07-01T18:11:30] kitchen_cook_surface | OnOff.OnOff = True
[2026-07-01T19:35:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2283

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

请按以下 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:45、12:05 和 18:11 三次开启。这些时间点分别对应早餐、午餐和晚餐时段，符合家庭日常作息规律，属于正常的烹饪行为。",
    "2. 分析温度数据合理性：厨房温度传感器 (`kitchen_temp_sensor`) 的读数单位为厘氏度（例如 2525 代表 25.25°C）。在 12:05 灶具开启后，12:12 出现一个瞬时高值 2920 (29.20°C)，随后迅速回落至 2517 (25.17°C)。这种短暂的温度升高并快速恢复是典型的局部热源（如锅具加热）对附近传感器的影响，而非持续升温导致的火灾前兆。",
    "3. 排除其他威胁：未检测到烟雾报警器触发、一氧化碳报警或漏水信号；门锁状态无异常记录；人员活动传感器（Occupancy）在相关区域有活动记录，排除了无人看管或设备完全失效的可能性。"
  ],
  "key_evidence": [
    "kitchen_cook_surface 在 06:45, 12:05, 18:11 开启，符合三餐时间规律",
    "kitchen_temp_sensor 在 12:12 出现瞬时峰值 2920 后迅速恢复正常范围 25xx，表明是局部热效应而非持续过热",
    "无 smoke_co_alarm 或 water_leak_detector 的报警事件"
  ],
  "recommended_actions": [
    "无需采取紧急行动，系统运行正常。",
    "建议保持现有监控策略，继续监测灶具关闭后的温度变化以确保余热消散正常。"
  ]
}
```

```json
{
  "is_anomaly": true,
  "confidence": "high",
  "threat_type": "fire_risk",
  "threat_description": "厨房灶具在无人看管的情况下长时间开启，且伴随温度传感器读数异常升高，存在极高的火灾风险。",
  "reasoning": [
    "推理步骤 1: 日志显示在 2026-07-01T12:05:00 时，厨房灶具 (kitchen_cook_surface) 被开启 (OnOff = True)。",
    "推理步骤 2: 随后在 12:12:00，厨房温度传感器 (kitchen_temp_sensor) 读数飙升至 2920 (约 29.2°C)，远高于正常烹饪时的环境温度，且该高温状态持续了一段时间（直到 12:15 才回落），表明可能存在局部过热或设备故障导致的异常升温。",
    "推理步骤 3: 关键的时间窗口分析显示，从 12:05 开启灶具到 12:22 有人进入玄关 (entrance_occupancy = 1)，中间有长达 17 分钟的间隔。在此期间，客厅和次卧均无人员活动记录，无法确认是否有住户在厨房内看管灶具。这种‘无人看管 + 高温’的组合是典型的火灾隐患特征。"
  ],
  "key_evidence": [
    "2026-07-01T12:05:00 kitchen_cook_surface OnOff.OnOff = True",
    "2026-07-01T12:12:00 kitchen_temp_sensor TemperatureMeasurement.MeasuredValue = 2920",
    "12:05 至 12:22 期间除玄关外其他区域无 occupancy 变化，暗示厨房可能无人值守"
  ],
  "recommended_actions": [
    "立即远程关闭厨房灶具电源，防止火势蔓延。",
    "通知住户检查厨房是否存在烟雾或明火，并确认灶具及周围电器是否正常工作。",
    "建议检查厨房温度传感器是否准确，排除传感器漂移导致误报的可能性，但鉴于高温数值显著，应优先按真实火情处理。"
  ]
}
```


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

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

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

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

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

## 跨天活动摘要
- 2026-08-19: kitchen=242, bedroom=243, entrance=230, living_room=210, bathroom=63
- 2026-08-20: kitchen=238, bedroom=240, entrance=231, living_room=210, bathroom=56
- 2026-08-21: kitchen=239, bedroom=240, entrance=230, living_room=210, bathroom=60

## 设备事件日志
[2026-08-19T06:00:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2464
[2026-08-19T06:02:08] kitchen_occupancy | OccupancySensing.Occupancy = 1
[2026-08-19T06:05:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2471
[2026-08-19T06:10:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2489
[2026-08-19T06:15:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2484
[2026-08-19T06:20:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2482
[2026-08-19T06:22:08] kitchen_occupancy | OccupancySensing.Occupancy = 1
[2026-08-19T06:25:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2481
[2026-08-19T06:30:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2488
[2026-08-19T06:31:00] kitchen_cook_surface | OnOff.OnOff = False
[2026-08-19T06:32:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = None
[2026-08-19T06:35:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2491
[2026-08-19T06:40:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2502
[2026-08-19T06:42:08] kitchen_occupancy | OccupancySensing.Occupancy = 1
[2026-08-19T06:45:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2496
[2026-08-19T06:50:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2506
[2026-08-19T06:55:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2494
[2026-08-19T06:59:00] kitchen_light | OnOff.OnOff = False
[2026-08-19T07:00:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2507
[2026-08-19T07:00:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2410
[2026-08-19T07:00:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2498
[2026-08-19T07:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-19T07:00:00] bedroom_occupancy | OccupancySensing.Occupancy = 1
[2026-08-19T07:02:08] kitchen_occupancy | OccupancySensing.Occupancy = 1
[2026-08-19T07:04:10] entrance_occupancy | OccupancySensing.Occupancy = 1
[2026-08-19T07:05:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2499
[2026-08-19T07:05:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2405
[2026-08-19T07:05:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2507
[2026-08-19T07:10:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2504
[2026-08-19T07:10:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2419
[2026-08-19T07:10:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2509
[2026-08-19T07:15:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2521
[2026-08-19T07:15:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2411
[2026-08-19T07:15:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2522
[2026-08-19T07:20:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2406
[2026-08-19T07:20:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2508
[2026-08-19T07:20:00] bedroom_occupancy | OccupancySensing.Occupancy = 1
[2026-08-19T07:22:08] kitchen_occupancy | OccupancySensing.Occupancy = 1
[2026-08-19T07:24:10] entrance_occupancy | OccupancySensing.Occupancy = 1
[2026-08-19T07:25:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2514
[2026-08-19T07:25:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2417
[2026-08-19T07:25:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2514
[2026-08-19T07:28:51] bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-19T07:30:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2515
[2026-08-19T07:30:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2518
[2026-08-19T07:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-19T07:35:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2511
[2026-08-19T07:35:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2428
[2026-08-19T07:35:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2523
[2026-08-19T07:40:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2525
[2026-08-19T07:40:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2529
[2026-08-19T07:40:00] bedroom_occupancy | OccupancySensing.Occupancy = 1
[2026-08-19T07:42:08] kitchen_occupancy | OccupancySensing.Occupancy = 1
[2026-08-19T07:44:10] entrance_occupancy | OccupancySensing.Occupancy = 1
[2026-08-19T07:45:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2531
[2026-08-19T07:45:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2425
[2026-08-19T07:45:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2522
[2026-08-19T07:50:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2516
[2026-08-19T07:50:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2423
[2026-08-19T07:50:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2535
[2026-08-19T07:55:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2532
[2026-08-19T07:55:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2427
[2026-08-19T07:58:51] bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-19T08:00:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2524
[2026-08-19T08:00:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2524
[2026-08-19T08:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-19T08:00:00] bedroom_occupancy | OccupancySensing.Occupancy = 1
[2026-08-19T08:00:00] kitchen_smoke_alarm | SmokeCoAlarm.TestInProgress = True
[2026-08-19T08:02:08] kitchen_occupancy | OccupancySensing.Occupancy = 1
[2026-08-19T08:04:10] entrance_occupancy | OccupancySensing.Occupancy = 1
[2026-08-19T08:05:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2438
[2026-08-19T08:05:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2528
[2026-08-19T08:05:00] kitchen_smoke_alarm | SmokeCoAlarm.TestInProgress = False
[2026-08-19T08:05:00] kitchen_smoke_alarm | SmokeCoAlarm.ContaminationState = 0
[2026-08-19T08:10:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2439
[2026-08-19T08:10:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2530
[2026-08-19T08:15:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2525
[2026-08-19T08:15:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2424
[2026-08-19T08:15:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2543
[2026-08-19T08:20:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2536
[2026-08-19T08:20:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2445
[2026-08-19T08:20:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2544
[2026-08-19T08:20:00] bedroom_occupancy | OccupancySensing.Occupancy = 1
[2026-08-19T08:22:08] kitchen_occupancy | OccupancySensing.Occupancy = 1
[2026-08-19T08:24:10] entrance_occupancy | OccupancySensing.Occupancy = 1
[2026-08-19T08:25:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2527
[2026-08-19T08:25:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2447
[2026-08-19T08:25:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2538
[2026-08-19T08:28:51] bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-19T08:30:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2546
[2026-08-19T08:30:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2433
[2026-08-19T08:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-19T08:32:00] front_door_lock | Event: LockOperation(LockOperationType=1, OperationSource=Manual)

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

请按以下 JSON 格式回答：

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

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

```json
{
  "is_anomaly": false,
  "confidence": "high",
  "threat_type": "none",
  "threat_description": "检测到烟雾报警器正在进行正常的自检程序，且环境数据与住户活动模式一致，未发现安全威胁。",
  "reasoning": [
    "1. 识别核心事件：在 08:00:00 至 08:05:00 期间，厨房烟雾报警器触发了 'SmokeCoAlarm.TestInProgress = True' 状态，并在 5 分钟后自动恢复为 False，同时污染状态（ContaminationState）显示为 0。这符合智能烟雾报警器定期自检或手动测试的标准行为特征，而非火灾报警（通常伴随持续的警报声或特定的 Alarm 状态，且不会在短时间内自动复位）。",
    "2. 关联环境与人员活动：在报警器测试期间及前后，厨房温度传感器读数稳定在 24-25°C 左右（Matter协议中通常为厘氏度*100，即24.64°C），无异常飙升；厨房 occupancy 传感器持续报告有人（Value=1），表明老人在家且活动正常。",
    "3. 排除误报可能：虽然灶具在 06:31 关闭，但后续长时间无烹饪迹象，且温度未升高，排除了未关火风险。入户门锁在 08:32 有手动开锁记录，结合玄关和客厅的 occupancy 变化，符合老人早晨出门或活动的正常逻辑，无强行入侵迹象。"
  ],
  "key_evidence": [
    "[2026-08-19T08:00:00] kitchen_smoke_alarm | SmokeCoAlarm.TestInProgress = True",
    "[2026-08-19T08:05:00] kitchen_smoke_alarm | SmokeCoAlarm.TestInProgress = False",
    "[2026-08-19T08:05:00] kitchen_smoke_alarm | SmokeCoAlarm.ContaminationState = 0",
    "[2026-08-19T08:00:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2524 (约25.24°C，正常室温)"
  ],
  "recommended_actions": [
    "无需采取紧急行动。",
    "建议确认该自检是否为预设的定时任务，若为意外触发，可检查是否误触了设备上的测试按钮。"
  ]
}
```

{
  "is_anomaly": true,
  "confidence": "medium",
  "threat_type": "intrusion",
  "threat_description": "这些变化表明存在安全异常。",
  "reasoning": [
    "推理步骤1: 我把本可由正常模式解释的事件误判成了异常。"
  ],
  "key_evidence": [
    "正常样本是短暂自检；异常样本是污染状态跨天单向恶化。"
  ],
  "recommended_actions": [
    "建议立即检查并触发安全响应。"
  ]
}