0.2.1 • Published 4 years ago

homebridge-switchbot-for-mac v0.2.1

Weekly downloads
34
License
MIT
Repository
github
Last release
4 years ago

Homebridge SwitchBot

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

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

PropertyTypeRequiredDefault ValueDescription
accessoryStringRequired-This value is "SwitchBot-For-Mac"
nameStringRequired-Set the name of the switch.
delayIntegerOptional0Set a delay between 0 and 30000 milliseconds for waiting for Bluetooth initialization.
retriesIntegerOptional3Set the turn retry times to more than 0 times.

Use one SwitchBot Settings

Settings for switching on/off using one SwitchBot.

PropertyTypeRequiredDefault ValueDescription
macAddressStringRequired-Set the MAC address of the SwitchBot.

Use two SwitchBots Settings

Settings for switching on/off using two SwitchBots.

PropertyTypeRequiredDefault ValueDescription
on.macAddressStringRequired-Set the MAC address of the SwitchBot for on.
off.macAddressStringRequired-Set the MAC address of the SwitchBot for off.

Advanced - Ping Settings

Settings for update the status with ping communication.

PropertyTypeRequiredDefault ValueDescription
ping.ipAddressStringRequired-Set the IP address of the target device.
ping.intervalIntegerOptional2000Set the ping interval to more than 2000 milliseconds.
ping.retriesIntegerOptional1Set the ping retry times to more than 0 times.
ping.timeoutIntegerOptional1000Set the ping timeout to less than interval / (retries + 1) milliseconds.
0.2.1

4 years ago

0.2.1-beta.0

4 years ago

0.2.0

4 years ago

0.2.0-beta.1

4 years ago

0.2.0-beta.0

4 years ago

0.1.4

4 years ago

0.1.4-beta.2

4 years ago

0.1.4-beta.3

4 years ago

0.1.4-beta.1

4 years ago

0.1.4-beta.0

4 years ago

0.1.3

4 years ago

0.1.3-beta.2

4 years ago

0.1.3-beta.1

4 years ago

0.1.3-beta.0

4 years ago

0.1.2

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago

0.0.12

4 years ago

0.0.10

4 years ago

0.0.11

4 years ago

0.0.9

4 years ago

0.0.9-beta.1

4 years ago

0.0.8

4 years ago

0.0.7

4 years ago

0.0.5

4 years ago

0.0.6

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago