← 返回
未分类 Key 中文

ecovacs-skills-pet-control

Control Ecovacs FAMIBOT (pet) robots via the Open Platform Access Key (AK) and POST /robot/skill/pet/cmd. Covers device discovery, queries/settings, display/...
通过开放平台访问密钥(AK)和 POST /robot/skill/pet/cmd 控制 Ecovacs FAMIBOT(宠物)机器人。涵盖设备发现、查询/设置、显示/...
ecovacs-ai ecovacs-ai 来源
未分类 clawhub v1.0.1 2 版本 100000 Key: 需要
★ 0
Stars
📥 288
下载
💾 0
安装
2
版本
#latest

概述

Ecovacs Pet (FAMIBOT) Control

What you need

You provideNotes
--------------------
AK (Access Key)Get one from the Ecovacs Open Platform “Service Overview” (Mainland China: https://open.ecovacs.cn/, non-China regions: https://open.ecovacs.com/) and put it in your env or pass to set-ak. Do not hand the skill a username/password to log in on your behalf.
Device nickname fragmentUsed to fuzzy-match nick or name returned by the device list.

Three-step flow

  1. Configure AK (export ECOVACS_AK=... or python3 scripts/ecovacs.py set-ak )
  2. List devices: python3 scripts/ecovacs.py devices
  3. Control: Use POST /robot/skill/pet/cmd or the script's cmd / display subcommands; cmd must be in the gateway allowlist, otherwise the gateway returns command not enabled.

Run from the repository root: python3 scripts/ecovacs.py .... You may set ECOVACS_PORTAL_URL to a custom gateway base URL; when unset, the default is the Mainland China Open Platform domain.


Usage constraints

  • Requests use cmd (string) + data (object); invalid parameters surface as cloud error messages.
  • If the gateway returns command not enabled, that cmd is outside the deployment's supported set — use only commands listed below or ask a maintainer.

Response fields and set* inputs

See references/schema.md.

Supported commands

Queries

Descriptioncmd
------------------
Pet state / emotion / persona / gender / location & weather / initializationgetPetState, getEmotion, getPerson, getPetGender, getLocationInfo, getInitiateState
Microphone / camera / volume / eye brightness / language / wake idle timeoutgetMicro, getCamera, getVolume, getEyesLight, getLanguage, getWakeTimeout
Latest diary entrygetLatestDiary

Settings

Descriptioncmd
------------------
Microphone / camera / volume / wake idle timeout / wake word / gendersetMicro, setCamera, setVolume, setWakeTimeout, setNickname, setPetGender

Control

Descriptioncmd
------------------
Display / motion sequencesdisplay
Play sound (category or file + optional count / moveTimeMs)playSound

Sound routing (conversation → payload) — see phoenix-single-action.md §2.2:

User intentSend
-------------------
“Bark happily” / vague mood sound{"category":"happy","count":1} — gateway picks a random clip in that category
“Bark loudly / big happy bark”{"file":"happy-h-<1-5>","count":1} — pick one happy-h-1happy-h-5
“Soft / quiet bark”{"file":"happy-l-<1-5>","count":1}
Other moodscategory = calm / attached / curious / angry / sad / scared, or pick file with matching `{mood}-{l\m\h}-{n}`

For action_sequence rows, each play_sound step needs an explicit file (choose using the table above before building JSON).

Dance — single preset in references/dance-routines.md (showcase_custom / 定制秀舞):

User intentCLI
------------------
Dance / short dance / any legacy mood namedisplay dance

Fixed script ~45s; length is ignored. Aliases (cheerful, 点头舞, etc.) all map to the same dance.

Persona / mood (read-only): getPerson, getPetState, getEmotion.

Sleep: display sleep.

Motion protocolstwo paths; do not mix fields between them:

PathWhenDoc
-----------------
play_actionOne step: display … action, bare playSoundphoenix-single-action.md
action_sequenceMulti-step, dance, playSound + actions, timedphoenix-action-control.md + action-sequence.md

Critical — pick one protocol and its field names only:

Topicplay_action (single)action_sequence (composite)
--------------------------------------------------------------
Head angle×100 on wire (30°"3000"); script accepts degrees in CLI JSONDegrees as-is ("-14", "44"); must stay in range
Head rangesScript converts degrees; still respect device limits when choosing valuesnod_head −14~+22 · shake_head −60~+60 · cock_head −20~+20
Tail speedWire field angle = speed×100; CLI may use percent / angle 0–100Field percent 0–100 only — not angle
SoundWire field angle = filename; CLI file or category via playSoundField filenot angle
moveTimeMs-1 allowed (default speed / continuous tail)Must be >0; -1 is replaced by script defaults
TimingNo delayEvery row needs delay (ms)

Common mistakes: copying a single-action JSON into actions[] (×100 angles, -1 times); using percent in display action wag_tail without letting the script convert (OK in CLI, wrong on raw wire); using angle: "3000" in a dance step (device expects "30").

UtilityScript
-----------------
Enter sleepdisplay sleep
Stop motion / cancel device-side scheduled routinesdisplay reset

Before sending any display motion/persona action through scripts/ecovacs.py display ..., the script checks getCamera. If enable != 1, it wakes the pet through the skill gateway with setCamera {"enable":1}, waits until getCamera.enable=1, switches work mode back to standard with setWorkMode {"mode":"standard"}, and only then sends the action. Set ECOVACS_SKIP_WAKE_CHECK=1 only for debugging when you intentionally want to bypass this guard.

Dance / timed barks / multi-step shows: one action_sequence per show. Dance: build_dance_sequence()showcase_custom — see references/dance-routines.md.

Default timing limits (hand-built JSON only; preset dance is exempt — see below):

ScopeDefault capOverride
------------------------------
Single step (play_action or one actions[] row)delay + duration ≤ 10s"user_timing": true on the JSON object
Hand-built action_sequence (non-scheduled)end time ≤ ~20ssame flag, or conditions.scheduled / repeat
Preset dance (display … danceshowcase_custom)~45s fixed scriptScript sets user_timing: true automatically — do not trim steps to fit 20s
Debugskip all checksECOVACS_SKIP_TIMING_LIMIT=1

user_timing is stripped before the gateway sees the payload.


Script examples

SCRIPT="./scripts/ecovacs.py"

python3 "$SCRIPT" cmd <nickname-fragment> getPetState '{}'
python3 "$SCRIPT" cmd <nickname-fragment> getCamera '{}'
python3 "$SCRIPT" cmd <nickname-fragment> setWakeTimeout '{"timeout":180}'

python3 "$SCRIPT" cmd <nickname-fragment> getPerson '{}'
python3 "$SCRIPT" display <nickname-fragment> dance
python3 "$SCRIPT" display <nickname-fragment> dance showcase_custom

python3 "$SCRIPT" cmd <nickname-fragment> playSound '{"category":"happy","count":1}'

python3 "$SCRIPT" cmd <nickname-fragment> playSound '{"file":"happy-h-3","count":1}'

python3 "$SCRIPT" display <nickname-fragment> sleep
python3 "$SCRIPT" display <nickname-fragment> reset
python3 "$SCRIPT" display <nickname-fragment> action shake_head '{"angle":"30","moveTimeMs":"-1","count":"3"}'

python3 "$SCRIPT" display <nickname-fragment> action wag_tail '{"percent":30,"moveTimeMs":"-1"}'

python3 "$SCRIPT" cmd <nickname-fragment> playSound '{"file":"happy-h-1","count":1,"conditions":{"scheduled":"0","repeat_type":"1","repeat_count":"10"}}'

HTTP calls (no Python available)

Default gateways: Mainland China https://open.ecovacs.cn, non-China regions https://open.ecovacs.com (override with ECOVACS_PORTAL_URL if needed).

Device list

curl -sS "${BASE_URL}/robot/skill/deviceList?ak=YOUR_AK"

Pet control

curl -sS -X POST "${BASE_URL}/robot/skill/pet/cmd" -H 'Content-Type: application/json' \
  -d "{\"ak\":\"${AK}\",\"nickName\":\"nickname-fragment\",\"cmd\":\"getPetState\",\"data\":{}}"

The field name must be nickName exactly as above (uppercase N).

Compatibility path: POST /robot/skill/ctl + ctl is still accepted for pet devices and is also subject to the cmd allowlist.


Recommended verification order

Use the script and HTTP examples earlier in this document (get first, then set / display) to confirm nickName resolution and allowlist behavior before relying on higher-risk writes.


Errors and troubleshooting (summary)

CaseWhat to do
------------------
Outer code != 0Read msg (invalid AK, device not found, not FAMIBOT, command not enabled)
command not enabledUse only commands listed in Supported commands above; ask a maintainer if the user needs something else
setCamera / setWorkMode blocked before a display actionAutomatic wake-up could not complete; wake the pet in the app and retry
Token errors like 4504Check / rotate the AK
3003Verify nickname matches the right device and that the model supports the capability

More detailed troubleshooting (including "why was this judged not-pet") lives in references/troubleshooting.md.


Doc map

FileAudienceContent
-------------------------
This SKILL.mdAgent / userAK, device list, pet/cmd usage, public capability name-level notes
references/api.mdUserGateway URLs and request body fields
references/schema.mdUserCommon response fields, set* input names and compatibility rules
references/troubleshooting.mdUserCommon error branches and resolution paths
references/phoenix-single-action.mdAgent单步 play_action 字段
references/phoenix-action-control.mdAgent编排 action_sequence 字段表
references/action-sequence.mdAgentdelay / conditions、helper、场景(无重复字段表)
references/dance-routines.mdAgent / user唯一预设 showcase_custom(定制秀舞)结构与 CLI

Supported commands are listed in this SKILL.md; protocol docs describe only those motion paths. Legacy multi-routine names (cheerful_motion, party, 点头舞, …) are aliases to showcase_custom only.

版本历史

共 2 个版本

  • v1.0.1 当前
    2026-06-06 06:58
  • v1.0.0
    2026-05-21 15:36 安全 安全

安全检测

腾讯云安全 (Keen)

队列中

腾讯云安全 (Sanbu)

队列中

🔗 相关推荐

dev-programming

Github

steipete
使用 `gh` CLI 与 GitHub 交互,通过 `gh issue`、`gh pr`、`gh run` 和 `gh api` 管理议题、PR、CI 运行及高级查询。
★ 677 📥 326,625
dev-programming

Mcporter

steipete
使用 mcporter CLI 直接列出、配置、认证及调用 MCP 服务器/工具(支持 HTTP 或 stdio),涵盖临时服务器、配置编辑及 CLI/类型生成功能。
★ 195 📥 67,521
dev-programming

YouTube

byungkyu
使用托管OAuth集成YouTube Data API,支持搜索视频、管理播放列表、获取频道数据及评论互动,适用于用户需要时使用此技能。
★ 142 📥 41,446