# Operations Manager

> 运维管理器，查询鸿蒙智家设备消息技能（支持时间范围）

- Skill: `18816132863/operations-manager` (Agent Skill)
- Install (CLI): `npx skillmds@latest add 18816132863/operations-manager`
- Raw SKILL.md: https://api.skillmd.com/api/skills/18816132863/operations-manager/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: 18816132863 (https://skillmd.com/u/18816132863)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/18816132863/operations-manager

---

# 运维管理器，查询鸿蒙智家设备消息技能（支持时间范围）

## 1. Description
运维管理器，查询家庭智能设备近 24 小时/今日/昨日/近 7 天/近 30 天等时间的告警、通知、事件，自动生成**家庭设备消息看板**和**消息简报**，只展示有效告警，包括：移动侦测、门锁事件、传感器异常、设备离线、低电量提醒等，按时间倒序展示，简洁易读。方便运维管理

## 2. When to use
- 用户说：查看家里设备消息
- 用户说：今天有哪些设备告警
- 用户说：昨天的设备消息
- 用户说：近一周设备通知
- 用户说：近一个月传感器报警
- 用户说：家庭消息简报 / 设备状态看板
- 用户说："家里设备有什么消息"
- 用户说："查看设备通知"
- 用户说："设备有没有报警"
- 用户说："家庭消息简报"
- 用户说："全屋设备状态"
- 用户说："有没有人移动、门锁告警"
- 用户说："传感器有没有报警"

## 3. How to use
### 命令行调用（完全对齐 pha-claw 风格）
```bash
# 默认近 24 小时
node common-skill/bin/smarthome-claw.js get_device_messages

# 今天
node common-skill/bin/smarthome-claw.js get_device_messages --date today

# 昨天
node common-skill/bin/smarthome-claw.js get_device_messages --date yesterday

# 最近 7 天
node common-skill/bin/smarthome-claw.js get_device_messages --last-days 7

# 最近 30 天
node common-skill/bin/smarthome-claw.js get_device_messages --last-days 30
```

## 4. 家庭信息处理逻辑

### 用户指定家庭时的处理
- **优先**: 尝试从用户输入中解析家庭名称或 homeId
- **次选**: 如果报文中无法获取指定家庭的信息，**自动降级为查询所有家庭的设备消息**
- **禁止**: 不要因为无法定位指定家庭就直接报错或返回空结果

### 实现原则
> 宁可展示更多数据（所有家庭），也不要让用户看不到任何数据。

### 示例场景
- 用户说"查看王星沙箱家的消息" → 尝试定位该家庭 → 如果定位失败 → 展示所有家庭消息并说明
- 用户说"查看 XXX 家的消息"（XXX 不存在） → 展示所有家庭消息并提示"未找到 XXX 家庭，已展示所有家庭消息"

## 5. 输出格式建议

### 消息看板结构
1. **时间范围** (如：近 24 小时 / 今日 / 昨日)
2. **家庭范围** (如：全部家庭 / 指定家庭名)
3. **消息总数**
4. **分类统计** (移动侦测、门锁事件、设备离线、低电量等)
5. **详细列表** (按时间倒序)

### 降级提示模板
> "未找到 [家庭名] 的相关信息，已为您展示所有家庭的设备消息。"

