Borrowing it
Nothing to install: this file belongs to allocnode/oh-my-sage. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/allocnode/oh-my-sage/main/.agents/skills/mijia-automation/SKILL.mdgit clone --depth 1 https://github.com/allocnode/oh-my-sageWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/allocnode/oh-my-sage/mijia-automation)<a href="https://agentmods.dev/skills/allocnode/oh-my-sage/mijia-automation"><img src="https://agentmods.dev/badge/skills/allocnode/oh-my-sage/mijia-automation/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/allocnode/oh-my-sage/mijia-automation"><img src="https://agentmods.dev/badge/skills/allocnode/oh-my-sage/mijia-automation.svg" alt="Reviewed on agentmods" width="80" height="20"></a>- NVIDIA SkillSpector pass
What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00055 | $0.07767 |
| Opus 5.5 | $0.00022 | $0.03107 |
| Sonnet 5.5 | $0.00011 | $0.01553 |
| Haiku 4.5 | $0.00006 | $0.00777 |
Grade A, and why
mijia-automation scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 400 lines — stays where its author put it; the contents beside it link to each section on GitHub.
米家自动化规则创建
设计新自动化时的知识检索
不要一开始就堆节点。先把需求拆成:触发、状态、变换、条件、动作、退出、恢复,再读取 知识索引 中最相关的一至三个模式文件。
快速选择模式:
| 问题 | 模式 |
|---|---|
| 需要跨事件记住值、模式或时间点 | PAT-STATE-01 |
| 需要计算、映射、取整、量化或夹紧 | PAT-NUM-01 |
| 需要多源汇总、任一/全部或至少 k 个 | PAT-AGG-01 |
| 需要日期、时长、时间窗口或节律 | PAT-TIME-01 |
| 需要重复执行、停止、清零或恢复 | PAT-LOOP-01 |
| 需要设备跟随、双向同步或按实际状态切档 | PAT-SYNC-01 |
| 需要跨设备型号、跨规则、模板或虚拟事件 | PAT-ADAPT-01 |
常见组合:节律照明 = TIME + NUM + LOOP;外部可改档设备 = STATE + SYNC;重复提醒 = STATE + LOOP + ADAPT。
模式用于选择结构和发现风险,不是固定模板。组合模式后仍须根据目标设备 MIOT Spec 重新确定 DID、URN、字段、量程、步进、枚举和动作参数。不得照抄案例中的设备、阈值、变量名或私有标识。
案例知识按以下状态升级:
video → ui-sample → graph-diff → local-tested → gateway-roundtrip → runtime-verified → reusable-pattern
视频案例只是设计线索。未达到 runtime-verified 的行为不得写成强制校验规则;达到 reusable-pattern 还必须满足脱敏、跨场景适用和边界明确,才可作为通用模式推荐。证据可从真实规则、源码或网关样本开始,不要求机械经过每一级。
完整节点字段按需读取 米家自动化规则完全参考,不要把全部节点模板和全部案例同时加载。
变量生命周期能力
变量管理分为三层,不能把其中一层的限制误判成网关不支持:
| 层级 | 能力与限制 |
|---|---|
| 网关 API | 支持 createVar、deleteVar、getVarValue、getVarConfig、setVarValue |
| 专用 MCP 工具 | 使用 mijia_create_variable、mijia_delete_variable、mijia_get_variable_value、mijia_get_variable_config、mijia_set_variable |
| 通用原始 API 工具 | mijia_call_api 故意只允许只读方法;写方法被拒绝不代表网关没有写能力 |
关键规则:
- 新建变量必须调用
mijia_create_variable;mijia_set_variable只修改已存在变量,不会自动创建。 varSetNumber、varSetString、deviceInputSetVar和deviceGetSetVar只写已存在变量,不能用作变量创建器。- 变量 ID 必须匹配
^[a-zA-Z0-9]+$,不能含下划线、连字符或中文;显示名称name可以包含中文。 type只能是number或string,初始值和后续值必须与类型一致。createVar的显示名称必须放在userData: { name },不能传顶层name。缺少userData.name时变量虽可按 ID 读取,但极客版 UI 的变量选择器不会显示它。- 删除变量前检查所有规则引用;删除是不可恢复操作。
本规则变量的作用域名与创建时机
- 作用域名 =
R+ 规则 ID 的数字部分,去掉graph_前缀。例:规则graph_1700000000000→ 作用域R1700000000000;规则1700000000000→R1700000000000。可用mijia_call_api getVarScopeList核对。 - 节点里写
"scope": "rule"的自动替换只发生在mijia_create_graph和mijia_graph_draft_begin(经由variables参数)。 mijia_patch_graph和mijia_update_graph都没有variables参数。给已有规则新增变量时,必须先单独调用mijia_create_variable并显式传真实作用域字符串,节点里也要写真实作用域,不能写"rule"。
What ships with it
13 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
- references/cases/catalog.md 3.1 KB
- references/experiments/index.md 3.5 KB
- references/gateway-capability-discovery.md 3.7 KB
- references/index.md 2.6 KB
- references/lessons-learned.md 7.1 KB
- references/mijia-complete-reference.md 43 KB
- references/patterns/adapters-and-templates.md 3.9 KB
- references/patterns/aggregation-and-thresholds.md 3.0 KB
- references/patterns/loops-and-lifecycle.md 2.4 KB
- references/patterns/numeric-transforms.md 1.7 KB
- references/patterns/state-and-scope.md 3.9 KB
- references/patterns/synchronization.md 3.1 KB
- references/patterns/time-and-duration.md 2.7 KB
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 4d ago Changed 046dc6dcdf66
- 5d ago Changed · +14 lines 03466a77741b
- 15d ago Changed · +8 lines 48f9d938a679
- 2mo ago First seen · 378 lines · 55 tokens per session scan A 63d6f38d154d
mijia-automation is a skill published in the GitHub repository allocnode/oh-my-sage (122 stars, last pushed 4d ago), licensed MIT. It adds 55 tokens to every session and 7,767 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
mijia-automation compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| mijia-automationallocnode/oh-my-sage | Skill | 122 | 4d ago | MIT | A | 55 | Claude Code, Codex |
| gke-compute-classesgoogle/skills | Skill | 22k | yesterday | Apache-2.0 | A | 83 | Claude Code, Codex |
| jetson-diagnosticNVIDIA/skills | Skill | 3.9k | yesterday | Apache-2.0 | A | 30 | Claude Code, Codex |
| holoscan-install-wheelNVIDIA/skills | Skill | 3.9k | yesterday | Apache-2.0 | A | 34 | Claude Code, Codex |
| offensive-z-waveSnailSploit/Claude-Red | Skill | 10k | 25d ago | MIT | A | 113 | Claude Code, Codex |
| doca-socket-relayNVIDIA/skills | Skill | 3.9k | yesterday | Apache-2.0 | A | 236 | Claude Code, Codex |
| hsb-flashNVIDIA/skills | Skill | 3.9k | yesterday | Apache-2.0 | B | 94 | Claude Code |