Agent skill

Huawei Hilink Adapter

by xiasi0 in xiasi0/ha-huawei-smarthome

Analyze and assemble Huawei HiLink MQTT commands and device state synchronization for community adapters.

GPL-3.0Auto-check passed

Install Huawei Hilink Adapter

skills CLI
$ npx skills add xiasi0/ha-huawei-smarthome --skill huawei-hilink-adapter -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install xiasi0/ha-huawei-smarthome huawei-hilink-adapter --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/xiasi0/ha-huawei-smarthome.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/huawei-hilink-adapter .claude/skills/huawei-hilink-adapter && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
huawei-hilink-adapter
GitHub stars
135
Token cost
~933 tokens
SKILL.md length
205 words
Files
7 (incl. references)
Skills in repo
2
Repo updated
First seen
Licence
GPL-3.0

At a glance

Analyze and assemble Huawei HiLink MQTT commands and device state synchronization for community adapters.

  • Works in 5 steps: 真实设备的官方 App 控制捕获。 → 该 prodId 的官方插件/运行时调用。 → 本 Skill 预置的 deviceServiceHelp 和… → …
  • ProdId/deviceTypeId/sid/st analysis
  • SKILL.md covers 证据优先级, 协议对象, 分析流程 and MQTT 命令规则, plus 3 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Huawei Hilink Adapter is an agent skill from xiasi0/ha-huawei-smarthome. Analyze and assemble Huawei HiLink MQTT commands and device state synchronization for community adapters. Use for prodId/deviceTypeId/sid/st analysis, official service-composition rules, payload targets, command sequencing, ACK handling, and deviceDataChanged state merging.

Its SKILL.md is about 930 tokens, which your agent loads only when the skill is triggered. The skill folder holds 8 other files, including reference files (for example `references/official/README.md`, `references/official/deviceServiceHelp.json` and `references/official/deviceServiceHelpVersion.json`).

It works with Home Assistant. The repository describes itself as: 适用于华为智慧生活设备的 Home Assistant 自定义集成。 The licence is GPL-3.0.

When your agent uses it

  • ProdId/deviceTypeId/sid/st analysis
  • Official service-composition rules
  • Payload targets
  • Command sequencing

Example prompts

  • “/huawei-hilink-adapter”

Workflow steps

5 steps, taken from the first numbered list in SKILL.md.

  1. 真实设备的官方 App 控制捕获。
  2. 该 prodId 的官方插件/运行时调用。
  3. 本 Skill 预置的 deviceServiceHelp 和 profileDataHelp。
  4. 设备 Product Profile、云端实际服务清单。
  5. 通用协议推断;只能用于只读解析,不能直接生成写命令。

What it can do on your machine

Read from SKILL.md and the folder at commit e7a5333. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are json).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Huawei Hilink Adapter loads about 933 tokens when it runs, and up to ~8.8k if it reads all its reference files. Until then it costs about 74 tokens; SKILL.md has 205 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~74
When it runs · the whole SKILL.md, loaded when a task matches
~933
With references · SKILL.md plus every file in references/, read only if the agent opens them
~8.8k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from xiasi0/ha-huawei-smarthome at commit e7a5333, republished under its GPL-3.0 licence (© xiasi0). 205 words, ~933 tokens.

Download SKILL.mdSave it as .claude/skills/huawei-hilink-adapter/SKILL.md (or your agent's skills folder). This skill also uses 6 other files; get the full folder from GitHub.
name
huawei-hilink-adapter
description
Analyze and assemble Huawei HiLink MQTT commands and device state synchronization for community adapters. Use for prodId/deviceTypeId/sid/st analysis, official service-composition rules, payload targets, command sequencing, ACK handling, and deviceDataChanged state merging.
metadata.short-description
Huawei HiLink MQTT command and sync helper

这个 Skill 只处理华为协议层:如何从 Profile 和官方服务模型确定服务成员、组装 MQTT 命令、验证 ACK,以及同步 deviceDataChanged 状态。

证据优先级

按以下顺序判断协议行为:

  1. 真实设备的官方 App 控制捕获。
  2. 该 prodId 的官方插件/运行时调用。
  3. 本 Skill 预置的 deviceServiceHelp 和 profileDataHelp。
  4. 设备 Product Profile、云端实际服务清单。
  5. 通用协议推断;只能用于只读解析,不能直接生成写命令。

如果高优先级证据和低优先级配置冲突,以高优先级证据为准,并记录冲突。

协议对象

  • prodId、deviceTypeId:产品和设备类型匹配键。
  • sid:服务实例的协议主键。命令目标和状态缓存都按 (devId, sid) 处理。
  • st:服务类型元数据。它不是服务顺序,也不是可靠的命令顺序。
  • characteristicName:服务内部字段名,必须来自 Profile 或真实捕获。
  • serviceId 表达式:官方服务组合模型中的逻辑成员关系,例如 switch&brightness。
  • MQTT services[] 顺序:当前消息携带更新的排列,不承载组合语义或发送顺序。

分析流程

  1. 收集 prodId、deviceTypeId、Product Profile、云端实际服务清单和脱敏 MQTT/官方调用捕获。
  2. 优先读取仓库内 references/official/ 的四个预置资源,并记录版本号。
  3. 标准化 Profile:保留每个 sid、serviceType、characteristic、类型、权限、范围和枚举。
  4. 用 deviceServiceHelp 按 deviceTypeId 和 trustProdIds 查找服务组合;精确产品匹配优先于设备类型匹配。
  5. 解析组合表达式:
    • & 表示同一协议能力的成员服务,不自动证明发送顺序。
    • | 表示并列数据成员,不表示任选一个,也不表示 MQTT 顺序。
  6. 用 profileDataHelp 确定状态字段来源和缩放,例如 temperature/current、{temperature/current}/10。
  7. 为每个控制动作建立协议命令计划:每一步明确 sid、payload、顺序、失败策略、ACK 和状态确认条件。
  8. 为每个状态事件建立同步计划:按 devId 路由,按 sid patch,按 ts 处理旧消息。
  9. 用脱敏 fixture 验证最终 target、body、ACK 和状态合并结果。

MQTT 命令规则

云端服务命令的目标通常是:

text
target = /devices/{devId}/services/{sid}
body   = 该 sid 的 characteristic payload

官方 App 的调用层次是:

text
产品控制入口
  → HWMqttViewModel / HWDeviceManager
  → HWMqttRequest + HWMqttHeader
  → common_mqtt_sdk.HWMqttClient
  → MQTT Broker

命令计划必须遵守:

  • st 不进入 target;除非真实捕获明确证明它进入 body,否则也不把 st 放入 body。
  • 单个 sid 的 body 只包含该服务的 characteristic 数据。
  • 同一设备、同一 sid 默认单飞。
  • 同一组合能力的多步命令默认顺序执行;没有证据时标记 order: unknown。
  • 组合配置只能说明成员关系,不能单独证明命令顺序。
  • 区分云端 MQTT 路径和官方 App 的 local-control 路径;没有本地控制证据时不要混用。
  • 某一步失败时默认中止后续步骤,除非设备测试证明可以继续。
ACK 与状态确认
text
PUBACK          ≠ 业务 ACK
commandRsp      = 云端命令处理结果
deviceDataChanged = 设备状态来源

commandRsp.body.errcode == 0 只代表云端接受/处理成功,不应直接写入设备当前状态。

服务端返回的 requestId 可能与出站 request id 不一致。默认使用:

text
(connection_generation, devId, sid)

作为当前单飞命令的主关联键;原始 request id 只作为辅助诊断字段。

MQTT 状态同步规则

对 deviceDataChanged:

text
decode envelope
  → 检查 header.notifyType
  → 按 body.devId 路由
  → 遍历 body.services[]
  → 按 sid 找状态槽
  → 只 patch data 中出现的字段
  → 按 ts 丢弃旧更新

单个服务项通常具有:

json
{
  "sid": "brightness",
  "st": "brightness",
  "ts": "20260901T010203Z",
  "data": {"brightness": 80}
}

必须做到:

  • 状态主键使用 (home_id, dev_id, sid) 或等价的设备范围键。
  • 本次消息未出现的字段保持旧值。
  • 一条消息含多个 sid 时逐项处理,不依赖数组位置。
  • 多 sid 的组合状态由上层适配器读取各自缓存后计算。
  • 不把一个服务的状态伪造成另一个服务。
  • 没有状态确认时,不把命令期望值冒充设备实际值。

失败关闭

遇到以下情况,停止自动写入并输出协议缺口:

  • Profile 没有目标 sid 或 characteristic。
  • 设备实际服务清单没有目标 sid。
  • 只有 deviceServiceHelp 组合信息,没有命令顺序证据。
  • 同一字段在不同 prodId 上有不同缩放或枚举含义。
  • ACK 成功但没有可验证的 deviceDataChanged/状态快照。
  • 只能根据名称、st 或 MQTT 数组顺序猜测写入逻辑。

参考资料

© xiasi0, GPL-3.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 6 other files (references) in .claude/skills/huawei-hilink-adapter of xiasi0/ha-huawei-smarthome.

  • SKILL.md
  • references/official/README.md
  • references/official/deviceServiceHelp.json
  • references/official/deviceServiceHelpVersion.json
  • references/official/profileDataHelp.json
  • references/official/profileDataHelpVersion.json
  • references/protocol-model.md

Open the folder on GitHubat commit e7a5333

Compare with similar skills

Huawei Hilink Adapter next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Huawei Hilink Adapter compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Huawei Hilink Adapter this skillxiasi0/ha-huawei-smarthome135—~933Automated safety check: PassGPL-3.0
DOCXrvdbreemen/OTGW-firmware20733 repos~4.3kAutomated safety check: PassProprietary
PPTXrvdbreemen/OTGW-firmware20734 repos~2.3kAutomated safety check: PassProprietary
XLSXrvdbreemen/OTGW-firmware20735 repos~2.9kAutomated safety check: PassProprietary
Sap Extension Creatorheshengtao/super-agent-party2.7k—~6kAutomated safety check: PassAGPL-3.0
Ha Frontend Componentshome-assistant/frontend5.7k—~1.2kAutomated safety check: PassApache-2.0

Similar skills

  • DOCX

    rvdbreemen/OTGW-firmware

    A skill your agent uses whenever the user wants to create, read, edit, or manipulate Word documents (.docx files).

    207 GitHub starsUsed in 33 repos~4.3k tokens
    Documents & OfficeAuto-check passed
  • PPTX

    rvdbreemen/OTGW-firmware

    Use this skill any time a .pptx file is involved in any way — as input, output, or both.

    207 GitHub starsUsed in 34 repos~2.3k tokens
    Documents & OfficeAuto-check passed
  • XLSX

    rvdbreemen/OTGW-firmware

    Use this skill any time a spreadsheet file is the primary input or output.

    207 GitHub starsUsed in 35 repos~2.9k tokens
    Documents & OfficeAuto-check passed
  • Sap Extension Creator

    heshengtao/super-agent-party

    Create Super Agent Party (SAP) extensions. An agent skill from heshengtao/super-agent-party.

    2.7k GitHub stars~6k tokensUpdated today
    Frontend & DesignAuto-check passed
  • Ha Frontend Components

    home-assistant/frontend

    Home Assistant frontend component patterns. An agent skill from home-assistant/frontend.

    5.7k GitHub stars~1.2k tokensUpdated today
    Frontend & DesignAuto-check passed
  • Ha Android Architecture

    home-assistant/android

    Home Assistant Android module and layer architecture. An agent skill from home-assistant/android.

    4k GitHub stars~1.7k tokensUpdated yesterday
    MobileAuto-check passed

More from xiasi0/ha-huawei-smarthome

  • Huawei PR

    xiasi0/ha-huawei-smarthome

    Standardize pull request titles and descriptions for the ha-huawei-smarthome repository.

    135 GitHub stars~501 tokensUpdated today
    Auto-check passed

Works with

Questions about Huawei Hilink Adapter

What does Huawei Hilink Adapter do?

Analyze and assemble Huawei HiLink MQTT commands and device state synchronization for community adapters. Huawei Hilink Adapter is an agent skill from xiasi0/ha-huawei-smarthome. Analyze and assemble Huawei HiLink MQTT commands and device state synchronization for community adapters.

When should I use Huawei Hilink Adapter?

Huawei Hilink Adapter fits situations like: prodId/deviceTypeId/sid/st analysis; official service-composition rules; payload targets; command sequencing.

How do I install Huawei Hilink Adapter in Claude Code?

Run `npx skills add xiasi0/ha-huawei-smarthome --skill huawei-hilink-adapter -a claude-code`. Or copy the skill folder (.claude/skills/huawei-hilink-adapter in xiasi0/ha-huawei-smarthome) into .claude/skills/huawei-hilink-adapter in your project. Claude Code loads it when a task matches its description.

How do I install Huawei Hilink Adapter in Codex?

Run `npx skills add xiasi0/ha-huawei-smarthome --skill huawei-hilink-adapter -a codex`. Or copy the skill folder (.claude/skills/huawei-hilink-adapter in xiasi0/ha-huawei-smarthome) into .agents/skills/huawei-hilink-adapter in your project. Codex loads it when a task matches its description.

Can I use Huawei Hilink Adapter in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add xiasi0/ha-huawei-smarthome --skill huawei-hilink-adapter -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/huawei-hilink-adapter, .gemini/skills/huawei-hilink-adapter, .github/skills/huawei-hilink-adapter and .opencode/skills/huawei-hilink-adapter in your project.

What does Huawei Hilink Adapter need to run?

SKILL.md names no scripts, command-line tools or credentials: Huawei Hilink Adapter is instructions for the agent only.

Does Huawei Hilink Adapter access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Huawei Hilink Adapter safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Huawei Hilink Adapter use?

Huawei Hilink Adapter is published under the GPL-3.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Huawei Hilink Adapter use?

About 933 tokens (SKILL.md is roughly 3.7k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 7.8k tokens, read only when the agent opens those files.

What are the alternatives to Huawei Hilink Adapter?

Skills that share tags, products or a category with Huawei Hilink Adapter: DOCX (rvdbreemen/OTGW-firmware, 207 stars), PPTX (rvdbreemen/OTGW-firmware, 207 stars), XLSX (rvdbreemen/OTGW-firmware, 207 stars) and Sap Extension Creator (heshengtao/super-agent-party, 2.7k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Huawei Hilink Adapter?

xiasi0 (a GitHub user) maintains it in xiasi0/ha-huawei-smarthome, which has 135 GitHub stars. The repository holds 2 skills in this directory. The repository was last updated on October 10, 2026.

Source: xiasi0/ha-huawei-smarthome on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.