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

@eweiss/homebridge-switchbot-ble

v1.6.5

Published

Experimental Homebridge integration for SwitchBot BLE series products

Downloads

21

Readme

@switchbot/homebridge-switchbot-ble

npm version npm downloads

The @switchbot/homebridge-switchbot-ble is a nodejs module , and also a homebridge plug-in that directly controls SwitchBot products via BLE.

Now supports:

Installation

Installing bluetooth libraries

Ubuntu, Debian, Raspbian
sudo apt-get install bluetooth bluez libbluetooth-dev libudev-dev

See the document of the @abandonware/noble for other operating systems details.

Installing package

sudo npm install -g @switchbot/homebridge-switchbot-ble

You can also install it on the homebridge plugins page. homebridge-plugins-search

Configuration

Add this to your homebridge config.json file

"platforms": [
    {
        "platform": "SwitchBotPlatform",
        "name": "SwitchBotPlatform"
    }
]

If it work, add devices.

"platforms": [
    {
        "platform": "SwitchBotPlatform",
        "name": "SwitchBotPlatform",
        "devices": [
            {
                "type": "bot",
                "name": "Bot 2c",
                "bleMac": "d4:cc:43:97:ae:2c"
            },
            {
                "type": "bot",
                "name": "Bot 51",
                "bleMac": "e7:4d:36:cf:9e:51",
                "scanDuration": 2000
            },
            {
                "type": "curtain",
                "name": "Curtain 11",
                "bleMac": "ec:58:c5:d0:01:11",
                "scanDuration": 2000,
                "reverseDir": false,
                "moveTime": 2000
            },
            {
                "type": "meter",
                "name": "Meter 84",
                "bleMac": "d0:d5:64:14:43:84",
                "scanDuration": 5000,
                "scanInterval": 60000
            }
        ]
    }
]

Requird Settings

  • devices - SwitchBot devices list.
  • type - Device type. Currently supports bot, curtain and meter.
  • name - Device name.
  • bleMac - Device MAC address. You can find it in App settings.

Optional Settings

  • scanDuration - Scan timeout. BLE Central must first scan the advertising. Default is 1000 (unit: ms). Longer time to ensure device discovery but slower response.
  • reverseDir - Set to true to exchange the "opened" and "closed" directions of Curtain after calibration. Default is false. So you can swap the directions without recalibration.
  • moveTime - Set the actual running time of Curtain, which is also the time to switch from running state to opened/closed state in the Home APP. Default is 2000 (unit: ms).
  • scanInterval
    • For a Meter, sets how frequently to scan in order to retrieve temperature and humidity values. Default is 60000 (unit: ms).
    • For a Curtain, sets how frequently to scan in order to retrieve the curtain position. Default is 60000 (unit: ms) when idle.
  • openCloseThreshold - Set the threshold before/after which the curtain is reported as fully open/closed to HomeKit. Default is 5, so any position under 5% is reported as fully open and above 95% as fully closed.

Please note that:

  1. The device name cannot be the same.
  2. Restart HomeBridge after updating the config file.
  3. The "opened" and "closed" directions of HomeKit are the same as those in Curtain and SwitchBot APP, but the percentage definitions are different. "Closed" is 0% in HomeKit but 100% in Curtain and APP.

Community