• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

zizi4n5/homebridge-switchbot-for-mac: Homebridge SwitchBot is plugin for Homebri ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

zizi4n5/homebridge-switchbot-for-mac

开源软件地址:

https://github.com/zizi4n5/homebridge-switchbot-for-mac

开源编程语言:

TypeScript 88.9%

开源软件介绍:

Homebridge SwitchBot

verified-by-homebridge npm version npm downloads

Homebridge SwitchBot is plugin for Homebridge that allows you to manage SwitchBot (the Bot) like a switch accessory on the Home app.

Supported SwitchBot devices

Supported OS versions

macOS

  • macOS version 10.15 or later
  • Install Xcode

Big Sur

Set to manually grant Bluetooth access in System Preferences UI for Security & Privacy -> Privacy to the node executable. Security & Privacy -> Privacy The symlink part is important. If you installed node via homebrew, you cannot grant Bluetooth privileges to /usr/local/bin/node, but have to target /usr/local/Cellar/node/x.x.x/bin/node explicitly.

Raspbian(Linux-based OS)

  • Kernel version 3.6 or later
  • libbluetooth-dev
sudo apt-get install bluetooth bluez libbluetooth-dev libudev-dev

If @abandonware/noble is installed properly, this module might work well on other Linux-based OSes, such as Ubuntu, Debian and so on. See the document of the @abandonware/noble for details.

Dependencies

Installation

Install the npm package:

sudo npm install -g --unsafe-perm homebridge-switchbot-for-mac

How to Use

Find your SwitchBot's MAC address (BLE MAC) with the official iOS/Android app, and add an accessory definition to ~/.homebridge/config.json:

e.g. Use one SwitchBot

{
    "accessories": [
        {
            "accessory": "SwitchBot-For-Mac",
            "name": "Switch",
            "delay": 5000,
            "retries": 3,
            "macAddress": "01:23:45:67:89:AB",
            "ping": {
                "ipAddress": "127.0.0.1",
                "interval": 2000,
                "retries": 1,
                "timeout": 1000
            }
        }
    ]
}

e.g. Use two SwitchBots

{
    "accessories": [
        {
            "accessory": "SwitchBot-For-Mac",
            "name": "Switch",
            "delay": 5000,
            "retries": 3,
            "on": {
                "macAddress": "CD:E0:12:34:56:78"
            },
            "off": {
                "macAddress": "9A:BC:DE:01:23:45"
            },
            "ping": {
                "ipAddress": "127.0.0.1",
                "interval": 2000,
                "retries": 1,
                "timeout": 1000
            }
        }
    ]
}

Settings

Property Type Required Default Value Description
accessory String Required - This value is "SwitchBot-For-Mac"
name String Required - Set the name of the switch.
delay Integer Optional 0 Set a delay between 0 and 30000 milliseconds for waiting for Bluetooth initialization.
retries Integer Optional 3 Set the turn retry times to more than 0 times.

Use one SwitchBot Settings

Settings for switching on/off using one SwitchBot.

Property Type Required Default Value Description
macAddress String Required - Set the MAC address of the SwitchBot.

Use two SwitchBots Settings

Settings for switching on/off using two SwitchBots.

Property Type Required Default Value Description
on.macAddress String Required - Set the MAC address of the SwitchBot for on.
off.macAddress String Required - Set the MAC address of the SwitchBot for off.

Advanced - Ping Settings

Settings for update the status with ping communication.
You can only set it if you can using ping to determine if the device is on or off.
Otherwise, do not set it.

Property Type Required Default Value Description
ping.ipAddress String Required - Set the IP address of the target device.
ping.interval Integer Optional 2000 Set the ping interval to more than 2000 milliseconds.
ping.retries Integer Optional 1 Set the ping retry times to more than 0 times.
ping.timeout Integer Optional 1000 Set the ping timeout to less than interval / (retries + 1) milliseconds.



鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap