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 🙏

© 2024 – Pkg Stats / Ryan Hefner

homebridge-switchbot-for-mac

v0.2.1

Published

Homebridge SwitchBot supports macOS and Raspbian.

Downloads

573

Readme

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

|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.

|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.|