npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

koishi-plugin-mihome

v1.1.0

Published

米家智能家居控制插件 for Koishi

Readme

koishi-plugin-mihome

米家智能家居控制插件 for Koishi

功能

  • 🔐 登录管理:支持账号密码登录和扫码登录
  • 📱 设备管理:查看设备列表、房间列表
  • 🔌 设备控制:查看设备状态、控制设备属性
  • 🔗 命令别名:支持自定义短命令别名,实现无前缀触发
  • 👤 用户隔离:每个用户独立管理自己的米家设备

安装

npm install koishi-plugin-mihome

配置

| 配置项 | 类型 | 默认值 | 说明 | |--------|------|--------|------| | dataDir | string | data/mihome | 数据存储目录 | | enableNoPrefixTrigger | boolean | true | 启用无前缀触发 | | allowedUsers | string[] | [] | 允许使用的用户ID列表(留空则所有人可用) |

命令

登录相关

  • 米家登录 - 使用账号密码登录米家
  • 米家扫码登录 - 使用扫码方式登录米家
  • 米家登出 - 登出米家账号

设备管理

  • 米家设备 - 查看设备列表
  • 米家房间 - 查看房间列表
  • 米家状态 <设备名> - 查看指定设备状态
  • 米家控制 <设备名> - 控制指定设备

命令别名

  • 米家关联 <短命令> <长命令> - 关联短命令到长命令
  • 米家删除关联 <短命令> - 删除命令别名
  • 米家关联列表 - 查看所有命令别名

其他

  • 结束控制 - 取消当前控制操作

使用示例

1. 绑定米家账号

米家扫码登录

使用米家APP扫描二维码完成登录。

2. 查看设备

米家设备

3. 查看设备状态

米家状态 台灯

4. 控制设备

米家控制 台灯

然后按提示输入要调整的参数名和值。

也支持单行控制:

米家控制 台灯 开关 开

5. 设置命令别名

米家关联 开灯 米家控制 台灯

设置后可以直接发送"开灯"来触发控制命令。

支持一个别名绑定多个操作(用英文 ; 或中文 分隔):

米家关联 开全屋灯 米家控制 客厅灯 开关 开; 米家控制 餐厅灯 开关 开;米家控制 卧室灯 开关 开

触发后会顺序执行,并将所有执行结果合并在同一条消息里返回。

6. 查看已设置的别名

米家关联列表

适配器

设备适配器文件存放在 {dataDir}/adapters/ 目录下,格式为 YAML。

适配器格式示例

actionable:
  - name:
      - 开关
    desc: 台灯开关,可用值:开、关
    siid: 2
    piid: 1
    value_regexp: /(开|关)/g
  - name:
      - 亮度
    desc: 调整台灯亮度,可用值:1-100
    siid: 2
    piid: 2
    value_regexp: /([1-9]|[1-9][0-9]|100)/g

viewable:
  - name: 台灯状态
    siid: 2
    piid: 1
    unit: ""
  - name: 台灯亮度
    siid: 2
    piid: 2
    unit: "%"

注意事项

  1. 每个用户只能操作自己绑定的米家设备
  2. 设备型号未支持时,需要手动添加适配器文件,您可以利用人工智能,将设备的API页面(https://home.miot-spec.com/)中包含的API端点网站发送给人工智能,然后将上方的示例粘贴,并让人工智能帮您生成适配器文件,随后手动放入适配器目录即可。
  3. 别名触发功能可以通过配置 enableNoPrefixTrigger 开关

致谢

本插件基于 mijia-plugin 迁移而来。