treg
superdesigndev
OpenRouter for agent tools. Join community here: https://discord.gg/6mQYYfFMAn
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:cube-ai/dsh-smart-home-simulator
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
一个 DSH Web 插件:侧边栏入口打开一个可拖动、可缩放的悬浮面板,演示空调、灯光、窗帘和空气净化器;同时注册一个 smart_home_control 工具,让大模型可以实时调节面板里的状态。
本插件仅供演示。所有状态都是插件内存里的模拟数据,不连接任何真实家电。
在 DSH 的「插件 → 添加插件」中输入:
@cubeai/dsh-smart-home-simulator
或从源码仓库安装:
https://openi.pcl.ac.cn/dsh/dsh-smart-home-simulator.git
安装后刷新 DSH,左侧栏下方会出现 智慧家庭模拟器。
dsh plugin --profile web add @cubeai/dsh-smart-home-simulator
或:
dsh plugin --profile web add https://openi.pcl.ac.cn/dsh/dsh-smart-home-simulator.git
安装后如果页面没有自动加载新模块,刷新一次 Web GUI。插件是 profile 级安装,对该 profile 的所有会话生效。
localStorage。--dsw-alias-* token;设备图形使用独立配色。工具名:smart_home_control。一个 dispatcher,通过 device + action 区分操作。
| 参数 | 类型 | 说明 |
|---|---|---|
device |
ac / light / curtain / purifier / all |
目标设备;all 用于场景、状态、重置、整屋开关 |
action |
status / on / off / set / scene / reset |
status 只读;on/off 开关(窗帘为开/关);set 改设置并自动开机;scene 应用场景;reset 恢复默认 |
temperature |
16–30 | 仅 ac + set |
brightness |
1–100 | 仅 light + set |
color_temp |
warm / neutral / cool |
仅 light + set |
position |
0–100 | 仅 curtain + set |
mode |
cool / heat / fan |
仅 ac + set |
fan_speed |
auto / low / medium / high |
空调或净化器 |
swing |
boolean | 仅空调 |
scene |
home / away / sleep / movie |
action=scene 时必填 |
每次调用都返回 { ok, message, state },模型不需要二次查询。参数错误返回可读的 message,不会中断会话。
给「智慧家庭客户端」的图形页签使用,插件额外注册了一个只读扩展命令:
/smarthome status
→ SH_STATE:{"homeId":"...","revision":12,"room":{...},"devices":{...}}
ChatCommands 直接执行,不经过大模型。lastChange),用于 Web 客户端首次打开和操作后对账。smart_home_control。status 动作仍然保留。可以直接对模型说:
statusindex.js 持有唯一状态,2 秒一个 tick 让室温和 PM2.5 缓慢趋近设备设置。/api/smart-home/state、/api/smart-home/action、/api/smart-home/wait 三个受 DSH /api 鉴权保护的精确 fetch 路由同步;wait 是 15–20 秒长轮询,状态一变更立刻返回,断线自动重试。applyAction reducer,避免两套逻辑。dsh-smart-home-simulator/
├─ package.json
├─ cordis.patch.yml
├─ index.js # Host:状态、仿真、fetch 路由、工具
├─ client.js # Client:侧边栏入口、悬浮窗、四件设备、同步
├─ locale/zh.json
├─ locale/en.json
├─ icon.svg
├─ README.md
└─ test/state.test.mjs # reducer / 场景 / tick / wait 单测
本地校验:
node --check index.js
node --check client.js
node --test test/state.test.mjs
sidebar.footer.action。DSH 现有的 Cordis 面板入口占满该区域一行,因此插件给这个 slot 的父容器加了一条 flex-wrap,让两个整行入口上下排列;这是唯一一处宿主布局适配,作用域仅限该 slot。CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: 工具。