DSH Plugins Marketplace

DSH Plugins

Plugins

/

Development & Infrastructure

/

dsh-smart-home-simulator

d

dsh-smart-home-simulator

Manifest valid

A draggable, resizable floating panel that simulates an air conditioner, light, curtain, and air purifier, with an agent-callable control tool.

UI (client)hasBundlePatch

智慧家庭模拟器(Smart Home Simulator)

一个 DSH Web 插件:侧边栏入口打开一个可拖动、可缩放的悬浮面板,演示空调、灯光、窗帘和空气净化器;同时注册一个 smart_home_control 工具,让大模型可以实时调节面板里的状态。

本插件仅供演示。所有状态都是插件内存里的模拟数据,不连接任何真实家电。

安装

方式 A:界面安装(推荐)

在 DSH 的「插件 → 添加插件」中输入:

@cubeai/dsh-smart-home-simulator

或从源码仓库安装:

https://openi.pcl.ac.cn/dsh/dsh-smart-home-simulator.git

安装后刷新 DSH,左侧栏下方会出现 智慧家庭模拟器。

方式 B:命令行安装

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 的所有会话生效。

功能

  • 侧边栏入口:Settings 上方的整行菜单项,右侧显示“N 台运行 / 全关”;侧边栏收起时变成 36×36 图标。
  • 悬浮面板:拖动标题栏移动,拖动任意边缘或四角缩放,X 或 Esc 关闭;位置和尺寸保存在浏览器 localStorage。
  • 四件设备
    • 空调:开关、制冷/制热/送风、16–30 °C、风速、摆风;出风动画。
    • 灯光:开关、亮度 1–100、暖光/自然/冷光;光晕随亮度和色温变化。
    • 窗帘:0–100% 开合滑杆、全开/全关;帘布开合动画。
    • 空气净化器:开关、风速、PM2.5 圆环和旋转风扇。
  • 场景:回家、离家、睡眠、影院。
  • AI 联动:工具修改状态后,面板若未打开会自动弹出,对应卡片高亮并显示“AI 已调节…”提示。
  • 亮/暗主题都使用 DSH 的 --dsw-alias-* token;设备图形使用独立配色。

工具

工具名:smart_home_control。一个 dispatcher,通过 device + action 区分操作。

参数类型说明
deviceac / light / curtain / purifier / all目标设备;all 用于场景、状态、重置、整屋开关
actionstatus / on / off / set / scene / resetstatus 只读;on/off 开关(窗帘为开/关);set 改设置并自动开机;scene 应用场景;reset 恢复默认
temperature16–30仅 ac + set
brightness1–100仅 light + set
color_tempwarm / neutral / cool仅 light + set
position0–100仅 curtain + set
modecool / heat / fan仅 ac + set
fan_speedauto / low / medium / high空调或净化器
swingboolean仅空调
scenehome / away / sleep / movieaction=scene 时必填

每次调用都返回 { ok, message, state },模型不需要二次查询。参数错误返回可读的 message,不会中断会话。

远程状态命令

给「智慧家庭客户端」的图形页签使用,插件额外注册了一个只读扩展命令:

/smarthome status
→ SH_STATE:{"homeId":"...","revision":12,"room":{...},"devices":{...}}
  • 该命令走 DSH 的命令注册表,由飞书频道的 ChatCommands 直接执行,不经过大模型。
  • 返回的是精简后的状态(不含 lastChange),用于 Web 客户端首次打开和操作后对账。
  • 控制操作仍然由 Web 客户端以用户身份发送自然语言提示词,远端 Agent 调用 smart_home_control。
  • 飞书频道需要在私聊中允许命令;如果回复“上一条消息正在合并”,等 5 秒再发。
  • 该命令不是工具,不会出现在模型的工具列表里;工具的 status 动作仍然保留。

演示脚本

可以直接对模型说:

  • “把空调调到 24 度,风速自动。”
  • “打开窗帘到 100%,灯光调到 40% 暖光。”
  • “我回家了。” → 回家场景
  • “现在家里各设备什么状态?” → status
  • “睡眠模式。” → 睡眠场景
  • “全部关掉。” → 整屋 off

状态与同步

  • Host 侧 index.js 持有唯一状态,2 秒一个 tick 让室温和 PM2.5 缓慢趋近设备设置。
  • Client 通过 /api/smart-home/state、/api/smart-home/action、/api/smart-home/wait 三个受 DSH /api 鉴权保护的精确 fetch 路由同步;wait 是 15–20 秒长轮询,状态一变更立刻返回,断线自动重试。
  • 面板操作和工具调用走同一个 applyAction reducer,避免两套逻辑。
  • 状态只在内存中,DSH 重启后恢复默认;多个标签页/会话共享同一个“家”。

开发

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

已知边界

  • 不接真实设备、MQTT 或 Home Assistant;没有持久化。
  • 状态是 profile 全局单例,不是每个会话一份。
  • 侧边栏入口位于 sidebar.footer.action。DSH 现有的 Cordis 面板入口占满该区域一行,因此插件给这个 slot 的父容器加了一条 flex-wrap,让两个整行入口上下排列;这是唯一一处宿主布局适配,作用域仅限该 slot。
  • 悬浮面板的像素级效果需要在浏览器里实际查看;安装脚本只能验证注册、状态逻辑和工具 schema。

Comments

Loading…

Similar plugins

schedule

Three draggable, resizable, auto-positioning floating desktop widgets for DSH Desktop — daily schedule, goals tracker, and calendar planner.

UI & ExperienceManifest valid

★ 0

dsh plugin --profile web add schedule

by YLifeOnlyOnce

Home Assistant control for DeepSeek Harness agents — approval-gated lights, switches, climate. 给 DeepSeek Harness agent 的 Home Assistant 控制插件,一键接入智能家居,一键接入智能生活。

Security & AuditManifest valid

★ 6

↓ 49/wk

MIT

TypeScript

Aug 19, 2026

dsh plugin --profile web add dsh-smarthome

by LazyMau

A draggable, resizable floating cheat sheet that collects your typing speed and stalls, heats the key map, reveals keys when you stall, and drills the characters you struggled with. Ships with several

Manifest valid

★ 0

JavaScript

Nov 6, 2026

dsh plugin --profile web add @local/shuangpin-reminder

by wly8691-jpg

Windows-native real-Office automation plugin (DSH). Contract, task-level, fault-injection and process-leak regressions covered; real-Office tests must be run on the target machine.

Tools & CapabilitiesDevelopment & InfrastructureModels & ProvidersManifest valid

★ 6

↓ 466/wk

MIT

JavaScript

Oct 25, 2026

dsh plugin --profile web add @eqman00003/dsh-office-com

by nszm

Floating desktop companion for DSH: a draggable character on the overlay — tap to charge energy, blinking and emotes, naps, synthesized WebAudio sounds and particle effects. Bring your own: any photo

Just for FunManifest valid

★ 0

BSD-3-Clause

TypeScript

Oct 27, 2026

dsh plugin --profile web add dsh-pet-lingchong

by xiaozs-com

DeepSeek Harness (dsh) host plugin bridging the local Screen Automation Helper desktop into the Agent tool system (30 tools).

Development & InfrastructureManifest valid

★ 0

↓ 50/wk

TypeScript

Oct 20, 2026

dsh plugin --profile web add dsh-screen-automation