小贴吧(Xiaotieba / Zectrix smart sticky note)是一类通过云端 Open API 控制的 4.2 英寸电子墨水屏设备。这个 skill 帮助你:
This skill is intentionally credential-free. Never publish real API keys, device MACs, family names, schedule details, or private reminder content inside the skill package.
Use this skill when the user asks to:
Do not use this skill for unrelated e-paper hardware that has no Zectrix/Xiaotieba cloud API compatibility.
Typical device profile:
| Item | Value |
|---|---|
| ------ | ------- |
| Device class | Smart sticky-note / e-ink reminder display |
| Common model | zectrix-s3-epaper-4.2 |
| Screen | 4.2 inch e-paper |
| Resolution | 400×300 px |
| Connectivity | Wi-Fi + cloud API |
| Pages | Usually 3 pages, pageId = 1, 2, 3 |
Always verify the actual device list before pushing.
Recommended variable names:
export XIAOTIEBA_API_BASE="https://cloud.zectrix.com/open/v1"
export XIAOTIEBA_API_KEY="<your-api-key>"
export XIAOTIEBA_DEVICE_ID="<device-mac-or-id>"
If a script supports multiple devices, use explicit names:
export XIAOTIEBA_HOME_DEVICE_ID="<device-id>"
export XIAOTIEBA_OFFICE_DEVICE_ID="<device-id>"
For cron jobs or scripts, keep secrets outside the skill and outside git:
mkdir -p ~/.config/xiaotieba
chmod 700 ~/.config/xiaotieba
cat > ~/.config/xiaotieba/config.env <<'EOF'
XIAOTIEBA_API_BASE=https://cloud.zectrix.com/open/v1
XIAOTIEBA_API_KEY=<your-api-key>
XIAOTIEBA_DEVICE_ID=<device-mac-or-id>
EOF
chmod 600 ~/.config/xiaotieba/config.env
Then scripts can load it:
set -a
. "$HOME/.config/xiaotieba/config.env"
set +a
Base URL:
https://cloud.zectrix.com/open/v1
Authentication header:
X-API-Key: <your-api-key>
| Action | Method | Path |
|---|---|---|
| -------- | -------- | ------ |
| List devices | GET | /devices |
Example:
curl -fsS "$XIAOTIEBA_API_BASE/devices" \
-H "X-API-Key: $XIAOTIEBA_API_KEY"
Expected success shape may look like:
{
"code": 0,
"msg": "success",
"data": [
{
"deviceId": "AA:BB:CC:DD:EE:FF",
"alias": "zectrix-s3-epaper-4.2"
}
]
}
| Content | Method | Path | Notes |
|---|---|---|---|
| --------- | -------- | ------ | ------- |
| Plain text | POST | /devices/{deviceId}/display/text | Recommended default |
| Structured text | POST | /devices/{deviceId}/display/structured-text | Some deployments may return server errors; fallback to plain text |
| Image | POST | /devices/{deviceId}/display/image | Usually multipart upload |
curl -fsS -X POST "$XIAOTIEBA_API_BASE/devices/$XIAOTIEBA_DEVICE_ID/display/text" \
-H "X-API-Key: $XIAOTIEBA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"text": "🌤️ Today\n\nSunny, light jacket.\nRemember the 15:00 meeting.",
"fontSize": 20,
"pageId": "1"
}'
Expected success shape:
{
"code": 0,
"msg": "success",
"data": {
"totalPages": 1,
"pushedPages": 1
}
}
curl -fsS -X POST "$XIAOTIEBA_API_BASE/devices/$XIAOTIEBA_DEVICE_ID/display/structured-text" \
-H "X-API-Key: $XIAOTIEBA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"title": "Meeting",
"body": "15:00 Room 3\nBring laptop",
"fontSize": 16,
"pageId": "1"
}'
If this returns a 5xx error, switch to /display/text and include the title inside text.
API variants may differ. A common multipart pattern is:
curl -fsS -X POST "$XIAOTIEBA_API_BASE/devices/$XIAOTIEBA_DEVICE_ID/display/image" \
-H "X-API-Key: $XIAOTIEBA_API_KEY" \
-F "images=@/path/to/image.png" \
-F "dither=true" \
-F "pageId=1"
For best results, pre-render images at 400×300 px and use high-contrast black/white or grayscale dithering.
| Action | Method | Path |
|---|---|---|
| -------- | -------- | ------ |
| List todos | GET | /todos |
| Create todo | POST | /todos |
| Update todo | PUT | /todos/{id} |
| Complete todo | PUT | /todos/{id}/complete |
| Delete todo | DELETE | /todos/{id} |
Create todo example:
curl -fsS -X POST "$XIAOTIEBA_API_BASE/todos" \
-H "X-API-Key: $XIAOTIEBA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"title": "Buy milk",
"description": "On the way home",
"dueDate": "2026-03-20",
"dueTime": "18:30",
"repeatType": "none",
"priority": 2,
"deviceId": "AA:BB:CC:DD:EE:FF"
}'
E-paper is not a phone screen. Optimize for fast reading and limited refresh.
🌤️ Today
06 月 12 日 (周五)
Warmer than yesterday
Light jacket is enough
Good drying window: noon
Updated 06:00
A useful convention for 3-page devices:
| Page | Use | Example |
|---|---|---|
| ------ | ----- | --------- |
1 | Morning overview | weather, day plan, commute note |
2 | Tasks/homework | today’s tasks or “collecting…” fallback |
3 | Tomorrow schedule | next-day classes, meetings, prep list |
If a page’s source data is missing, push a clear fallback instead of leaving stale content on the display.
For deterministic recurring pushes, use a script plus cron/Hermes cron rather than asking the model to remember state.
Example script push-xiaotieba-text.sh:
#!/usr/bin/env bash
set -euo pipefail
CONFIG="$HOME/.config/xiaotieba/config.env"
if [[ ! -f "$CONFIG" ]]; then
echo "missing config: $CONFIG" >&2
exit 1
fi
set -a
. "$CONFIG"
set +a
PAGE_ID="${1:-1}"
TEXT="${2:-Test message}"
python3 - <<'PY' "$XIAOTIEBA_API_BASE" "$XIAOTIEBA_API_KEY" "$XIAOTIEBA_DEVICE_ID" "$PAGE_ID" "$TEXT"
import json, sys, urllib.request
base, key, device, page, text = sys.argv[1:6]
payload = json.dumps({"text": text, "pageId": str(page)}, ensure_ascii=False).encode("utf-8")
url = f"{base.rstrip('/')}/devices/{device}/display/text"
req = urllib.request.Request(
url,
data=payload,
headers={"X-API-Key": key, "Content-Type": "application/json"},
method="POST",
)
with urllib.request.urlopen(req, timeout=20) as resp:
body = resp.read().decode("utf-8", "replace")
print(body)
PY
Cron examples:
# Morning page
0 6 * * * /path/to/push-morning-summary.sh
# Task page
0 17 * * * /path/to/push-task-summary.sh
# Tomorrow schedule page
10 17 * * * /path/to/push-tomorrow-schedule.sh
Checklist:
deviceId from GET /devices.pageId is valid (1, 2, or 3).XIAOTIEBA_API_KEY is set and complete.abc...xyz; scripts must contain the full value or load it from a secure config file.~/.config/xiaotieba/config.env.chmod 600 ~/.config/xiaotieba/config.env.Use plain text:
Title
Body line 1
Body line 2
and send it via /display/text.
crontab -l or the Hermes cron list.chmod +x script.sh.~/.config/xiaotieba/config.env with mode 0600. and AA:BB:CC:DD:EE:FF.pageId. The push may land on an unexpected page or default page.GET /devices returns the expected device list.code: 0 or HTTP success.共 1 个版本