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-bluetooth-platform

v1.2.6

Published

A Homebridge platform Plugin for controlling SwitchBot bots using BLE (Bluetooth Low Energry)

Downloads

96

Readme

Homebridge SwitchBot Bluetooth Platform

npm version npm downloads latest commit

Why do I need (yet another) SwitchBot plugin?

Supported Devices

Supported Devices:

To Be Supported Soon:

Installation

Installing from Homebridge Plugins Page:

  1. Search for "switchbot bluetooth"
  2. Find homebridge-switchbot-bluetooth-platform
    • NOTE: Check noble prerequisites for your operating system. this is used for the bluetooth communcation.
  3. Install the plugin

Installing Directly:

  1. Open Terminal
  2. run command npm install -g homebridge-switchbot-bluetooth-platform
    • NOTE: Check noble prerequisites for your operating system. this is used for the bluetooth communcation.

Configuration

Add a new platform to your homebridge config.json file

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

under the new platform, add devices field

"platforms": [
    {
        "platform": "SwitchBotBluetoothPlatform",
        "name": "SwitchBotBluetoothPlatform",
        "devices": [
            {
                "type": "bot",
                "name": "Bedroom Bot",
                "address": "a4:ee:45:10:fa:5d"
            },
            {
                "type": "bot",
                "name": "Living Room Bot",
                "address": "c1:fe:61:33:sd:4f",
                "scanDuration": 2000,
                "scanRetries": 7,
                "scanRetryCooldown:": 1000,
            }
        ]
    }
]

Device Configuration Properties

Upon defining a device in the devices list, the following properties are available:

Mandatory Properties

  • name - Device name. Must be unique (no duplications).
  • type - Type of device. (currently only bot is supported).
  • address - MAC Address of the SwitchBot device. Learn how to find MAC Address.

Optional Properties

  • scanDuration - Time for scanning bluetooth devices (in miliseconds). A longer time will increase chance of successfuly detecting new devices, but reduce response time. Default is 5000 (5000 miliseconds)

  • scanRetries - The Number of times that the plugin should attempt scanning for SwitchBot device, before failing. Default is 5 (5 attempts)

  • scanRetryCooldown - Time for waiting between attempts of scanning / connecting to SwitchBot device. Default is 1000 (1000 miliseconds)

  • autoTurnOffInPressMode - Automatically Sets button back to OFF state when bot is configured to be in 'Press' mode (Enabled by default for bots that are set to 'Press' mode) Default is true (enabled)

Finding your SwitchBot MAC Address

  1. Download SwitchBot App - iOS App Store / Google Play Store
  2. Register / or Login into your SwitchBot account
  3. Open the device that you want to add to this platform
  4. Click Device Info
  5. Copy the BLE MAC address
  6. Add the address to the address property of the device in the config.json file (Your configuration)

Contact Me

For any questions, assistance or feedback feel free to contact me here

Buy Me a Coffee

If you want to buy me a coffee, you can do so here: https://paypal.me/galzo1 ♥️