node-red-contrib-switchbot-api
v0.1.4
Published
A node to control SwitchBot devices via its web APIs
Downloads
89
Readme
Getting Started
:warning: | This is not an official package and is in no way related to SwitchBot. :---: | :---
Prerequisites
- Node.js v10.0+
- Node-RED v1.0+
Installation
Install via Node-RED
Just search for node-red-contrib-switchbot-api
in the Pallete section (under the Install tab)
Install via npm
Navigate to your
.node-red
folder:cd ~/.node-red
Install the package:
npm install node-red-contrib-switchbot-api
Restart
node-red
Available Nodes
At the moment, send command
is the only available node type, which allows you to control SwitchBot devices (and remotes) via their web APIs; authorization is done via an API token which you can generate using SwitchBot's official mobile app:
- Download the SwitchBot app from the App Store or Google Play Store.
- Register a SwitchBot account and login to your account.
- Generate an API token by going to Profile > Preference, tap 'App Version' 10 times, tap 'Developer Options' once it becomes visible and finally tap 'Get Token'.
Inputs
API token
Your developer token which you just generated.
Device type
Type of the device, can either be a SwitchBot device or a virtual infrared remote.
Device name
The name of the device.
Command
The command you would like to pass to the device/remote. Full list of commands can be found here (this will take you to SwitchBot's official API documentation page).
Parameter
A custom parameter in case it is required by the command. Full list of commands along with their parameters can be found here (this will take you to SwitchBot's official API documentation page).