www.npmjs.com Open in urlscan Pro
2606:4700::6811:dfaf  Public Scan

Submitted URL: https://badge.fury.io/js/homebridge-command-bulb
Effective URL: https://www.npmjs.com/package/homebridge-command-bulb
Submission: On September 01 via api from US — Scanned from US

Form analysis 1 forms found in the DOM

GET /search

<form id="search" method="GET" action="/search" class="_13c93d41 relative flex bg-transparent ph3 ph2 pv2 ph0-ns pv0-ns bt b--black-10 bn-ns">
  <div class="e82b10fd relative dde91b96">
    <div class="_2f299eeb nowrap flex"><span class="_705cdf4f db fl pl3 pr1"><svg width="15px" height="15px" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 18 18" aria-hidden="true">
          <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
            <g stroke="#777777" stroke-width="1.3">
              <g>
                <path d="M13.4044,7.0274 C13.4044,10.5494 10.5494,13.4044 7.0274,13.4044 C3.5054,13.4044 0.6504,10.5494 0.6504,7.0274 C0.6504,3.5054 3.5054,0.6504 7.0274,0.6504 C10.5494,0.6504 13.4044,3.5054 13.4044,7.0274 Z"></path>
                <path d="M11.4913,11.4913 L17.8683,17.8683"></path>
              </g>
            </g>
          </g>
        </svg></span><input type="search" role="combobox" name="q" hotkeys="[object Object]" placeholder="Search packages" aria-label="Search packages" aria-controls="typeahead-list-246034" aria-expanded="false" aria-activedescendant=""
        inputref="[object Object]" autocomplete="off" class="_390acbc5 f5 fw3 black relative" value="" element="input"></div>
  </div><button type="submit" class="_0da775bb bn pv2 ph4 f6 white pointer bn pv2 ph4 f6 white pointer" aria-label="Search">Search</button><input type="hidden" name="csrftoken" value="ulEx1ms1y6_UwLJY-QGQkDZTR_qWD74nVrKP5dQ5Ktm">
</form>

Text Content

skip to:contentpackage searchsign in
❤
 * Pro
 * Teams
 * Pricing
 * Documentation

npm


Search
Sign UpSign In


HOMEBRIDGE-COMMAND-BULB

0.0.2 • Public • Published 6 years ago
 * Readme
 * Code Beta
 * 1 Dependency
 * 0 Dependents
 * 2 Versions


HOMEBRIDGE-COMMAND-BULB



在 HomeKit 中创建虚拟设备(灯),映射灯的亮度值到自定义的脚本上

Need I Say More?

Yeah:搭配「场景」使用,可以自定义语音指令,可参阅 歪用 HomeKit 让 Siri 更「听话」


配置

Homebridge 配置如下:

{
    "platforms": [
        {
            "platform": "CommandPlatform",
            "directory": "~/.homebridge/commands",
            "tg_token": "",
            "tg_chat_id": "",
            "proxy": "http://localhost:8888"
        }
    ]
}

 * 需要自己创建 Shell 脚本目录,默认为~/.homebridge/commands
 * Telegram token 需要通过 @BotFather 申请;chat id 可以通过 @get_id_bot 获取
 * 插件连接 Telegram 通常需要 proxy,请科学解决。如果是 socks proxy 的话可以用 privoxy 转换为 http proxy

重启 Homebridge 后会添加两个灯,「Command Bulb」和「Probe
Bulb」,前者用于执行命令,后者用于排除模糊指令干扰(没有其它用处,请无视它的存在)


脚本规则

脚本应具有可执行权限,约定先于配置,脚本前缀、后缀采用如下规则:

 * 前缀(前两位,01 - 99)用于映射亮度,比如「01」对应亮度为 1,此外,所有前缀为「01」的脚本都会被执行,可以一次执行多个独立脚本。预留了亮度为
   0 和 100 两个值用于标识「成功 / 失败」,所以不要用「00」作为前缀
 * 后缀用于辅助功能,目前是用于 Telegram 推送消息(在配置了相关参数的情况下)
   * 「.ok」表示执行成功时推送「Command: xxx OK!」。注意,默认情况下,执行过程中存在 stderr 不会被认为是失败
   * 「.out」表示推送 stdout
   * 「.err」表示推送 stderr,并且执行过程中存在 stderr 会被认为是失败
   * 如果失败,总是会推送「Command: xxx Failed!」消息,无需后缀
   * 多个后缀可组合,如「.ok.out」,会推送成功和标准输出两条消息
   * 其它未定义的及「.sh」可有可无,会忽略


README


KEYWORDS

 * homebridge-plugin








PACKAGE SIDEBAR


INSTALL

npm i homebridge-command-bulb


REPOSITORY

Gitgithub.com/jayqizone/homebridge-command-bulb


HOMEPAGE

github.com/jayqizone/homebridge-command-bulb#readme


DOWNLOADSWEEKLY DOWNLOADS

3


VERSION

0.0.2


LICENSE

ISC


UNPACKED SIZE

10.2 kB


TOTAL FILES

4


ISSUES

1


PULL REQUESTS

0


LAST PUBLISH

6 years ago


COLLABORATORS

 * 

Try on RunKit
Report malware


FOOTER


SUPPORT

 * Help
 * Advisories
 * Status
 * Contact npm


COMPANY

 * About
 * Blog
 * Press


TERMS & POLICIES

 * Policies
 * Terms of Use
 * Code of Conduct
 * Privacy