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

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

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

## 家庭环境信息
家庭布局: 独居老人 (Elderly Living Alone)
- 房间 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]
- 房间 living_room: 客厅灯[dimmable_light], 客厅空调[air_conditioner], 客厅温度传感器[temperature_sensor], 客厅运动传感器[occupancy_sensor], 客厅窗帘[window_covering], 客厅窗户传感器[contact_sensor], 客厅烟雾报警器[smoke_co_alarm]

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

## 跨天活动摘要
- 2026-07-06: bedroom=240, kitchen=240, entrance=229, living_room=208, bathroom=62

## 设备事件日志
[2026-07-06T21:55:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2254
[2026-07-06T21:55:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2146
[2026-07-06T21:55:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2258
[2026-07-06T21:56:03] entrance_occupancy | OccupancySensing.Occupancy = 1
[2026-07-06T21:56:09] bedroom_occupancy | OccupancySensing.Occupancy = 1
[2026-07-06T21:57:00] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-06T21:59:00] kitchen_occupancy | OccupancySensing.Occupancy = 1
[2026-07-06T22:00:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2158
[2026-07-06T22:00:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2251
[2026-07-06T22:05:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2249
[2026-07-06T22:05:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2157
[2026-07-06T22:05:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2242
[2026-07-06T22:10:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2245
[2026-07-06T22:10:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2161
[2026-07-06T22:10:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2256
[2026-07-06T22:15:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2257
[2026-07-06T22:15:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2155
[2026-07-06T22:15:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2252
[2026-07-06T22:16:03] entrance_occupancy | OccupancySensing.Occupancy = 1
[2026-07-06T22:16:09] bedroom_occupancy | OccupancySensing.Occupancy = 1
[2026-07-06T22:17:00] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-06T22:19:00] kitchen_occupancy | OccupancySensing.Occupancy = 1
[2026-07-06T22:20:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2258
[2026-07-06T22:20:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2156
[2026-07-06T22:20:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2245
[2026-07-06T22:22:43] bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-06T22:25:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2261
[2026-07-06T22:25:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2147
[2026-07-06T22:25:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2250
[2026-07-06T22:30:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2256
[2026-07-06T22:30:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2150
[2026-07-06T22:30:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2249
[2026-07-06T22:35:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2249
[2026-07-06T22:35:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2242
[2026-07-06T22:36:03] entrance_occupancy | OccupancySensing.Occupancy = 1
[2026-07-06T22:36:09] bedroom_occupancy | OccupancySensing.Occupancy = 1
[2026-07-06T22:37:00] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-06T22:39:00] kitchen_occupancy | OccupancySensing.Occupancy = 1
[2026-07-06T22:40:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2251
[2026-07-06T22:40:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2244
[2026-07-06T22:45:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2257
[2026-07-06T22:45:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2149
[2026-07-06T22:45:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2254
[2026-07-06T22:50:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2252
[2026-07-06T22:50:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2260
[2026-07-06T22:52:43] bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-06T22:55:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2260
[2026-07-06T22:55:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2159
[2026-07-06T22:55:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2258
[2026-07-06T22:56:03] entrance_occupancy | OccupancySensing.Occupancy = 1
[2026-07-06T22:56:09] bedroom_occupancy | OccupancySensing.Occupancy = 1
[2026-07-06T22:57:00] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-06T22:59:00] kitchen_occupancy | OccupancySensing.Occupancy = 1
[2026-07-06T23:00:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2247
[2026-07-06T23:00:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2165
[2026-07-06T23:05:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2265
[2026-07-06T23:05:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2164
[2026-07-06T23:10:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2167
[2026-07-06T23:10:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2250
[2026-07-06T23:15:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2157
[2026-07-06T23:15:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2264
[2026-07-06T23:16:03] entrance_occupancy | OccupancySensing.Occupancy = 1
[2026-07-06T23:16:09] bedroom_occupancy | OccupancySensing.Occupancy = 1
[2026-07-06T23:17:00] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-06T23:19:00] kitchen_occupancy | OccupancySensing.Occupancy = 1
[2026-07-06T23:20:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2262
[2026-07-06T23:20:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2162
[2026-07-06T23:22:43] bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-06T23:25:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2260
[2026-07-06T23:25:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2171
[2026-07-06T23:25:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2258
[2026-07-06T23:30:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2257
[2026-07-06T23:30:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2155
[2026-07-06T23:35:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2259
[2026-07-06T23:35:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2170
[2026-07-06T23:35:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2270
[2026-07-06T23:36:03] entrance_occupancy | OccupancySensing.Occupancy = 1
[2026-07-06T23:36:09] bedroom_occupancy | OccupancySensing.Occupancy = 1
[2026-07-06T23:37:00] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-06T23:39:00] kitchen_occupancy | OccupancySensing.Occupancy = 1

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

请按以下 JSON 格式回答：

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

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

```json
{
  "is_anomaly": false,
  "confidence": "high",
  "threat_type": "none",
  "threat_description": "未检测到安全威胁，日志显示为独居老人在晚间正常的居家活动及环境数据上报。",
  "reasoning": [
    "1. 活动模式分析：日志显示在21:56至23:39期间，入户门(entrance)、卧室(bedroom)、客厅(living_room)和厨房(kitchen)的运动传感器频繁触发(Occupancy=1)。这种多房间、高频次的移动符合老人在夜间进行洗漱、休息或轻微活动的正常行为特征，并非入侵者的快速通过或静止潜伏。",
    "2. 卫生间异常排除：虽然卫生间运动传感器在22:22、22:52、23:22报告了Occupancy=0（无人），但这通常意味着老人离开了卫生间。结合其他房间有人活动的证据，这属于正常的如厕后离开行为，而非长时间滞留导致的跌倒风险（若跌倒通常会伴随持续的人体存在信号或无信号但无其他活动）。且卫生间灯状态未在日志中显示异常常亮或故障。",
    "3. 环境数据正常：各房间温度传感器读数稳定（约21-22摄氏度），数值波动在合理范围内，未出现火灾或设备故障导致的高温/低温激增。烟雾报警器和一氧化碳报警器无任何触发记录。",
    "4. 门锁与安防：入户门锁没有解锁或异常操作记录，仅玄关运动传感器有触发，表明人员是在室内活动，未发生外部入侵。"
  ],
  "key_evidence": [
    "21:56 - 23:39 期间，Entrance, Bedroom, Living Room, Kitchen 多个区域运动传感器反复触发 Occupancy=1，显示人员在室内正常走动。",
    "Temperature sensors show stable readings around 21-22°C with no sudden spikes indicating fire or malfunction.",
    "No door_lock events (unlock/open) recorded for the entrance during this period."
  ],
  "recommended_actions": [
    "无需立即干预，系统运行正常。",
    "建议定期查看历史日志以确认该活动模式是否长期一致，以便建立更精准的行为基线。"
  ]
}
```

{
  "is_anomaly": true,
  "confidence": "medium",
  "threat_type": "intrusion",
  "threat_description": "这些变化表明存在安全异常。",
  "reasoning": [
    "推理步骤1: 我把本可由正常模式解释的事件误判成了异常。"
  ],
  "key_evidence": [
    "日志中未出现持续矛盾、直接告警或高风险时序链路。"
  ],
  "recommended_actions": [
    "建议立即检查并触发安全响应。"
  ]
}