Home

Awesome

SwitchBot API v1.1

Introduction

This document describes a collection of SwitchBot API methods, examples, and best practices for, but not limited to, IoT hobbyists, developers, and gurus to make their own smart home programs or applications.

About the New Version

We will stop adding support for new products on v1.0 as we release v1.1.

Hence, we strongly recommend all SwitchBot users to migrate to the new API version because we have improved the authentication method. This will make the communication between your server and the SwitchBot server more secure.

Getting Started

Please follow these steps,

  1. Download the SwitchBot app on App Store or Google Play Store

  2. Register a SwitchBot account and log in into your account

  3. Generate an Open Token within the app For app version ≥ V9.0, a) Go to Profile > Preferences > About b) Tap App Version 10 times. Developer Options will show up c) Tap Developer Options d) Tap Get Token

For app version < V9.0, a) Go to Profile > Preferences b) Tap App Version 10 times. Developer Options will show up c) Tap Developer Options d) Tap Get Token

  1. Roll up your sleeves and get your hands dirty with SwitchBot OpenAPI!

Authentication

Open Token and Secret Key

Note: You must update the app to the latest version, V6.14 or later, in order to get the secret key.

In SwitchBot API v1.1, the authentication method has been improved. In order to gain access to private data through the API, you must generate a unique signature using a token and a secret key. When you make a request, the Authorization token and signature will be validated simultaneously.

You as a developer will then be able to add, delete, edit, and look up your data including profile data and data associated with the devices that have been added to your SwitchBot account.

To continue to use SwitchBot API v1.0, refer to the legacy document.

How to Sign?

We have attached some scripts for you to quickly generate a sign. If you prefer to write your own script or routine, here is the procedure.

  1. Print the 13 digit timestamp and concatenate it with your token
  2. Create a signature using your secret and the string produced in the previous step
  3. Convert the signature to upper case

For instance,

# secret key
secret = "" # copy and paste from the SwitchBot app V6.14 or later
# open token
token = "" # copy and paste from the SwitchBot app V6.14 or later
t = 1661927531000
sign = HMAC-SHA256(token + t, secret).toUpperCase()

Python 2 example code

import time
import hashlib
import hmac
import base64

# open token
token = '' # copy and paste from the SwitchBot app V6.14 or later
# secret key
secret = '' # copy and paste from the SwitchBot app V6.14 or later
nonce = ''
t = int(round(time.time() * 1000))
string_to_sign = '{}{}{}'.format(token, t, nonce)

sign = base64.b64encode(hmac.new(secret, msg=string_to_sign, digestmod=hashlib.sha256).digest())
print ('Authorization: {}'.format(token))
print ('t: {}'.format(t))
print ('sign: {}'.format(sign))
print ('nonce: {}'.format(nonce))

Python 3 example code

import json
import time
import hashlib
import hmac
import base64
import uuid

# Declare empty header dictionary
apiHeader = {}
# open token
token = '' # copy and paste from the SwitchBot app V6.14 or later
# secret key
secret = '' # copy and paste from the SwitchBot app V6.14 or later
nonce = uuid.uuid4()
t = int(round(time.time() * 1000))
string_to_sign = '{}{}{}'.format(token, t, nonce)

string_to_sign = bytes(string_to_sign, 'utf-8')
secret = bytes(secret, 'utf-8')

sign = base64.b64encode(hmac.new(secret, msg=string_to_sign, digestmod=hashlib.sha256).digest())
print ('Authorization: {}'.format(token))
print ('t: {}'.format(t))
print ('sign: {}'.format(str(sign, 'utf-8')))
print ('nonce: {}'.format(nonce))

#Build api header JSON
apiHeader['Authorization']=token
apiHeader['Content-Type']='application/json'
apiHeader['charset']='utf8'
apiHeader['t']=str(t)
apiHeader['sign']=str(sign, 'utf-8')
apiHeader['nonce']=str(nonce)

JavaScript example code

const crypto = require('crypto');
const https = require('https');

const token = "yourToken";
const secret = "yourSecret";
const t = Date.now();
const nonce = "requestID";
const data = token + t + nonce;
const sign = crypto
    .createHmac('sha256', secret)
    .update(data)
    .digest('base64');
console.log(sign);

const body = JSON.stringify({
    "command": "turnOn",
    "parameter": "default",
    "commandType": "command"
});
const deviceId = "MAC";
const options = {
    hostname: 'api.switch-bot.com',
    port: 443,
    path: `/v1.1/devices/${deviceId}/commands`,
    method: 'POST',
    headers: {
        "Authorization": token,
        "sign": sign,
        "nonce": nonce,
        "t": t,
        'Content-Type': 'application/json',
        'Content-Length': body.length,
    },
};

const req = https.request(options, res => {
    console.log(`statusCode: ${res.statusCode}`);
    res.on('data', d => {
        process.stdout.write(d);
    });
});

req.on('error', error => {
    console.error(error);
});

req.write(body);
req.end();

C# example code

using System;
using System.Diagnostics;
using System.Text;
using System.Security.Cryptography;
using System.Net.Http;

string token = "My Token";
string secret = "My Secret Key";
DateTime dt1970 = new DateTime(1970, 1, 1);
DateTime current = DateTime.Now;
TimeSpan span = current - dt1970;
long time = Convert.ToInt64(span.TotalMilliseconds);
string nonce = Guid.NewGuid().ToString();
string data = token + time.ToString() + nonce;
Encoding utf8 = Encoding.UTF8;
HMACSHA256 hmac = new HMACSHA256(utf8.GetBytes(secret));
string signature = Convert.ToBase64String(hmac.ComputeHash(utf8.GetBytes(data)));

//Create http client
HttpClient client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, @"https://api.switch-bot.com/v1.1/devices");
request.Headers.TryAddWithoutValidation(@"Authorization", token);
request.Headers.TryAddWithoutValidation(@"sign", signature);
request.Headers.TryAddWithoutValidation(@"nonce", nonce);
request.Headers.TryAddWithoutValidation(@"t", time.ToString());

var response = await client.SendAsync(request);

Console.WriteLine(await response.Content.ReadAsStringAsync());

Java 11+ example code

import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.net.http.HttpResponse.BodyHandlers;
import java.time.Instant;
import java.util.Base64;
import java.util.UUID;

import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;

public class Main {
    public static void main(String[] args) throws Exception {
    	
      String token = args[0];
      String secret = args[1];
      String nonce = UUID.randomUUID().toString();
      String time= "" + Instant.now().toEpochMilli();
      String data = token + time + nonce;
      
      SecretKeySpec secretKeySpec = new SecretKeySpec(secret.getBytes("UTF-8"), "HmacSHA256");
      Mac mac = Mac.getInstance("HmacSHA256");
      mac.init(secretKeySpec);
      String signature = new String(Base64.getEncoder().encode(mac.doFinal(data.getBytes("UTF-8"))));      
      
      HttpRequest getDevices = HttpRequest.newBuilder()
      .uri(new URI("https://api.switch-bot.com/v1.1/devices"))
      .header("Authorization", token)
      .header("sign", signature)
      .header("nonce", nonce)
      .header("t", time)
      .GET()
      .build();
      
      HttpResponse<String> response = HttpClient.newBuilder().build().send(getDevices, BodyHandlers.ofString());
      
      System.out.println(response.body());
    }
}

PHP example code

<?php
$token = 'XXXXXXXXXXXXXXXXXXX';
$secret = 'YYYYYYYYYYY';
$nonce = guidv4();
$t = time() * 1000;
$data = utf8_encode($token . $t . $nonce);
$sign = hash_hmac('sha256', $data, $secret,true);
$sign = strtoupper(base64_encode($sign));

$url = "https://api.switch-bot.com/v1.1/devices";

$curl = curl_init($url);
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);

$headers = array(
    "Content-Type:application/json",
    "Authorization:" . $token,
    "sign:" . $sign,
    "nonce:" . $nonce,
    "t:" . $t
);

curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
$response = curl_exec($curl);
curl_close($curl);

function guidv4($data = null) {
    // Generate 16 bytes (128 bits) of random data or use the data passed into the function.
    $data = $data ?? random_bytes(16);
    assert(strlen($data) == 16);
    $data[6] = chr(ord($data[6]) & 0x0f | 0x40);
    $data[8] = chr(ord($data[8]) & 0x3f | 0x80);

    // Output the 36 character UUID.
    return vsprintf('%s%s-%s-%s-%s-%s%s%s', str_split(bin2hex($data), 4));
}

Swift example code

import CryptoKit 

let token = 'TTTTTTT'
let secret = 'SSSS'

func getDevices() async throws -> Any {
    let hostname = "https://api.switch-bot.com"
    
    var components = URLComponents(string: hostname)!
    components.path = "/v1.1/devices"
    components.port = 443
    
    var request = URLRequest(url: components.url!)
    
    request.setValue("application/json", forHTTPHeaderField: "Content-Type")
    request.setValue("utf-8", forHTTPHeaderField: "charset")
    let timestamp = Int(Date().timeIntervalSince1970.rounded() * 1000) // Date().timeInterval returns seconds, not milliseconds, since1970
    let nonce =  UUID().uuidString
    
    let timeAdjustedToken = token + "\(timestamp)" + nonce
    let key = SymmetricKey(data: Data(secret.utf8))
    let authenticationCode = HMAC<SHA256>.authenticationCode(for: Data(timeAdjustedToken.utf8), using: key)
    let signatureToken = Data(authenticationCode).base64EncodedString()

    request.setValue(token, forHTTPHeaderField: "Authorization")
    request.setValue(signatureToken, forHTTPHeaderField: "sign")
    request.setValue(nonce, forHTTPHeaderField: "nonce")
    request.setValue("\(timestamp)", forHTTPHeaderField: "t")
    
    let (data, response) = try await URLSession.shared.data(for: request)
    return try JSONSerialization.jsonObject(with: data)
}

Glossary

The following table provides definitions to the terms to be frequently mentioned in the subsequent sections.

TermDescriptionModel No.Availability
Hub MiniShort for SwitchBot Hub MiniW0202200
Hub PlusShort for SwitchBot Hub PlusSwitchBot Hub S1
Hub 2Short for SwitchBot Hub 2W3202100
BotShort for SwitchBot BotSwitchBot S1
CurtainShort for SwitchBot CurtainW0701600
Curtain 3Short for SwitchBot Curtain 3W2400000
PlugShort for SwitchBot PlugSP11Currently only available in Japan
MeterShort for SwitchBot Thermometer and HygrometerSwitchBot MeterTH S1
Meter Plus (JP)Short for SwitchBot Thermometer and Hygrometer Plus (JP).W2201500Only available in Japan
Meter Plus (US)Short for SwitchBot Thermometer and Hygrometer Plus (US)W2301500Only available in US
Outdoor MeterShort for Indoor/Outdoor Thermo-HygrometerW3400010
Meter ProShort for SwitchBot Meter ProW4900000
Meter Pro (CO2 Monitor)Short for SwitchBot Meter Pro (CO2 Monitor)W4900010
Motion SensorShort for SwitchBot Motion SensorW1101500
Contact SensorShort for SwitchBot Contact SensorW1201500
Water Leak DetectorShort for SwitchBot Water Leak DetectorW4402000
Color BulbShort for SwitchBot Color BulbW1401400
Strip LightShort for SwitchBot LED Strip LightW1701100
Plug Mini (US)Short for SwitchBot Plug Mini (US)W1901400 and W1901401Only available in US
Plug Mini (JP)Short for SwitchBot Plug Mini (JP)W2001400 and W2001401Only available in Japan
LockShort for SwitchBot LockW1601700
Lock ProShort for SwitchBot Lock ProW3500000
KeypadShort for SwitchBot LockW2500010
Keypad TouchShort for SwitchBot LockW2500020
S1Short for SwitchBot Robot Vacuum Cleaner S1W3011000
S1 PlusShort for SwitchBot Robot Vacuum Cleaner S1 PlusW3011010
K10+Short for SwitchBot Mini Robot Vacuum K10+W3011020
K10+ ProShort for SwitchBot Mini Robot Vacuum K10+ ProW3011026
S10Short for SwitchBot Floor Cleaning Robot S10W3211800
K10+ Pro ComboShort for SwitchBot Robot Vacuum K10+ Pro ComboW3002500
Ceiling LightShort for SwitchBot Ceiling LightW2612230 and W2612240Currently only available in Japan
Ceiling Light ProShort for SwitchBot Ceiling Light ProW2612210 and W2612220Currently only available in Japan
Indoor CamShort for SwitchBot Indoor CamW1301200
Pan/Tilt CamShort for SwitchBot Pan/Tilt CamW1801200
Pan/Tilt Cam 2KShort for SwitchBot Pan/Tilt Cam 2KW3101100
Blind TiltShort for SwitchBot Blind TiltW2701600
Battery Circulator FanShort for SwitchBot Battery Circulator FanW3800510
Circulator FanShort for SwitchBot Circulator FanW3800511
Evaporative HumidifierShort for SwitchBot Evaporative HumidifierW3902300
Evaporative Humidifier (Auto-refill)Short for SwitchBot Evaporative Humidifier (Auto-refill)W3902310
Air Purifier PM2.5Short for SwitchBot Air PurifierW5302300
Air Purifier Table PM2.5Short for SwitchBot Air Purifier TableW5302310
Air Purifier VOCShort for SwitchBot Air PurifierW5302300Currently only available in Japan
Air Purifier Table VOCShort for SwitchBot Air Purifier TableW5302310Currently only available in Japan
Roller ShadeShort for SwitchBot Roller ShadeW5000000
Relay Switch 1PMShort for SwitchBot Relay Switch 1PMW5502310
Relay Switch 1Short for SwitchBot Relay Switch 1W5502300

Legacy Cloud Services

Important note: Beyond V9.0, there will NOT be a Cloud Services option in the app. You will see Third-party Services instead. Please read this article for more information, https://support.switch-bot.com/hc/en-us/articles/7257579858455

A SwitchBot app feature, which appears in the app <V9.0 that

  1. Enables SwitchBot products to be discovered and communicated with third-party services such as Home Assistant, Alexa, Google Home, IFTTT, SmartThings, and so forth
  2. Allows users to create customized smart scenes and widgets. For BLE-based devices such as Bot and Curtain
  3. You MUST first add a SwitchBot Hub such as Hub 2, Hub Mini with Matter Enabled, or Hub Mini
  4. Then enable Cloud Services on the Settings page in order to make use of the web API!

API Usage

Host Domain

https://api.switch-bot.com

Sending a Request

The following request types are supported,

Content-Type

For POST requests, use application/json; charset=utf8 as the Content-Type

Request limit

The amount of API calls per day is limited to 10000 times. Going over that limit will return "Unauthorized."

Request Header

The following parameters need to be included into the header,

ParameterTypeLocationRequiredDescription
AuthorizationStringheaderYesOpen Token acquired
signStringheaderYesA signature generated from the token and secret key using a specific algorithm.
tLongheaderYesA 13 digit timestamp (standard time).
nonceLongheaderYesA random UUID generated by developers themselves to blend into the string to sign.

Standard HTTP Error Codes

The following table lists the most common HTTP error response,

CodeNameDescription
400Bad RequestThe client has issued an invalid request. This is commonly used to specify validation errors in a request payload.
401UnauthorizedAuthorization for the API is required, but the request has not been authenticated.
403ForbiddenThe request has been authenticated but does not have appropriate permissions, or a requested resource is not found.
404Not FoundSpecifies the requested path does not exist.
406Not AcceptableThe client has requested a MIME type via the Accept header for a value not supported by the server.
415Unsupported Media TypeThe client has defined a contentType header that is not supported by the server.
422Unprocessable EntityThe client has made a valid request, but the server cannot process it. This is often used for APIs for which certain limits have been exceeded.
429Too Many RequestsThe client has exceeded the number of requests allowed for a given time window.
500Internal Server ErrorAn unexpected error on the SmartThings servers has occurred. These errors should be rare.

Devices

The devices API is used to access the properties and states of SwitchBot devices and to send control commands to those devices.

Get device list

GET /v1.1/devices

Description

Get a list of devices, which include physical devices and virtual infrared remote devices that have been added to the current user's account.

Note: For devices that communicate via BLE, please enable Cloud Services on SwitchBot app first.

Physical devices refer to the following SwitchBot products,

Virtual infrared remote devices refer to virtual devices that are used to simulate infrared signals of a home appliance remote control. A SwitchBot Hub Plus, Hub Mini, Hub 2, or Ceiling Light is required in order to be able to create these virtual devices within the app. The types of appliances supported include,

Responses

The response is basically a JSON object, which contains the following properties,

Key NameValue Type
statusCodeInteger
messageString
bodyObject<body>

The body object contains the following properties,

Key NameValue TypeDescription
deviceListArray<device>a list of physical devices
infraredRemoteListArray<infraredRemote>a list of virtual infrared remote devices

The response may contain the following codes and messages,

Status CodeBody ContentMessageDescription
100Device list objectsuccessReturns an object that contains two device lists
n/an/aUnauthorizedHttp 401 Error. User permission is denied due to invalid token.
190n/aSystem errorDevice internal error due to device states not synchronized with server

The deviceList array contains a list of objects with the following key-value attributes,

Bot
KeyValue TypeDescription
deviceIdStringdevice ID
deviceNameStringdevice name
deviceTypeStringdevice type. Bot
enableCloudServiceBooleandetermines if Cloud Service is enabled or not for the current device
hubDeviceIdStringdevice's parent Hub ID
Curtain
KeyValue TypeDescription
deviceIdStringdevice ID
deviceNameStringdevice name
deviceTypeStringdevice type. Curtain
enableCloudServiceBooleandetermines if Cloud Service is enabled or not for the current device
hubDeviceIdStringdevice's parent Hub ID
curtainDevicesIdsArray<deviceId>a list of Curtain device IDs such that the Curtain devices are being paired or grouped
calibrateBooleandetermines if the open position and the close position of a device have been properly calibrated or not
groupBooleandetermines if a Curtain is paired with or grouped with another Curtain or not
masterBooleandetermines if a Curtain is the master device or not when paired with or grouped with another Curtain
openDirectionStringthe opening direction of a Curtain
Curtain 3
KeyValue TypeDescription
deviceIdStringdevice ID
deviceNameStringdevice name
deviceTypeStringdevice type. Curtain3
enableCloudServiceBooleandetermines if Cloud Service is enabled or not for the current device
hubDeviceIdStringdevice's parent Hub ID
curtainDevicesIdsArray<deviceId>a list of Curtain device IDs such that the Curtain devices are being paired or grouped
calibrateBooleandetermines if the open position and the close position of a device have been properly calibrated or not
groupBooleandetermines if a Curtain is paired with or grouped with another Curtain or not
masterBooleandetermines if a Curtain is the master device or not when paired with or grouped with another Curtain
openDirectionStringthe opening direction of a Curtain
Hub/Hub Plus/Hub Mini/Hub 2
KeyValue TypeDescription
deviceIdStringdevice ID
deviceNameStringdevice name
deviceTypeStringdevice type. Hub, Hub Plus, Hub Mini, or Hub 2.
enableCloudServiceBooleandetermines if Cloud Service is enabled or not for the current device
hubDeviceIdStringdevice's parent Hub ID. 000000000000 when the device itself is a Hub or it is connected through Wi-Fi.
Meter
KeyValue TypeDescription
deviceIdStringdevice ID
deviceNameStringdevice name
deviceTypeStringdevice type. Meter
enableCloudServiceBooleandetermines if Cloud Service is enabled or not for the current device
hubDeviceIdStringdevice's parent Hub ID
Meter Plus
KeyValue TypeDescription
deviceIdStringdevice ID
deviceNameStringdevice name
deviceTypeStringdevice type. MeterPlus
enableCloudServiceBooleandetermines if Cloud Service is enabled or not for the current device
hubDeviceIdStringdevice's parent Hub ID
Outdoor Meter
KeyValue TypeDescription
deviceIdStringdevice ID
deviceNameStringdevice name
deviceTypeStringdevice type. WoIOSensor
enableCloudServiceBooleandetermines if Cloud Service is enabled or not for the current device
hubDeviceIdStringdevice's parent Hub ID
Meter Pro
KeyValue TypeDescription
deviceIdStringdevice ID
deviceNameStringdevice name
deviceTypeStringdevice type. MeterPro
enableCloudServiceBooleandetermines if Cloud Service is enabled or not for the current device
hubDeviceIdStringdevice's parent Hub ID
Meter Pro CO2
KeyValue TypeDescription
deviceIdStringdevice ID
deviceNameStringdevice name
deviceTypeStringdevice type. MeterPro(CO2)
enableCloudServiceBooleandetermines if Cloud Service is enabled or not for the current device
hubDeviceIdStringdevice's parent Hub ID
Lock
KeyValue TypeDescription
deviceIdStringdevice ID
deviceNameStringdevice name
deviceTypeStringdevice type. Smart Lock
enableCloudServiceBooleandetermines if Cloud Service is enabled or not for the current device
hubDeviceIdStringdevice's parent Hub ID
groupBooleandetermines if a Lock is grouped with another Lock or not
masterBooleandetermines if a Lock is the master device or not when grouped with another Lock in Dual Lock mode
groupNameStringthe name of the Lock group
lockDevicesIdsArray<deviceId>a list of Lock device IDs such that the Lock devices are being grouped in Dual Lock mode
Lock Pro
KeyValue TypeDescription
deviceIdStringdevice ID
deviceNameStringdevice name
deviceTypeStringdevice type. Smart Lock Pro
enableCloudServiceBooleandetermines if Cloud Service is enabled or not for the current device
hubDeviceIdStringdevice's parent Hub ID
groupBooleandetermines if a Lock is grouped with another Lock or not
masterBooleandetermines if a Lock is the master device or not when grouped with another Lock in Dual Lock mode
groupNameStringthe name of the Lock group
lockDevicesIdsArray<deviceId>a list of Lock device IDs such that the Lock devices are being grouped in Dual Lock mode
Keypad
KeyValue TypeDescription
deviceIdStringdevice ID
deviceNameStringdevice name
deviceTypeStringdevice type. Keypad
enableCloudServiceBooleandetermines if Cloud Service is enabled or not for the current device
hubDeviceIdStringdevice's parent Hub ID
lockDeviceIdStringMAC address of the Lock that the current device is paired with
keyListObjecta list of passcodes

keyList maintains a list of passcodes,

KeyValue TypeDescription
idIntegerpasscode ID
nameStringname of the passcode
typeStringtype of the passcode. permanent, a permanent passcode. timeLimit, a temporary passcode. disposable, a one-time passcode. urgent, an emergency passcode.
passwordStringthe passcode string encrypted with the developer secret key using the aes-128-cbc algorithm
ivStringan arbitrary number used for the encryption
statusStringvalidity of the passcode. normal, the passcode is valid. expired, the passcode is invalid.
createTimeLongthe time when the passcode is generated
Keypad Touch
KeyValue TypeDescription
deviceIdStringdevice ID
deviceNameStringdevice name
deviceTypeStringdevice type. Keypad Touch
enableCloudServiceBooleandetermines if Cloud Service is enabled or not for the current device
hubDeviceIdStringdevice's parent Hub ID
lockDeviceIdStringMAC address of the Lock that the current device is paired with
keyListObjecta list of passcodes

keyList maintains a list of passcodes,

KeyValue TypeDescription
idIntegerpasscode ID
nameStringname of the passcode
typeStringtype of the passcode. permanent, a permanent passcode. timeLimit, a temporary passcode. disposable, a one-time passcode. urgent, an emergency passcode.
passwordStringthe passcode string encrypted with the developer secret key using the aes-128-cbc algorithm
ivStringan arbitrary number used for the encryption
statusStringvalidity of the passcode. normal, the passcode is valid. expired, the passcode is invalid.
createTimeLongthe time when the passcode is generated
Remote
KeyValue TypeDescription
deviceIdStringdevice ID
deviceNameStringdevice name
deviceTypeStringdevice type. Remote
enableCloudServiceBooleandetermines if Cloud Service is enabled or not for the current device
hubDeviceIdStringdevice's parent Hub ID
Motion Sensor
KeyValue TypeDescription
deviceIdStringdevice ID
deviceNameStringdevice name
deviceTypeStringdevice type. Motion Sensor
enableCloudServiceBooleandetermines if Cloud Service is enabled or not for the current device
hubDeviceIdStringdevice's parent Hub ID
Contact Sensor
KeyValue TypeDescription
deviceIdStringdevice ID
deviceNameStringdevice name
deviceTypeStringdevice type. Contact Sensor
enableCloudServiceBooleandetermines if Cloud Service is enabled or not for the current device
hubDeviceIdStringdevice's parent Hub ID
Water Leak Detector
KeyValue TypeDescription
deviceIdStringdevice ID
deviceNameStringdevice name
deviceTypeStringdevice type. Water Detector
enableCloudServiceBooleandetermines if Cloud Service is enabled or not for the current device
hubDeviceIdStringdevice's parent Hub ID. 000000000000 when the device itself is a Hub or it is connected through Wi-Fi.
Ceiling Light
KeyValue TypeDescription
deviceIdStringdevice ID
deviceNameStringdevice name
deviceTypeStringdevice type. Ceiling Light
enableCloudServiceBooleandetermines if Cloud Service is enabled or not for the current device
hubDeviceIdStringdevice's parent Hub ID. 000000000000 when the device itself is a Hub or it is connected through Wi-Fi.
Ceiling Light Pro
KeyValue TypeDescription
deviceIdStringdevice ID
deviceNameStringdevice name
deviceTypeStringdevice type. Ceiling Light Pro
enableCloudServiceBooleandetermines if Cloud Service is enabled or not for the current device
hubDeviceIdStringdevice's parent Hub ID. 000000000000 when the device itself is a Hub or it is connected through Wi-Fi.
Plug Mini (US)
KeyValue TypeDescription
deviceIdStringdevice ID
deviceNameStringdevice name
deviceTypeStringdevice type. Plug Mini (US)
enableCloudServiceBooleandetermines if Cloud Service is enabled or not for the current device
hubDeviceIdStringdevice's parent Hub ID. 000000000000 when the device itself is a Hub or it is connected through Wi-Fi.
Plug Mini (JP)
KeyValue TypeDescription
deviceIdStringdevice ID
deviceNameStringdevice name
deviceTypeStringdevice type. Plug Mini (JP)
enableCloudServiceBooleandetermines if Cloud Service is enabled or not for the current device
hubDeviceIdStringdevice's parent Hub ID. 000000000000 when the device itself is a Hub or it is connected through Wi-Fi.
Plug
KeyValue TypeDescription
deviceIdStringdevice ID
deviceNameStringdevice name
deviceTypeStringdevice type. Plug
enableCloudServiceBooleandetermines if Cloud Service is enabled or not for the current device
hubDeviceIdStringdevice's parent Hub ID. 000000000000 when the device itself is a Hub or it is connected through Wi-Fi.
Strip Light
KeyValue TypeDescription
deviceIdStringdevice ID
deviceNameStringdevice name
deviceTypeStringdevice type. Strip Light
enableCloudServiceBooleandetermines if Cloud Service is enabled or not for the current device
hubDeviceIdStringdevice's parent Hub ID. 000000000000 when the device itself is a Hub or it is connected through Wi-Fi.
Color Bulb
KeyValue TypeDescription
deviceIdStringdevice ID
deviceNameStringdevice name
deviceTypeStringdevice type. Color Bulb
enableCloudServiceBooleandetermines if Cloud Service is enabled or not for the current device
hubDeviceIdStringdevice's parent Hub ID. 000000000000 when the device itself is a Hub or it is connected through Wi-Fi.
Robot Vacuum Cleaner S1
KeyValue TypeDescription
deviceIdStringdevice ID
deviceNameStringdevice name
deviceTypeStringdevice type. Robot Vacuum Cleaner S1
enableCloudServiceBooleandetermines if Cloud Service is enabled or not for the current device
hubDeviceIdStringdevice's parent Hub ID. 000000000000 when the device itself is a Hub or it is connected through Wi-Fi.
Robot Vacuum Cleaner S1 Plus
KeyValue TypeDescription
deviceIdStringdevice ID
deviceNameStringdevice name
deviceTypeStringdevice type. Robot Vacuum Cleaner S1 Plus
enableCloudServiceBooleandetermines if Cloud Service is enabled or not for the current device
hubDeviceIdStringdevice's parent Hub ID. 000000000000 when the device itself is a Hub or it is connected through Wi-Fi.
Mini Robot Vacuum K10+
KeyValue TypeDescription
deviceIdStringdevice ID
deviceNameStringdevice name
deviceTypeStringdevice type. K10+
enableCloudServiceBooleandetermines if Cloud Service is enabled or not for the current device
hubDeviceIdStringdevice's parent Hub ID. 000000000000 when the device itself is a Hub or it is connected through Wi-Fi.
Mini Robot Vacuum K10+ Pro
KeyValue TypeDescription
deviceIdStringdevice ID
deviceNameStringdevice name
deviceTypeStringdevice type. K10+ Pro
enableCloudServiceBooleandetermines if Cloud Service is enabled or not for the current device
hubDeviceIdStringdevice's parent Hub ID. 000000000000 when the device itself is a Hub or it is connected through Wi-Fi.
K10+ Pro Combo
KeyValue TypeDescription
deviceIdStringdevice ID
deviceNameStringdevice name
deviceTypeStringdevice type. Robot Vacuum Cleaner K10+ Pro Combo
enableCloudServiceBooleandetermines if Cloud Service is enabled or not for the current device
hubDeviceIdStringreturns null if not a bluetooth device
Floor Cleaning Robot S10
KeyValue TypeDescription
deviceIdStringdevice ID
deviceNameStringdevice name
deviceTypeStringdevice type. Robot Vacuum Cleaner S10
enableCloudServiceBooleandetermines if Cloud Service is enabled or not for the current device
hubDeviceIdStringdevice's parent Hub ID. 000000000000 when the device itself is a Hub or it is connected through Wi-Fi.
Humidifier
KeyValue TypeDescription
deviceIdStringdevice ID
deviceNameStringdevice name
deviceTypeStringdevice type. Humidifier
enableCloudServiceBooleandetermines if Cloud Service is enabled or not for the current device
hubDeviceIdStringdevice's parent Hub ID. 000000000000 when the device itself is a Hub or it is connected through Wi-Fi.
Evaporative Humidifier
KeyValue TypeDescription
deviceIdStringdevice ID
deviceNameStringdevice name
deviceTypeStringdevice type. Humidifier2
enableCloudServiceBooleandetermines if Cloud Service is enabled or not for the current device
hubDeviceIdStringreturns null if not a bluetooth device
Evaporative Humidifier (Auto-refill)
KeyValue TypeDescription
deviceIdStringdevice ID
deviceNameStringdevice name
deviceTypeStringdevice type. Humidifier2
enableCloudServiceBooleandetermines if Cloud Service is enabled or not for the current device
hubDeviceIdStringreturns null if not a bluetooth device
Air Purifier VOC
KeyValue TypeDescription
deviceIdStringdevice ID
deviceNameStringdevice name
deviceTypeStringdevice type. Air Purifier VOC
enableCloudServiceBooleandetermines if Cloud Service is enabled or not for the current device
hubDeviceIdStringreturns null if not a bluetooth device
Air Purifier Table VOC
KeyValue TypeDescription
deviceIdStringdevice ID
deviceNameStringdevice name
deviceTypeStringdevice type. Air Purifier Table VOC
enableCloudServiceBooleandetermines if Cloud Service is enabled or not for the current device
hubDeviceIdStringreturns null if not a bluetooth device
Air Purifier PM2.5
KeyValue TypeDescription
deviceIdStringdevice ID
deviceNameStringdevice name
deviceTypeStringdevice type. Air Purifier PM2.5
enableCloudServiceBooleandetermines if Cloud Service is enabled or not for the current device
hubDeviceIdStringreturns null if not a bluetooth device
Air Purifier Table PM2.5
KeyValue TypeDescription
deviceIdStringdevice ID
deviceNameStringdevice name
deviceTypeStringdevice type. Air Purifier Table PM2.5
enableCloudServiceBooleandetermines if Cloud Service is enabled or not for the current device
hubDeviceIdStringreturns null if not a bluetooth device
Indoor Cam
KeyValue TypeDescription
deviceIdStringdevice ID
deviceNameStringdevice name
deviceTypeStringdevice type. Indoor Cam
enableCloudServiceBooleandetermines if Cloud Service is enabled or not for the current device
hubDeviceIdStringdevice's parent Hub ID. 000000000000 when the device itself is a Hub or it is connected through Wi-Fi.
Pan/Tilt Cam
KeyValue TypeDescription
deviceIdStringdevice ID
deviceNameStringdevice name
deviceTypeStringdevice type. Pan/Tilt Cam
enableCloudServiceBooleandetermines if Cloud Service is enabled or not for the current device
hubDeviceIdStringdevice's parent Hub ID. 000000000000 when the device itself is a Hub or it is connected through Wi-Fi.
Pan/Tilt Cam 2K
KeyValue TypeDescription
deviceIdStringdevice ID
deviceNameStringdevice name
deviceTypeStringdevice type. Pan/Tilt Cam
enableCloudServiceBooleandetermines if Cloud Service is enabled or not for the current device
hubDeviceIdStringdevice's parent Hub ID. 000000000000 when the device itself is a Hub or it is connected through Wi-Fi.
Blind Tilt
KeyValue TypeDescription
deviceIdStringdevice ID
deviceNameStringdevice name
deviceTypeStringdevice type. Blind Tilt
versionIntegerthe version of the device
enableCloudServiceBooleandetermines if Cloud Service is enabled or not for the current device
hubDeviceIdStringdevice's parent Hub ID
blindTiltDevicesIdsArray<deviceId>a list of Blind Tilt device IDs such that the Blind Tilt devices are being paired or grouped
calibrateBooleandetermines if the open and the closed positions have been properly calibrated or not
groupBooleandetermines if a Blind Tilt device is paired with or grouped with one or more devices of the same type or not
masterBooleandetermines if a Blind Tilt device is the master device or not when paired with or grouped with one or more devices of the same type
directionStringthe opening direction of a Blind Tilt device
slidePositionIntegerthe current position, 0-100
Battery Circulator Fan
KeyValue TypeDescription
deviceIdStringdevice ID
deviceNameStringdevice name
deviceTypeStringdevice type. Battery Circulator Fan
enableCloudServiceBooleandetermines if Cloud Service is enabled or not for the current device
hubDeviceIdStringdevice's parent Hub ID
Circulator Fan
KeyValue TypeDescription
deviceIdStringdevice ID
deviceNameStringdevice name
deviceTypeStringdevice type. Circulator Fan
enableCloudServiceBooleandetermines if Cloud Service is enabled or not for the current device
hubDeviceIdStringdevice's parent Hub ID
Roller Shade
KeyValue TypeDescription
deviceIdStringdevice ID
deviceNameStringdevice name
deviceTypeStringdevice type. Roller Shade
bleVersionIntegerfirmware version
enableCloudServiceBooleandetermines if Cloud Service is enabled or not for the current device
hubDeviceIdStringdevice's parent Hub ID
groupingDevicesIdsArray<deviceId>a list of device IDs such that the Roller Shade devices are being paired or grouped
groupBooleandetermines if a device is paired with or grouped with one or more devices of the same type or not
masterBooleandetermines if a device is the master device or not when paired with or grouped with one or more devices of the same type
groupNameStringthe name of the device group
Relay Switch 1PM
KeyValue TypeDescription
deviceIdStringdevice ID
deviceNameStringdevice name
deviceTypeStringdevice type. Relay Switch 1PM
enableCloudServiceBooleandetermines if Cloud Service is enabled or not for the current device
hubDeviceIdStringdevice's parent Hub ID. 000000000000 when the device itself is a Hub or it is connected through Wi-Fi.
Relay Switch 1
KeyValue TypeDescription
deviceIdStringdevice ID
deviceNameStringdevice name
deviceTypeStringdevice type. Relay Switch 1
enableCloudServiceBooleandetermines if Cloud Service is enabled or not for the current device
hubDeviceIdStringdevice's parent Hub ID. 000000000000 when the device itself is a Hub or it is connected through Wi-Fi.
Virtual infrared remote devices

The infraredRemoteList array contains a list of objects with the following key-value attributes,

KeyValue TypeDescription
deviceIdStringdevice ID
deviceNameStringdevice name
remoteTypeStringdevice type
hubDeviceIdStringremote device's parent Hub ID

Sample

Get all devices

Request

GET https://api.switch-bot.com/v1.1/devices

Response

{
    "statusCode": 100,
    "body": {
        "deviceList": [
            {
                "deviceId": "500291B269BE",
                "deviceName": "Living Room Humidifier",
                "deviceType": "Humidifier",
                "enableCloudService": true,
                "hubDeviceId": "000000000000"
            }
        ],
        "infraredRemoteList": [
            {
                "deviceId": "02-202008110034-13",
                "deviceName": "Living Room TV",
                "remoteType": "TV",
                "hubDeviceId": "FA7310762361"
            }
        ]
    },
    "message": "success"
}

Get device status

GET /v1.1/devices/{deviceId}/status

Description

Get the status of a physical device that has been added to the current user's account.

Physical devices refer to the following SwitchBot products,

Path parameters

NameTypeRequiredDescription
deviceIdStringYesdevice ID

Responses

The response is basically a JSON object, which contains the following properties,

Key NameValue Type
statusCodeInteger
messageString
bodyObject<body>

The reponses may contain the following codes and message,

Status CodeBody ContentMessageDescription
100Device list objectsuccessReturns an object that contains two device lists
n/an/aUnauthorizedHttp 401 Error. User permission is denied due to invalid token.
190n/aSystem errorDevice internal error due to device states not synchronized with server

The body object contains the following properties,

Bot
KeyValue TypeDescription
deviceIdStringdevice ID
deviceTypeStringdevice type. Bot
powerStringON/OFF state
batteryIntegerthe current battery level, 0-100
versionStringthe current firmware version, e.g. V6.3
deviceModeStringpressMode, switchMode, or customizeMode
hubDeviceIdStringdevice's parent Hub ID
Curtain
KeyValue TypeDescription
deviceIdStringdevice ID
deviceTypeStringdevice type. Curtain
hubDeviceIdStringdevice's parent Hub ID
calibrateBooleandetermines if the open position and the close position of a device have been properly calibrated or not
groupBooleandetermines if a Curtain is paired with or grouped with another Curtain or not
movingBooleandetermines if a Curtain is moving or not
batteryIntegerthe current battery level, 0-100
versionStringthe current firmware version, e.g. V4.2
slidePositionStringthe percentage of the distance between the calibrated open position and closed position that Curtain has traversed
Curtain 3
KeyValue TypeDescription
deviceIdStringdevice ID
deviceTypeStringdevice type. Curtain3
hubDeviceIdStringdevice's parent Hub ID
calibrateBooleandetermines if the open position and the close position of a device have been properly calibrated or not
groupBooleandetermines if a Curtain is paired with or grouped with another Curtain or not
movingBooleandetermines if a Curtain is moving or not
batteryIntegerthe current battery level, 0-100
versionStringthe current firmware version, e.g. V4.2
slidePositionStringthe percentage of the distance between the calibrated open position and closed position that Curtain has traversed
Meter
KeyValue TypeDescription
deviceIdStringdevice ID
deviceTypeStringdevice type. Meter
hubDeviceIdStringdevice's parent Hub ID
temperatureFloattemperature in celsius
versionStringthe current firmware version, e.g. V4.2
batteryIntegerthe current battery level, 0-100
humidityIntegerhumidity percentage
Meter Plus
KeyValue TypeDescription
deviceIdStringdevice ID
deviceTypeStringdevice type. MeterPlus
hubDeviceIdStringdevice's parent Hub ID
batteryIntegerthe current battery level, 0-100
versionStringthe current firmware version, e.g. V4.2
temperatureFloattemperature in celsius
humidityIntegerhumidity percentage
Outdoor Meter
KeyValue TypeDescription
deviceIdStringdevice ID
deviceTypeStringdevice type. WoIOSensor
hubDeviceIdStringdevice's parent Hub ID
batteryIntegerthe current battery level, 0-100
versionStringthe current firmware version, e.g. V4.2
temperatureFloattemperature in celsius
humidityIntegerhumidity percentage
Meter Pro
KeyValue TypeDescription
deviceIdStringdevice ID
deviceTypeStringdevice type. MeterPro
hubDeviceIdStringdevice's parent Hub ID
batteryIntegerthe current battery level, 0-100
versionStringthe current firmware version, e.g. V4.2
temperatureFloattemperature in celsius
humidityIntegerhumidity percentage
Meter Pro CO2
KeyValue TypeDescription
deviceIdStringdevice ID
deviceTypeStringdevice type. MeterPro(CO2)
hubDeviceIdStringdevice's parent Hub ID
batteryIntegerthe current battery level, 0-100
versionStringthe current firmware version, e.g. V4.2
temperatureFloattemperature in celsius
humidityIntegerhumidity percentage
CO2IntegerCO2 ppm value, 0-9999
Lock
KeyValue TypeDescription
deviceIdStringdevice ID
deviceTypeStringdevice type. Smart Lock
hubDeviceIdStringdevice's parent Hub ID
batteryIntegerthe current battery level, 0-100
versionStringthe current firmware version, e.g. V4.2
lockStateStringdetermines if locked or not
doorStateStringdetermines if the door is closed or not
calibrateBooleandetermines if Lock has been calibrated or not
Lock Pro
KeyValue TypeDescription
deviceIdStringdevice ID
deviceTypeStringdevice type. Smart Lock Pro
hubDeviceIdStringdevice's parent Hub ID
batteryIntegerthe current battery level, 0-100
versionStringthe current firmware version, e.g. V4.2
lockStateStringdetermines if locked or not, jammed, unlock or lock
doorStateStringdetermines if the door is closed or not, open or close
calibrateBooleandetermines if Lock has been calibrated or not
Keypad
KeyValue TypeDescription
deviceIdStringdevice ID
deviceTypeStringdevice type. Keypad
hubDeviceIdStringdevice's parent Hub ID
Keypad Touch
KeyValue TypeDescription
deviceIdStringdevice ID
deviceTypeStringdevice type. Keypad Touch
hubDeviceIdStringdevice's parent Hub ID
Motion Sensor
KeyValue TypeDescription
deviceIdStringdevice ID
deviceTypeStringdevice type. Motion Sensor
hubDeviceIdStringdevice's parent Hub ID
batteryIntegerthe current battery level, 0-100
versionStringthe current firmware version, e.g. V4.2
moveDetectedBooleandetermines if motion is detected
brightnessStringthe ambient brightness picked up by the sensor. bright or dim
Contact Sensor
KeyValue TypeDescription
deviceIdStringdevice ID
deviceTypeStringdevice type. Contact Sensor
hubDeviceIdStringdevice's parent Hub ID
batteryIntegerthe current battery level, 0-100
versionStringthe current firmware version, e.g. V4.2
moveDetectedBooleandetermines if motion is detected
openStateStringthe open state of the sensor. open, close, or timeOutNotClose
brightnessStringthe ambient brightness picked up by the sensor. bright or dim
Water Leak Detector
KeyValue TypeDescription
deviceIdStringdevice ID
deviceTypeStringdevice type. Water Detector
hubDeviceIdStringdevice's parent Hub ID. 000000000000 when the device itself is a Hub or it is connected through Wi-Fi.
batteryIntegerthe current battery level, 0-100
versionStringthe current firmware version, e.g. V4.2
statusInteger0, dry. 1, leak detected
Ceiling Light
KeyValue TypeDescription
deviceIdStringdevice ID
deviceTypeStringdevice type. Ceiling Light
hubDeviceIdStringdevice's parent Hub ID. 000000000000 when the device itself is a Hub or it is connected through Wi-Fi.
powerStringON/OFF state
versionStringthe current BLE and Wi-Fi firmware version, e.g. V3.1-6.3
brightnessIntegerthe brightness value, range from 1 to 100
colorTemperatureIntegerthe color temperature value, range from 2700 to 6500
Ceiling Light Pro
KeyValue TypeDescription
deviceIdStringdevice ID
deviceTypeStringdevice type. Ceiling Light Pro
hubDeviceIdStringdevice's parent Hub ID. 000000000000 when the device itself is a Hub or it is connected through Wi-Fi.
versionStringthe current BLE and Wi-Fi firmware version, e.g. V3.1-6.3
powerStringON/OFF state
brightnessIntegerthe brightness value, range from 1 to 100
colorTemperatureIntegerthe color temperature value, range from 2700 to 6500
Plug Mini (US)
KeyValue TypeDescription
deviceIdStringdevice ID
deviceTypeStringdevice type. Plug Mini (US)
hubDeviceIdStringdevice's parent Hub ID. 000000000000 when the device itself is a Hub or it is connected through Wi-Fi.
voltageFloatthe voltage of the device, measured in Volt
versionStringthe current BLE and Wi-Fi firmware version, e.g. V3.1-6.3
weightFloatthe power consumed in a day, measured in Watts
electricityOfDayIntegerthe duration that the device has been used during a day, measured in minutes
electricCurrentFloatthe current of the device at the moment, measured in Amp
Plug Mini (JP)
KeyValue TypeDescription
deviceIdStringdevice ID
deviceTypeStringdevice type. Plug Mini (JP)
hubDeviceIdStringdevice's parent Hub ID. 000000000000 when the device itself is a Hub or it is connected through Wi-Fi.
voltageFloatthe voltage of the device, measured in Volt
versionStringthe current BLE and Wi-Fi firmware version, e.g. V3.1-6.3
weightFloatthe power consumed in a day, measured in Watts
electricityOfDayIntegerthe duration that the device has been used during a day, measured in minutes
electricCurrentFloatthe current of the device at the moment, measured in Amp
Plug
KeyValue TypeDescription
deviceIdStringdevice ID
deviceTypeStringdevice type. Plug
powerStringON/OFF state
versionStringthe current Wi-Fi firmware version, e.g. V4.2
hubDeviceIdStringdevice's parent Hub ID. 000000000000 when the device itself is a Hub or it is connected through Wi-Fi.
Strip Light
KeyValue TypeDescription
deviceIdStringdevice ID
deviceTypeStringdevice type. Strip Light
hubDeviceIdStringdevice's parent Hub ID. 000000000000 when the device itself is a Hub or it is connected through Wi-Fi.
powerStringON/OFF state
versionStringthe current BLE and Wi-Fi firmware version, e.g. V3.1-6.3
brightnessIntegerthe brightness value, range from 1 to 100
colorStringthe color value, RGB "255:255:255"
Color Bulb
KeyValue TypeDescription
deviceIdStringdevice ID
deviceTypeStringdevice type. Color Bulb
hubDeviceIdStringdevice's parent Hub ID. 000000000000 when the device itself is a Hub or it is connected through Wi-Fi.
powerStringON/OFF state
brightnessIntegerthe brightness value, range from 1 to 100
versionStringthe current BLE and Wi-Fi firmware version, e.g. V3.1-6.3
colorStringthe color value, RGB "255:255:255"
colorTemperatureIntegerthe color temperature value, range from 2700 to 6500
Robot Vacuum Cleaner S1
KeyValue TypeDescription
deviceIdStringdevice ID
deviceTypeStringdevice type. Robot Vacuum Cleaner S1
hubDeviceIdStringdevice's parent Hub ID. 000000000000 when the device itself is a Hub or it is connected through Wi-Fi.
workingStatusStringthe working status of the device. StandBy, Clearing, Paused, GotoChargeBase, Charging, ChargeDone, Dormant, InTrouble, InRemoteControl, or InDustCollecting
onlineStatusStringthe connection status of the device. online or offline
batteryIntegerthe current battery level
Robot Vacuum Cleaner S1 Plus
KeyValue TypeDescription
deviceIdStringdevice ID
deviceNameStringdevice name
deviceTypeStringdevice type. Robot Vacuum Cleaner S1 Plus
hubDeviceIdStringdevice's parent Hub ID. 000000000000 when the device itself is a Hub or it is connected through Wi-Fi.
workingStatusStringthe working status of the device. StandBy, Clearing, Paused, GotoChargeBase, Charging, ChargeDone, Dormant, InTrouble, InRemoteControl, or InDustCollecting
onlineStatusStringthe connection status of the device. online or offline
batteryIntegerthe current battery level
Mini Robot Vacuum K10+
KeyValue TypeDescription
deviceIdStringdevice ID
deviceNameStringdevice name
deviceTypeStringdevice type. K10+
hubDeviceIdStringdevice's parent Hub ID. 000000000000 when the device itself is a Hub or it is connected through Wi-Fi.
workingStatusStringthe working status of the device. StandBy, Clearing, Paused, GotoChargeBase, Charging, ChargeDone, Dormant, InTrouble, InRemoteControl, or InDustCollecting
onlineStatusStringthe connection status of the device. online or offline
batteryIntegerthe current battery level 0-100
Mini Robot Vacuum K10+ Pro
KeyValue TypeDescription
deviceIdStringdevice ID
deviceNameStringdevice name
deviceTypeStringdevice type. K10+ Pro
hubDeviceIdStringdevice's parent Hub ID. 000000000000 when the device itself is a Hub or it is connected through Wi-Fi.
workingStatusStringthe working status of the device. StandBy, Clearing, Paused, GotoChargeBase, Charging, ChargeDone, Dormant, InTrouble, InRemoteControl, or InDustCollecting
onlineStatusStringthe connection status of the device. online or offline
batteryIntegerthe current battery level 0-100
K10+ Pro Combo
KeyValue TypeDescription
deviceIdStringdevice ID
deviceNameStringdevice name
deviceTypeStringdevice type. Robot Vacuum Cleaner K10+ Pro Combo
hubDeviceIdStringdevice's parent Hub ID. 000000000000 when the device itself is a Hub or it is connected through Wi-Fi.
workingStatusStringthe working status of the device. StandBy, Clearing, Paused, GotoChargeBase, Charging, ChargeDone, Dormant, InTrouble, InRemoteControl, or InDustCollecting
onlineStatusStringthe connection status of the device. online or offline
batteryIntegerthe current battery level 0-100
taskTypeStringthe current task in progress. standBy, explore, cleanAll, cleanArea, cleanRoom, backToCharge, collectDust, remoteControl, cleanWithExplorer
Floor Cleaning Robot S10
KeyValue TypeDescription
deviceIdStringdevice ID
deviceNameStringdevice name
deviceTypeStringdevice type. Robot Vacuum Cleaner S10
hubDeviceIdStringdevice's parent Hub ID. 000000000000 when the device itself is a Hub or it is connected through Wi-Fi.
workingStatusStringthe working status of the device. StandBy, Clearing, Paused, GotoChargeBase, Charging, ChargeDone, Dormant, InTrouble, InRemoteControl, or InDustCollecting
onlineStatusStringthe connection status of the device. online or offline
batteryIntegerthe current battery level 0-100
waterBaseBatteryIntegerthe current battery level 0-100
taskTypeStringthe current task in progress. standBy, explore, cleanAll, cleanArea, cleanRoom, fillWater, deepWashing, backToCharge, markingWaterBase, drying, collectDust, remoteControl, cleanWithExplorer, fillWaterForHumi, markingHumi
Humidifier
KeyValue TypeDescription
deviceIdStringdevice ID
deviceTypeStringdevice type. Humidifier
powerStringON/OFF state
humidityIntegerhumidity percentage
temperatureFloattemperature in celsius
nebulizationEfficiencyIntegeratomization efficiency percentage
autoBooleandetermines if a Humidifier is in Auto Mode or not
childLockBooleandetermines if a Humidifier's safety lock is on or not
soundBooleandetermines if a Humidifier is muted or not
lackWaterBooleandetermines if the water tank is empty or not
Evaporative Humidifier
KeyValue TypeDescription
deviceIdStringdevice ID
deviceTypeStringdevice type. Humidifier2
powerStringON/OFF state
humidityIntegerhumidity percentage
modeIntegerthe current mode. 1, level 4; 2, level 3; 3, level 2; 4, level 1; 5, humidity mode; 6, sleep mode; 7, auto mode; 8, drying mode
dryingBooleandetermines if the device is drying its filter or not
childLockBooleandetermines if the safety lock is on or not
filterElementObjectcontains status info of the filter. e.g. {"effectiveUsageHours": 240, "usedHours": 20}. effectiveUsageHours, the effective duration of the filter in hours; usedHours, the number of hours the filter has been used.
versionIntegerfirmware version
Evaporative Humidifier (Auto-refill)
KeyValue TypeDescription
deviceIdStringdevice ID
deviceTypeStringdevice type. Humidifier2
powerStringON/OFF state
humidityIntegerhumidity percentage
modeIntegerthe current mode. 1, level 4; 2, level 3; 3, level 2; 4, level 1; 5, humidity mode; 6, sleep mode; 7, auto mode; 8, drying mode
dryingBooleandetermines if the device is drying its filter or not
childLockBooleandetermines if the safety lock is on or not
filterElementObjectcontains status info of the filter. e.g. {"effectiveUsageHours": 240, "usedHours": 20}. effectiveUsageHours, the effective duration of the filter in hours; usedHours, the number of hours the filter has been used.
versionIntegerfirmware version
Air Purifier VOC
KeyValue TypeDescription
deviceIdStringdevice ID
deviceTypeStringdevice type. Air Purifier VOC
powerStringcurrent state; ON, on; OFF, off
versionStringthe current firmware version, e.g. V4.2
hubDeviceIdStringreturns null if not a bluetooth device
modeIntegterthe current mode. 1, normal or fan mode; 2, auto mode; 3, sleep mode; 4, pet mode
childLockIntegterchild lock. 0, disabled; 1, enabled
Air Purifier Table VOC
KeyValue TypeDescription
deviceIdStringdevice ID
deviceTypeStringdevice type. Air Purifier Table VOC
powerStringcurrent state; ON, on; OFF, off
versionStringthe current firmware version, e.g. V4.2
hubDeviceIdStringreturns null if not a bluetooth device
modeIntegterthe current mode. 1, normal or fan mode; 2, auto mode; 3, sleep mode; 4, pet mode
childLockIntegterchild lock. 0, disabled; 1, enabled
Air Purifier PM2.5
KeyValue TypeDescription
deviceIdStringdevice ID
deviceTypeStringdevice type. Air Purifier PM2.5
powerStringcurrent state; ON, on; OFF, off
versionStringthe current firmware version, e.g. V4.2
hubDeviceIdStringreturns null if not a bluetooth device
modeIntegterthe current mode. 1, normal or fan mode; 2, auto mode; 3, sleep mode; 4, pet mode
childLockIntegterchild lock. 0, disabled; 1, enabled
Air Purifier Table PM2.5
KeyValue TypeDescription
deviceIdStringdevice ID
deviceTypeStringdevice type. Air Purifier Table PM2.5
powerStringcurrent state; ON, on; OFF, off
versionStringthe current firmware version, e.g. V4.2
hubDeviceIdStringreturns null if not a bluetooth device
modeIntegterthe current mode. 1, normal or fan mode; 2, auto mode; 3, sleep mode; 4, pet mode
childLockIntegterchild lock. 0, disabled; 1, enabled
Blind Tilt
KeyValue TypeDescription
deviceIdStringdevice ID
deviceTypeStringdevice type. Blind Tilt
hubDeviceIdStringdevice's parent Hub ID
versionIntegerthe firmware version of the device
calibrateBooleandetermines if the open and the closed positions have been properly calibrated or not
groupBooleandetermines if a Blind Tilt device is paired with or grouped with one or more devices of the same type or not
movingBooleandetermines if the device is moving or not
directionStringthe opening direction of a Blind Tilt device
slidePositionIntegerthe current position, 0-100
Roller Shade
KeyValue TypeDescription
deviceIdStringdevice ID
deviceTypeStringdevice type. Roller Shade
hubDeviceIdStringdevice's parent Hub ID
versionStringthe current firmware version, e.g. V4.2
calibrateBooleandetermines if the open and the closed positions have been properly calibrated or not
batteryIntegerthe current battery level 0-100
movingBooleandetermines if the device is moving or not
slidePositionIntegerthe current position, 0-100
Hub 2
KeyValue TypeDescription
deviceIdStringdevice ID
deviceTypeStringdevice type. Hub 2
hubDeviceIdStringHub ID, equivalent to device ID
temperatureFloattemperature in celsius
lightLevelIntegerthe level of illuminance of the ambience light, 1~20
versionStringthe current firmware version, e.g. V4.2
humidityIntegerhumidity percentage
Battery Circulator Fan
KeyValue TypeDescription
deviceIdStringdevice ID
deviceNameStringdevice name
deviceTypeStringdevice type. Battery Circulator Fan
modeStringfan mode. direct mode: direct; natural mode: "natural"; sleep mode: "sleep"; ultra quiet mode: "baby"
versionStringthe current firmware version, e.g. V4.2
batteryIntegerthe current battery level
powerStringON/OFF state
nightStatusIntegerset nightlight status. turn off: off; mode 1: 1; mode 2: 2
oscillationStringset horizontal oscillation. turn on: on; turn off: off
verticalOscillationStringset vertical oscillation. turn on: on; turn off: off
chargingStatusStringbattery charge status. charging or uncharged
fanSpeedIntegerfan speed. 1~100
Circulator Fan
KeyValue TypeDescription
deviceIdStringdevice ID
deviceNameStringdevice name
deviceTypeStringdevice type. Circulator Fan
modeStringfan mode. direct mode: direct; natural mode: "natural"; sleep mode: "sleep"; ultra quiet mode: "baby"
versionStringthe current firmware version, e.g. V4.2
powerStringON/OFF state
nightStatusIntegerset nightlight status. turn off: off; mode 1: 1; mode 2: 2
oscillationStringset horizontal oscillation. turn on: on; turn off: off
verticalOscillationStringset vertical oscillation. turn on: on; turn off: off
fanSpeedIntegerfan speed. 1~100
Relay Switch 1PM
KeyValue TypeDescription
deviceIdStringdevice ID
deviceTypeStringdevice type. Relay Switch 1PM
switchStatusIntegerthe current switch state. 0, off; 1, on
voltageIntegerthe current voltage, measured in Volt
versionStringthe current BLE and Wi-Fi firmware version, e.g. V3.1-6.3
powerIntegerthe current power, measured in Watts
usedElectricityIntegerdaily power consumption, measured in watt-minutes
electricCurrentIntegerthe electrical current measured in mA
Relay Switch 1
KeyValue TypeDescription
deviceIdStringdevice ID
deviceTypeStringdevice type. Relay Switch 1
switchStatusIntegerthe current switch state. 0, off; 1, on
versionStringthe current BLE and Wi-Fi firmware version, e.g. V3.1-6.3

Sample

SwitchBot Meter example

Request the status of a SwitchBot Thermometer and Hygrometer

Request

GET https://api.switch-bot.com/v1.1/devices/C271111EC0AB/status

Response

{
    "statusCode": 100,
    "body": {
        "deviceId": "C271111EC0AB",
        "deviceType": "Meter",
        "hubDeviceId": "FA7310762361",
        "humidity": 52,
        "temperature": 26.1
    },
    "message": "success"
}
SwitchBot Curtain example

Request the status of a SwitchBot Curtain

Request

GET https://api.switch-bot.com/v1.1/devices/E2F6032048AB/status

Response

{
    "statusCode": 100,
    "body": {
        "deviceId": "E2F6032048AB",
        "deviceType": "Curtain",
        "hubDeviceId": "FA7310762361",
        "calibrate": true,
        "group": false,
        "moving": false,
        "slidePosition": 0
    },
    "message": "success"
}

Send device control commands

POST /v1.1/devices/{deviceId}/commands

Description

Send control commands to physical devices and virtual infrared remote devices.

Command set for physical devices

Bot
deviceTypecommandTypeCommandcommand parameterDescription
BotcommandturnOffdefaultset to OFF state
BotcommandturnOndefaultset to ON state
Botcommandpressdefaulttrigger press
Curtain
deviceTypecommandTypeCommandcommand parameterDescription
CurtaincommandsetPositionindex0,mode0,position0<br />e.g. 0,ff,80mode: 0 (Performance Mode), 1 (Silent Mode), ff (default mode) <br />position: 0~100 (0 means open, 100 means closed)
CurtaincommandturnOffdefaultequivalent to set position to 100
CurtaincommandturnOndefaultequivalent to set position to 0
Curtaincommandpausedefaultset to PAUSE state
Curtain 3
deviceTypecommandTypeCommandcommand parameterDescription
Curtain 3commandsetPositionindex0,mode0,position0<br />e.g. 0,ff,80mode: 0 (Performance Mode), 1 (Silent Mode), ff (default mode) <br />position: 0~100 (0 means open, 100 means closed)
Curtain 3commandturnOffdefaultequivalent to set position to 100
Curtain 3commandturnOndefaultequivalent to set position to 0
Curtain 3commandpausedefaultset to PAUSE state
Lock
deviceTypecommandTypeCommandcommand parameterDescription
Lockcommandlockdefaultrotate to locked position
Lockcommandunlockdefaultrotate to unlocked position
Lock Pro
deviceTypecommandTypeCommandcommand parameterDescription
Lockcommandlockdefaultrotate to locked position
Lockcommandunlockdefaultrotate to unlocked position
Humidifier
deviceTypecommandTypeCommandcommand parameterDescription
HumidifiercommandturnOffdefaultset to OFF state
HumidifiercommandturnOndefaultset to ON state
HumidifiercommandsetModeauto or 101 or<br /> 102 or 103 or {0~100}auto, set to Auto Mode,<br />101, set atomization efficiency to 34%,<br />102, set atomization efficiency to 67%,<br />103, set atomization efficiency to 100%
Evaporative Humidifier
deviceTypecommandTypeCommandcommand parameterDescription
Humidifier2commandturnOffdefaultset to OFF state
Humidifier2commandturnOndefaultset to ON state
Humidifier2commandsetMode{"mode": mode_int, "targetHumidify": humidity_int}set the mode. mode_int, 1, level 4; 2, level 3; 3, level 2; 4, level 1; 5, humidity mode; 6, sleep mode; 7, auto mode; 8, drying mode; targetHumidify, the target humidity level in percentage, 0~100.
Humidifier2commandsetChildLocktrue or falseenable or disable child lock. true, enable; false, disable
Evaporative Humidifier (Auto-refill)
deviceTypecommandTypeCommandcommand parameterDescription
Humidifier2commandturnOffdefaultset to OFF state
Humidifier2commandturnOndefaultset to ON state
Humidifier2commandsetMode{"mode": mode_int, "targetHumidify": humidity_int}set the mode. mode_int, 1, level 4; 2, level 3; 3, level 2; 4, level 1; 5, humidity mode; 6, sleep mode; 7, auto mode; 8, drying mode; targetHumidify, the target humidity level in percentage, 0~100.
Humidifier2commandsetChildLocktrue or falseenable or disable child lock. true, enable; false, disable
Air Purifier VOC
deviceTypecommandTypeCommandcommand parameterDescription
Air Purifier VOCcommandturnOffdefaultset to OFF state
Air Purifier VOCcommandturnOndefaultset to ON state
Air Purifier VOCcommandsetMode{"mode": mode_int, "fanGear": fan_level_int}set the mode. mode_int, 1, normal or fan mode; 2, auto mode; 3, sleep mode; 4, pet mode; fan_level_int, the fan level can only be set if mode_int is set to 1, 1~3
Air Purifier VOCcommandsetChildLock0 or 1enable or disable child lock. 1, enable; 0, disable
Air Purifier Table VOC
deviceTypecommandTypeCommandcommand parameterDescription
Air Purifier Table VOCcommandturnOffdefaultset to OFF state
Air Purifier Table VOCcommandturnOndefaultset to ON state
Air Purifier Table VOCcommandsetMode{"mode": mode_int, "fanGear": fan_level_int}set the mode. mode_int, 1, normal or fan mode; 2, auto mode; 3, sleep mode; 4, pet mode; fan_level_int, the fan level can only be set if mode_int is set to 1, 1~3
Air Purifier Table VOCcommandsetChildLock0 or 1enable or disable child lock. 1, enable; 0, disable
Air Purifier PM2.5
deviceTypecommandTypeCommandcommand parameterDescription
Air Purifier PM2.5commandturnOffdefaultset to OFF state
Air Purifier PM2.5commandturnOndefaultset to ON state
Air Purifier PM2.5commandsetMode{"mode": mode_int, "fanGear": fan_level_int}set the mode. mode_int, 1, normal or fan mode; 2, auto mode; 3, sleep mode; 4, pet mode; fan_level_int, the fan level can only be set if mode_int is set to 1, 1~3
Air Purifier PM2.5commandsetChildLock0 or 1enable or disable child lock. 1, enable; 0, disable
Air Purifier Table PM2.5
deviceTypecommandTypeCommandcommand parameterDescription
Air Purifier Table PM2.5commandturnOffdefaultset to OFF state
Air Purifier Table PM2.5commandturnOndefaultset to ON state
Air Purifier Table PM2.5commandsetMode{"mode": mode_int, "fanGear": fan_level_int}set the mode. mode_int, 1, normal or fan mode; 2, auto mode; 3, sleep mode; 4, pet mode; fan_level_int, the fan level can only be set if mode_int is set to 1, 1~3
Air Purifier Table PM2.5commandsetChildLock0 or 1enable or disable child lock. 1, enable; 0, disable
Plug
deviceTypecommandTypeCommandcommand parameterDescription
PlugcommandturnOndefaultset to ON state
PlugcommandturnOffdefaultset to OFF state
Plug Mini (US)
deviceTypecommandTypeCommandcommand parameterDescription
Plug Mini (US)commandturnOndefaultset to ON state
Plug Mini (US)commandturnOffdefaultset to OFF state
Plug Mini (US)commandtoggledefaulttoggle state
Plug Mini (JP)
deviceTypecommandTypeCommandcommand parameterDescription
Plug Mini (JP)commandturnOndefaultset to ON state
Plug Mini (JP)commandturnOffdefaultset to OFF state
Plug Mini (JP)commandtoggledefaulttoggle state
Relay Switch 1PM
deviceTypecommandTypeCommandcommand parameterDescription
Relay Switch 1PMcommandturnOndefaultset to ON state
Relay Switch 1PMcommandturnOffdefaultset to OFF state
Relay Switch 1PMcommandtoggledefaulttoggle state
Relay Switch 1PMcommandsetMode0~3set the switch mode. 0, toggle mode; 1, edge switch mode; 2, detached switch mode; 3, momentary switch mode
Relay Switch 1
deviceTypecommandTypeCommandcommand parameterDescription
Relay Switch 1commandturnOndefaultset to ON state
Relay Switch 1commandturnOffdefaultset to OFF state
Relay Switch 1commandtoggledefaulttoggle state
Relay Switch 1commandsetMode0~3set the switch mode. 0, toggle mode; 1, edge switch mode; 2, detached switch mode; 3, momentary switch mode
Color Bulb
deviceTypecommandTypeCommandcommand parameterDescription
Color BulbcommandturnOndefaultset to ON state
Color BulbcommandturnOffdefaultset to OFF state
Color Bulbcommandtoggledefaulttoggle state
Color BulbcommandsetBrightness{1-100}set brightness
Color BulbcommandsetColor"{0-255}:{0-255}:{0-255}"set RGB color value
Color BulbcommandsetColorTemperature{2700-6500}set color temperature
Strip Light
deviceTypecommandTypeCommandcommand parameterDescription
Strip LightcommandturnOndefaultset to ON state
Strip LightcommandturnOffdefaultset to OFF state
Strip Lightcommandtoggledefaulttoggle state
Strip LightcommandsetBrightness{1-100}set brightness
Strip LightcommandsetColor"{0-255}:{0-255}:{0-255}"set RGB color value
Robot Vacuum Cleaner S1
deviceTypecommandTypeCommandcommand parameterDescription
Robot Vacuum Cleaner S1commandstartdefaultstart vacuuming
Robot Vacuum Cleaner S1commandstopdefaultstop vacuuming
Robot Vacuum Cleaner S1commanddockdefaultreturn to charging dock
Robot Vacuum Cleaner S1commandPowLevel{0-3}set suction power level: 0 (Quiet), 1 (Standard), 2 (Strong), 3 (MAX)
Robot Vacuum Cleaner S1 Plus
deviceTypecommandTypeCommandcommand parameterDescription
Robot Vacuum Cleaner S1 Pluscommandstartdefaultstart vacuuming
Robot Vacuum Cleaner S1 Pluscommandstopdefaultstop vacuuming
Robot Vacuum Cleaner S1 Pluscommanddockdefaultreturn to charging dock
Robot Vacuum Cleaner S1 PluscommandPowLevel{0-3}set suction power level: 0 (Quiet), 1 (Standard), 2 (Strong), 3 (MAX)
Mini Robot Vacuum K10+
deviceTypecommandTypeCommandcommand parameterDescription
K10+commandstartdefaultstart vacuuming
K10+commandstopdefaultstop vacuuming
K10+commanddockdefaultreturn to charging dock
K10+commandPowLevel{0-3}set suction power level: 0 (Quiet), 1 (Standard), 2 (Strong), 3 (MAX)
Mini Robot Vacuum K10+ Pro
deviceTypecommandTypeCommandcommand parameterDescription
K10+ Procommandstartdefaultstart vacuuming
K10+ Procommandstopdefaultstop vacuuming
K10+ Procommanddockdefaultreturn to charging dock
K10+ ProcommandPowLevel{0-3}set suction power level: 0 (Quiet), 1 (Standard), 2 (Strong), 3 (MAX)
K10+ Pro Combo
deviceTypecommandTypeCommandcommand parameterDescription
Robot Vacuum Cleaner K10+ Pro CombocommandstartClean{"action": action_str, "param": {"fanLevel": fan_level_int, "times": clean_cycle_int}}start cleaning. <br />action_str, the cleaning mode, sweep or mop.<br />fanLevel, the vacuum level, 1-4.<br />times, the number of cycles, 1-2639999, in theory.
Robot Vacuum Cleaner K10+ Pro Combocommandpausedefaultpause cleaning
Robot Vacuum Cleaner K10+ Pro Combocommanddockdefaultreturn to charging dock
Robot Vacuum Cleaner K10+ Pro CombocommandsetVolume{0-100}set the robot volume
Robot Vacuum Cleaner K10+ Pro CombocommandchangeParam{"fanLevel": fan_level_int, "waterLevel": water_level_int, "times": clean_cycle_int}change clean parameters. fan_level_int, the vacuum level, 1-4; water_level_int, the mop moisture level, 1-2; times, the number of cycles, 1-2639999, in theory.
Floor Cleaning Robot S10
deviceTypecommandTypeCommandcommand parameterDescription
Floor Cleaning Robot S10commandstartClean{"action": clean_mode_str, "param": {"fanLevel": fan_level_int, "waterLevel": water_level_int, "times": clean_cycle_int}}start cleaning.<br />action, the cleaning mode, sweep or sweep_mop.<br />fanLevel, the vacuum level, 1-4.<br />waterLevel, the mop moisture level, 1-2.<br />times, the number of cycles, 1-2639999, in theory.
Floor Cleaning Robot S10commandaddWaterForHumidefaultrefill the mind blowing Evaporative Humidifier (Auto-refill).
Floor Cleaning Robot S10commandpausedefaultpause.
Floor Cleaning Robot S10commanddockdefaultreturn to Auto-empty Station and charge.
Floor Cleaning Robot S10commandsetVolume0-100set volume, 1-100
Floor Cleaning Robot S10commandselfClean1 or 2 or 3mode 1, wash the mop.<br />mode 2, dry itself.<br /> mode 3, terminate.
Floor Cleaning Robot S10commandchangeParam{"fanLevel": fan_level_int, "waterLevel": water_level_int, "times": clean_cycle_int}fanLevel, the vacuum level, 1-4.<br />waterLevel, the mop moisture level, 1-2.<br />times, the number of cycles, 1-2639999, in theory.
Ceiling Light
deviceTypecommandTypeCommandcommand parameterDescription
Ceiling LightcommandturnOndefaultset to ON state
Ceiling LightcommandturnOffdefaultset to OFF state
Ceiling Lightcommandtoggledefaulttoggle state
Ceiling LightcommandsetBrightness{1-100}set brightness
Ceiling LightcommandsetColorTemperature{2700-6500}set the color temperature
Ceiling Light Pro
deviceTypecommandTypeCommandcommand parameterDescription
Ceiling Light ProcommandturnOndefaultset to ON state
Ceiling Light ProcommandturnOffdefaultset to OFF state
Ceiling Light Procommandtoggledefaulttoggle state
Ceiling Light ProcommandsetBrightness{1-100}set brightness
Ceiling Light ProcommandsetColorTemperature{2700-6500}set the color temperature
Keypad

The control commands for this product work differently than the other products. Due to security concerns, the passcodes are stored locally. This mechanism dramatically prolongs the time needed to successfully create a passcode and get the correct result through the Web API. Hence, the actual results of the following commands are returned from the SwitchBot server asynchronously and are delivered through a webhook.

You need to configure a webhook to receive the correct result. Refer to this product's webhook definition.

deviceTypecommandTypeCommandcommand parameterDescription
KeypadcommandcreateKey{ "name": passcode _name_str, "type": passcode_type_str, "password": passcode_str, "startTime": valid_from_long, "endTime": valid_to_long }create a new passcode
KeypadcommanddeleteKey{ "id": passcode_id_int }delete an existing passcode

The following table describes the parameter object for createKey,

Key NameValue TypeDescription
nameStringa unique name for the passcode. duplicates under the same device are not allowed.
typeStringtype of the passcode. permanent, a permanent passcode. timeLimit, a temporary passcode. disposable, a one-time passcode. urgent, an emergency passcode.
passwordStringa 6 to 12-digit passcode in plain text
startTimeLongset the time the passcode becomes valid from, mandatory for one-time passcode and temporary passcode. a 10-digit timestamp.
endTimeLongset the time the passcode becomes expired, mandatory for one-time passcode and temporary passcode. a 10-digit timestamp.

The following table describes the parameter object for deleteKey,

Key NameValue TypeDescription
idStringthe id of the passcode
Keypad Touch

The control commands for this product work differently than the other products. Due to security concerns, the passcodes are stored locally. This mechanism dramatically prolongs the time needed to successfully create a passcode and get the correct result through the Web API. Hence, the actual results of the following commands are returned from the SwitchBot server asynchronously and are delivered through a webhook.

You need to configure a webhook to receive the correct result. Refer to this product's webhook definition.

deviceTypecommandTypeCommandcommand parameterDescription
Keypad TouchcommandcreateKey{ "name": passcode _name_str, "type": passcode_type_str, "password": passcode_str, "startTime": valid_from_long, "endTime": valid_to_long }create a new passcode
Keypad TouchcommanddeleteKey{ "id": passcode_id_int }delete an existing passcode

The following table describes the parameter object for createKey,

Key NameValue TypeDescription
nameStringa unique name for the passcode. duplicates under the same device are not allowed.
typeStringtype of the passcode. permanent, a permanent passcode. timeLimit, a temporary passcode. disposable, a one-time passcode. urgent, an emergency passcode.
passwordStringa 6 to 12-digit passcode in plain text
startTimeLongset the time the passcode becomes valid from, mandatory for one-time passcode and temporary passcode. a 10-digit timestamp.
endTimeLongset the time the passcode becomes expired, mandatory for one-time passcode and temporary passcode. a 10-digit timestamp.

The following table describes the parameter object for deleteKey,

Key NameValue TypeDescription
idStringthe id of the passcode
Blind Tilt
deviceTypecommandTypeCommandcommand parameterDescription
Blind TiltcommandsetPositiondirection;position<br />e.g. up;60direction: up/down<br />position: 0~100 (0 means closed, 100 means open, it MUST be set to a multiple of 2. e.g. up;48 or up; 36)
Blind TiltcommandfullyOpendefaultSet the position of Blind Tilt to open, equivalent to setting the position to up;100 or down;100
Blind TiltcommandcloseUpdefaultSet the position of Blind Tilt to closed up, equivalent to setting the position to up;0
Blind TiltcommandcloseDowndefaultSet the position of Blind Tilt to closed down, equivalent to setting the position to down;0
Roller Shade
deviceTypecommandTypeCommandcommand parameterDescription
Roller ShadecommandsetPosition0~1000, open; 100, closed
Battery Circulator Fan
deviceTypecommandTypeCommandcommand parameterDescription
Battery Circulator FancommandturnOffdefaultSet to OFF state
Battery Circulator FancommandturnOndefaultSet to ON state
Battery Circulator FancommandsetNightLightModeoff, 1, or 2off, turn off nightlight,<br />1, bright <br />2, dim
Battery Circulator FancommandsetWindModedirect, natural, sleep, or babySet fan mode. direct: direct mode. natural: natural mode. sleep: sleep mode. baby: ultra quiet mode
Battery Circulator FancommandsetWindSpeed{1-100} e.g. 10Set fan speed.1~100
Circulator Fan
deviceTypecommandTypeCommandcommand parameterDescription
Circulator FancommandturnOffdefaultSet to OFF state
Circulator FancommandturnOndefaultSet to ON state
Circulator FancommandsetNightLightModeoff, 1, or 2off, turn off nightlight,<br />1, bright <br />2, dim
Circulator FancommandsetWindModedirect, natural, sleep, or babySet fan mode. direct: direct mode. natural: natural mode. sleep: sleep mode. baby: ultra quiet mode
Circulator FancommandsetWindSpeed{1-100} e.g. 10Set fan speed.1~100

Command set for virtual infrared remote devices

The table below describes all the available commands for virtual infrared remote devices,

deviceTypecommandTypeCommandcommand parameterDescription
All home appliance types except OtherscommandturnOndefaultevery home appliance can be turned on by default
All home appliance types except OtherscommandturnOffdefaultevery home appliance can be turned off by default
Otherscustomize{user-defined button name}defaultall user-defined buttons must be configured with commandType=customize
Air ConditionercommandsetAll{temperature},{mode},{fan speed},{power state}<br />e.g. 26,1,3,onthe unit of temperature is in celsius; <br />modes include 0/1 (auto), 2 (cool), 3 (dry), 4 (fan), 5 (heat); <br />fan speed includes 1 (auto), 2 (low), 3 (medium), 4 (high); <br />power state includes on and off
TV, IPTV/Streamer, Set Top BoxcommandSetChannel{channel number}, e.g. 15set the TV channel to switch to
commandvolumeAdddefaultvolume up
commandvolumeSubdefaultvolume down
commandchannelAdddefaultnext channel
commandchannelSubdefaultprevious channel
DVD, SpeakercommandsetMutedefaultmute/unmute
commandFastForwarddefaultfast forward
commandRewinddefaultrewind
commandNextdefaultnext track
commandPreviousdefaultlast track
commandPausedefaultpause
commandPlaydefaultplay/resume
commandStopdefaultstop
SpeakercommandvolumeAdddefaultvolume up
commandvolumeSubdefaultvolume down
Fancommandswingdefaultswing
commandtimerdefaultset timer
commandlowSpeeddefaultset fan speed to low
commandmiddleSpeeddefaultset fan speed to medium
commandhighSpeeddefaultset fan speed to high
LightcommandbrightnessUpdefaultbrightness up
commandbrightnessDowndefaultbrightness down

Note: Most of the devices support turnOn or turnOff, which are case-sensitive. For infrared remote devices, when you have created customized buttons, you must set commandType to customize, otherwise the command will not work. command needs to be set to the name of the customized button.

Path parameters

NameTypeRequiredDescription
deviceIdStringYesdevice ID

Request body parameters

NameTypeRequiredDescription
commandStringYesthe name of the command
parameterStringNosome commands require parameters, such as SetChannel
commandTypeStringNofor customized buttons, this needs to be set to customzie

Response

The response is basically a JSON object, which contains the following properties,

Key NameValue Type
statusCodeInteger
messageString
bodyObject<body>

Errors

Error code/messageDescription
{"message": "Unauthorized"}Http 401 Error. User permission is denied due to invalid token.
151device type error
152device not found
160command is not supported
161device offline
171hub device is offline
190Device internal error due to device states not synchronized with server. Or command format is invalid.

Sample

Floor Cleaning Robot S10 example

Clean with vacuum mode

Request

POST https://api.switch-bot.com/v1.1/devices/F7538E1ABC23/commands
{
    "commandType": "command",
    "command": "startClean", // start cleaning
    "parameter": {
        "action": "sweep", // clean with vacuum mode
        "param": {
            "fanLevel": 1, // vacuum level set to 1
            "waterLevel": 1, // mop moisture level set to 1
            "times": 1 // number of cyclyes to clean set to 1
        }
    }
}

Response

{
    "statusCode": 100,
    "body": {
        "commandId": "CMD166444044923602"
    },
    "message": "success"
}

Change the cleaning settings

Request

POST https://api.switch-bot.com/v1.1/devices/F7538E1ABC23/commands
{
    "commandType": "command",
    "command": "changeParam",
    "parameter": {
      	"fanLevel": 2, // vacuum level set to 1
        "waterLevel": 1, // mop moisture level set to 1
        "times": 1 // number of times to clean set to 2
    }
}

Response

{
    "statusCode": 100,
    "body": {
        "commandId": "CMD166444044923602"
    },
    "message": "success"
}
Keypad example

Create a temporary passcode

Request

POST https://api.switch-bot.com/v1.1/devices/F7538E1ABCEB/commands
{
    "commandType": "command",
    "command": "createKey",
    "parameter": {
        "name": "Guest Code",
        "type": "timeLimit",
        "password": "12345678",
        "startTime": 1664640056,
        "endTime": 1665331432
    }
}

Response

{
    "statusCode": 100,
    "body": {
        "commandId": "CMD166444044923602"
    },
    "message": "success"
}
Bot example

Turn a Bot on

Request

POST https://api.switch-bot.com/v1.1/devices/210/commands
{
    "command": "turnOn",
    "parameter": "default",
    "commandType": "command"
}

Response

{
    "statusCode": 100,
    "body": {},
    "message": "success"
}

Set the color value of a Color Bulb Request

POST https://api.switch-bot.com/v1.1/devices/84F70353A411/commands
{
    "command": "setColor",
    "parameter": "122:80:20", // yellow
    "commandType": "command"
}

Response

{
    "statusCode": 100,
    "body": {},
    "message": "success"
}
Infrared remote device example

Set an Air Conditioner

Request

POST https://api.switch-bot.com/v1.1/devices/02-202007201626-70/commands
{
    "command": "setAll",
    "parameter": "26,1,3,on",
    "commandType": "command"
}

Response

{
    "statusCode": 100,
    "body": {},
    "message": "success"
}

Trigger a customized button

Request

POST https://api.switch-bot.com/v1.1/devices/02-202007201626-10/commands
{
    "command": "ボタン", // the name of the customized button
    "parameter": "default",
    "commandType": "customize"
}

Response

{
    "statusCode": 100,
    "body": {},
    "message": "success"
}

Scenes

The scenes API is used to access the smart scenes created by a user and to execute manual scenes.

Get scene list

GET /v1.1/scenes

Description

Get a list of manual scenes created by the current user.

Response

The response is basically a JSON object, which contains the following properties,

Key NameValue Type
statusCodeInteger
messageString
bodyObject<body>

The body object contains a list of objects, which has the following properties,

KeyTypeDescription
sceneIdStringa scene's ID
sceneNameStringa scene's name

Errors

Error code/messageDescription
{"message": "Unauthorized"}Http 401 Error. User permission is denied due to invalid token.
190Device internal error due to device states not synchronized with server

Sample

Get all scenes

Request

GET https://api.switch-bot.com/v1.1/scenes

Response

{
    "statusCode": 100,
    "body": [
        {
            "sceneId": "T02-20200804130110",
            "sceneName": "Close Office Devices"
        },
        {
            "sceneId": "T02-202009221414-48924101",
            "sceneName": "Set Office AC to 25"
        },
        {
            "sceneId": "T02-202011051830-39363561",
            "sceneName": "Set Bedroom to 24"
        },
        {
            "sceneId": "T02-202011051831-82928991",
            "sceneName": "Turn off home devices"
        },
        {
            "sceneId": "T02-202011062059-26364981",
            "sceneName": "Set Bedroom to 26 degree"
        }
    ],
    "message": "success"
}

Execute manual scenes

POST /v1.1/scenes/{sceneId}/execute

Description

Sends a request to execute a manual scene.

Path parameters

NameTypeRequiredDescription
sceneIdStringYesscene ID

The response is basically a JSON object, which contains the following properties,

Key NameValue Type
statusCodeInteger
messageString
bodyObject<body>

Errors

Error code/messageDescription
{"message": "Unauthorized"}Http 401 Error. User permission is denied due to invalid token.
190Device internal error due to device states not synchronized with server

Sample

Execute a scene

Request

POST https://api.switch-bot.com/v1.1/scenes/T02-202009221414-48924101/execute

Response

{
    "statusCode": 100,
    "body": {},
    "message": "success"
}

Webhook

Configure webhook

Description

Configure the url that all the webhook events will be sent to

Request

POST https://api.switch-bot.com/v1.1/webhook/setupWebhook
Request body parameters
Key NameValue TypeDescription
actionStringthe type of actions
urlStringthe url where all the events are sent to
deviceListStringthe list of device ids, currently only supports "ALL"

Head

{
    "Content-type":"application/json",
    "Authorization":your_token // enter your API token
}

Body

{
    "action":"setupWebhook",
    "url":url1, // enter your url
    "deviceList":"ALL"
}

Response

Sample

{
    "statusCode": 100,
    "body": {},
    "message": ""
}

Get webhook configuration

Description

Get the current configuration info of the webhook

Request

POST https://api.switch-bot.com/v1.1/webhook/queryWebhook
Request body parameters
Key NameValue TypeDescription
actionStringthe type of actions, currently supports "queryUrl", "queryDetails"
urlStringthe url where all the events are sent to. you need to specify the url when using queryDetails
queryUrl

Head

{
    "Content-type":"application/json",
    "Authorization":your_token // enter your API token
}

Body

{
    "action": "queryUrl"
}
queryDetails

Head

{
    "Content-type":"application/json",
    "Authorization":your_token // enter your API token
}

Body

{
    "action": "queryDetails",
    "urls":[url1] // get infos of a url
}

Response

queryUrl
{
    "statusCode": 100,
    "body": {
        "urls": [url1] // the target url
    },
    "message": ""
}
queryDetails
{
    "statusCode": 100,
    "body": [
        {
            "url":url1,
            "createTime":123456,
            "lastUpdateTime":123456,
            "deviceList": "ALL",
            "enable":true
        }
    ],
    "message": ""
}

Update webhook configuration

Description

Update the configuration of the webhook

Request

POST https://api.switch-bot.com/v1.1/webhook/updateWebhook
Request body parameters
Key NameValue TypeDescription
actionStringthe type of actions
configObjectthe configuration details you want to update. you can change the current url or enable/disable the webhook. refer to the example below

Head

{
    "Content-type":"application/json",
    "Authorization":your_token // enter your API token
}

Body

{
    "action": "updateWebhook",
    "config":{
        "url":url1,
        "enable":true
    }
}

Response

{
    "statusCode": 100,
    "body": {},
    "message": ""
}

Delete webhook

Description

Delete the configuration of the webhook

Request

POST https://api.switch-bot.com/v1.1/webhook/deleteWebhook
Request body parameters
Key NameValue TypeDescription
actionStringthe type of actions
urlStringthe url where all the events are sent to

Head

{
    "Content-type":"application/json",
    "Authorization":your_token // enter your API token
}

Body

{
    "action": "deleteWebhook",
    "url":url1
}

Response

{
    "statusCode": 100,
    "body": {},
    "message": ""
}

Receive events from webhook

When an event gets triggered, SwitchBot server will send a POST request to the url you have configured. Refer to the table below for a list of products that support webhook.

Device TypeProduct
WoHandBot
WoCurtainCurtain
WoPresenceMotion Sensor
WoContactContact Sensor
WoLockLock
WoLockProLock Pro
WoCameraIndoor Cam
WoPanTiltCamPan/Tilt Cam
WoBulbColor Bulb
WoStripLED Strip Light
WoPlugUSPlug Mini (US)
WoPlugJPPlug Mini (JP)
WoMeterMeter
WoMeterPlusMeter Plus
WoIOSensorOutdoor Meter
WoSweeperRobot Vacuum Cleaner S1
WoSweeperPlusRobot Vacuum Cleaner S1 Plus
WoCeilingCeiling Light
WoCeilingProCeiling Light Pro
WoKeypadKeypad
WoKeypadTouchKeypad Touch
WoHub2Hub 2
Robot Vacuum Cleaner S10Floor Cleaning Robot S10
Water DetectorWater Leak Detector
MeterProMeter Pro
MeterPro(CO2)Meter Pro CO2 Monitor
WoFan2Battery Circulator Fan or Circulator Fan
Humidifier2Evaporative Humidifier or Evaporative Humidifier (Auto-refill)
Robot Vacuum Cleaner K10+ Pro ComboK10+ Pro Combo
Air Purifier VOCAir Purifier VOC
Air Purifier Table VOCAir Purifier Table VOC
Air Purifier PM2.5Air Purifier PM2.5
Air Purifier Table PM2.5Air Purifier Table PM2.5
WoRollerShadeRoller Shade
Relay Switch 1PMRelay Switch 1PM
Relay Switch 1Relay Switch 1

Bot

Key NameValue TypeDescription
eventTypeStringthe type of events
eventVersionStringthe current event version
contextObjectthe detail info of the event
deviceTypeStringthe type of the device
deviceMacStringthe MAC address of the device
powerStringthe current state of the device. This state is only valid for Switch Mode, where "on" stands for on and "off" stands for off. It will return "on" or "off" in Press Mode or Customize Mode, but the returned value can be neglected.
timeOfSampleLongthe time stamp when the event is sent
{
    "eventType": "changeReport",
    "eventVersion": "1",
    "context": {
        "deviceType": "WoHand",
        "deviceMac": DEVICE_MAC_ADDR,
        "power": "on",//"on"or"off"
        "battery": 10,
        "deviceMode": "pressMode",//pressMode,switchMode,customizeMode
        "timeOfSample": 123456789
    }
}

Curtain

Key NameValue TypeDescription
eventTypeStringthe type of events
eventVersionStringthe current event version
contextObjectthe detail info of the event
deviceTypeStringthe type of the device
deviceMacStringthe MAC address of the device
calibrateBooleandetermines if the open position and the close position of a device have been properly calibrated or not
groupBooleandetermines if a Curtain is paired with or grouped with another Curtain or not
slidePositionIntegerthe percentage of the distance between the calibrated open position and closed position that Curtain has traversed
batteryIntegerthe battery level of a Curtain
timeOfSampleLongthe time stamp when the event is sent
{
    "eventType": "changeReport",
    "eventVersion": "1",
    "context": {
        "deviceType": "WoCurtain",
        "deviceMac": DEVICE_MAC_ADDR,
        "calibrate":false,
        "group":false,
        "slidePosition":50, //0~100
        "battery":100,
        "timeOfSample": 123456789
    }
}

Curtain 3

Key NameValue TypeDescription
eventTypeStringthe type of events
eventVersionStringthe current event version
contextObjectthe detail info of the event
deviceTypeStringthe type of the device
deviceMacStringthe MAC address of the device
calibrateBooleandetermines if the open position and the close position of a device have been properly calibrated or not
groupBooleandetermines if a Curtain is paired with or grouped with another Curtain or not
slidePositionIntegerthe percentage of the distance between the calibrated open position and closed position that Curtain has traversed
batteryIntegerthe battery level of a Curtain
timeOfSampleLongthe time stamp when the event is sent
{
    "eventType": "changeReport",
    "eventVersion": "1",
    "context": {
        "deviceType": "WoCurtain3",
        "deviceMac": DEVICE_MAC_ADDR,
        "calibrate":false,
        "group":false,
        "slidePosition":50, //0~100
        "battery":100,
        "timeOfSample": 123456789
    }
}

Motion Sensor

Key NameValue TypeDescription
eventTypeStringthe type of events
eventVersionStringthe current event version
contextObjectthe detail info of the event
deviceTypeStringthe type of the device
deviceMacStringthe MAC address of the device
detectionStateStringthe motion state of the device, "DETECTED" stands for motion is detected; "NOT_DETECTED" stands for motion has not been detected for some time
batteryIntegerthe current battery level, 0-100
timeOfSampleLongthe time stamp when the event is sent
{
    "eventType": "changeReport",
    "eventVersion": "1",
    "context": {
        "deviceType": "WoPresence",
        "deviceMac": DEVICE_MAC_ADDR,
        "detectionState": "NOT_DETECTED",
        "battery":100,
        "timeOfSample": 123456789
    }
}

Contact Sensor

Key NameValue TypeDescription
eventTypeStringthe type of events
eventVersionStringthe current event version
contextObjectthe detail info of the event
deviceTypeStringthe type of the device
deviceMacStringthe MAC address of the device
detectionStateStringthe motion state of the device, "DETECTED" stands for motion is detected; "NOT_DETECTED" stands for motion has not been detected for some time
doorModeStringwhen the enter or exit mode gets triggered, "IN_DOOR" or "OUT_DOOR" is returned
brightnessStringthe level of brightness, can be "bright" or "dim"
openStateStringthe state of the contact sensor, can be "open" or "close" or "timeOutNotClose"
batteryIntegerthe current battery level, 0-100
timeOfSampleLongthe time stamp when the event is sent
{
    "eventType": "changeReport",
    "eventVersion": "1",
    "context": {
        "deviceType": "WoContact",
        "deviceMac": DEVICE_MAC_ADDR,
        "detectionState": "NOT_DETECTED",
        "doorMode":"OUT_DOOR",
        "brightness": "dim",
        "openState": "open",
        "battery":100,
        "timeOfSample": 123456789
    }
}

Water Leak Detector

Key NameValue TypeDescription
eventTypeStringthe type of events
eventVersionStringthe current event version
contextObjectthe detail info of the event
deviceTypeStringthe type of the device
deviceMacStringthe MAC address of the device
detectionStateInteger0, dry. 1, leak detected
batteryIntegerthe current battery level, 0-100
timeOfSampleLongthe time stamp when the event is sent
{
    "eventType": "changeReport",
    "eventVersion": "1",
    "context": {
        "deviceType": "Water Detector",
        "deviceMac": DEVICE_MAC_ADDR,
        "detectionState": 0,
        "battery":100,
        "timeOfSample": 123456789
    }
}

Meter

Key NameValue TypeDescription
eventTypeStringthe type of events
eventVersionStringthe current event version
contextObjectthe detail info of the event
deviceTypeStringthe type of the device
deviceMacStringthe MAC address of the device
temperatureFloatthe current temperature reading
scaleStringthe current temperature unit being used
humidityIntegerthe current humidity reading in percentage
batteryIntegerthe current battery level, 0-100
timeOfSampleLongthe time stamp when the event is sent
{
    "eventType": "changeReport",
    "eventVersion": "1",
    "context": {
        "deviceType": "WoMeter",
        "deviceMac": DEVICE_MAC_ADDR,
        "temperature": 22.5,
        "scale": "CELSIUS",
        "humidity": 31,
        "battery":100,
        "timeOfSample": 123456789
    }
}

Meter Plus

Key NameValue TypeDescription
eventTypeStringthe type of events
eventVersionStringthe current event version
contextObjectthe detail info of the event
deviceTypeStringthe type of the device
deviceMacStringthe MAC address of the device
temperatureFloatthe current temperature reading
scaleStringthe current temperature unit being used
humidityIntegerthe current humidity reading in percentage
batteryIntegerthe current battery level, 0-100
timeOfSampleLongthe time stamp when the event is sent
{
    "eventType": "changeReport",
    "eventVersion": "1",
    "context": {
        "deviceType": "WoMeter",
        "deviceMac": DEVICE_MAC_ADDR,
        "temperature": 22.5,
        "scale": "CELSIUS",
        "humidity": 31,
        "battery":100,
        "timeOfSample": 123456789
    }
}

Outdoor Meter

Key NameValue TypeDescription
eventTypeStringthe type of events
eventVersionStringthe current event version
contextObjectthe detail info of the event
deviceTypeStringthe type of the device
deviceMacStringthe MAC address of the device
temperatureFloatthe current temperature reading
scaleStringthe current temperature unit being used
humidityIntegerthe current humidity reading in percentage
batteryIntegerthe current battery level, 0-100
timeOfSampleLongthe time stamp when the event is sent
{
    "eventType": "changeReport",
    "eventVersion": "1",
    "context": {
        "deviceType": "WoIOSensor",
        "deviceMac": DEVICE_MAC_ADDR,
        "temperature": 22.5,
        "scale": "CELSIUS",
        "humidity": 31,
        "battery":100,
        "timeOfSample": 123456789
    }
}

Meter Pro

Key NameValue TypeDescription
eventTypeStringthe type of events
eventVersionStringthe current event version
contextObjectthe detail info of the event
deviceTypeStringthe type of the device
deviceMacStringthe MAC address of the device
temperatureFloatthe current temperature reading
scaleStringthe current temperature unit being used
humidityIntegerthe current humidity reading in percentage
batteryIntegerthe current battery level, 0-100
timeOfSampleLongthe time stamp when the event is sent
{
    "eventType": "changeReport",
    "eventVersion": "1",
    "context": {
        "deviceType": "MeterPro",
        "deviceMac": DEVICE_MAC_ADDR,
        "temperature": 22.5,
        "scale": "CELSIUS",
        "humidity": 31,
        "battery":100,
        "timeOfSample": 123456789
    }
}

Meter Pro CO2

Key NameValue TypeDescription
eventTypeStringthe type of events
eventVersionStringthe current event version
contextObjectthe detail info of the event
deviceTypeStringthe type of the device
deviceMacStringthe MAC address of the device
temperatureFloatthe current temperature reading
scaleStringthe current temperature unit being used
humidityIntegerthe current humidity reading in percentage
CO2IntegerCO2 ppm value, 0-9999
batteryIntegerthe current battery level, 0-100
timeOfSampleLongthe time stamp when the event is sent
{
    "eventType": "changeReport",
    "eventVersion": "1",
    "context": {
        "deviceType": "MeterPro(CO2)",
        "deviceMac": DEVICE_MAC_ADDR,
        "temperature": 22.5,
        "scale": "CELSIUS",
        "humidity": 31,
        "CO2": 1203,
        "battery":100,
        "timeOfSample": 123456789
    }
}

Lock

Key NameValue TypeDescription
eventTypeStringthe type of events
eventVersionStringthe current event version
contextObjectthe detail info of the event
deviceTypeStringthe type of the device
deviceMacStringthe MAC address of the device
lockStateStringthe state of the device, "LOCKED" stands for the motor is rotated to locking position; "UNLOCKED" stands for the motor is rotated to unlocking position; "JAMMED" stands for the motor is jammed while rotating
batteryIntegerthe current battery level, 0-100
timeOfSampleLongthe time stamp when the event is sent
{
    "eventType": "changeReport",
    "eventVersion": "1",
    "context": {
        "deviceType": "WoLock",
        "deviceMac": DEVICE_MAC_ADDR,
        "lockState": "LOCKED",
        "battery":100,
        "timeOfSample": 123456789
    }
}

Lock Pro

Key NameValue TypeDescription
eventTypeStringthe type of events
eventVersionStringthe current event version
contextObjectthe detail info of the event
deviceTypeStringthe type of the device
deviceMacStringthe MAC address of the device
lockStateStringthe state of the device, "LOCKED" stands for the motor is rotated to locking position; "UNLOCKED" stands for the motor is rotated to unlocking position; "JAMMED" stands for the motor is jammed while rotating
batteryIntegerthe current battery level, 0-100
timeOfSampleLongthe time stamp when the event is sent
{
    "eventType": "changeReport",
    "eventVersion": "1",
    "context": {
        "deviceType": "WoLockPro",
        "deviceMac": DEVICE_MAC_ADDR,
        "lockState": "LOCKED",
        "battery":100,
        "timeOfSample": 123456789
    }
}

Indoor Cam

Key NameValue TypeDescription
eventTypeStringthe type of events
eventVersionStringthe current event version
contextObjectthe detail info of the event
deviceTypeStringthe type of the device
deviceMacStringthe MAC address of the device
detectionStateStringthe detection state of the device, "DETECTED" stands for motion is detected
timeOfSampleLongthe time stamp when the event is sent
{
    "eventType": "changeReport",
    "eventVersion": "1",
    "context": {
        "deviceType": "WoCamera",
        "deviceMac": DEVICE_MAC_ADDR,
        "detectionState": "DETECTED",
        "timeOfSample": 123456789
    }
}

Pan/Tilt Cam

Key NameValue TypeDescription
eventTypeStringthe type of events
eventVersionStringthe current event version
contextObjectthe detail info of the event
deviceTypeStringthe type of the device
deviceMacStringthe MAC address of the device
detectionStateStringthe detection state of the device, "DETECTED" stands for motion is detected
timeOfSampleLongthe time stamp when the event is sent
{
    "eventType": "changeReport",
    "eventVersion": "1",
    "context": {
        "deviceType": "WoPanTiltCam",
        "deviceMac": DEVICE_MAC_ADDR,
        "detectionState": "DETECTED",
        "timeOfSample": 123456789
    }
}

Color Bulb

Key NameValue TypeDescription
eventTypeStringthe type of events
eventVersionStringthe current event version
contextObjectthe detail info of the event
deviceTypeStringthe type of the device
deviceMacStringthe MAC address of the device
powerStateStringthe current power state of the device, "ON" or "OFF"
brightnessIntegerthe brightness value, range from 1 to 100
colorStringthe color value, in the format of RGB value, "255:255:255"
colorTemperatureIntegerthe color temperature value, range from 2700 to 6500
timeOfSampleLongthe time stamp when the event is sent
{
    "eventType": "changeReport",
    "eventVersion": "1",
    "context": {
        "deviceType": "WoBulb",
        "deviceMac": DEVICE_MAC_ADDR,
        "powerState": "ON",
        "brightness": 10,
        "color":"255:245:235",
        "colorTemperature":3500,
        "timeOfSample": 123456789
    }
}

LED Strip Light

Key NameValue TypeDescription
eventTypeStringthe type of events
eventVersionStringthe current event version
contextObjectthe detail info of the event
deviceTypeStringthe type of the device
deviceMacStringthe MAC address of the device
powerStateStringthe current power state of the device, "ON" or "OFF"
brightnessIntegerthe brightness value, range from 1 to 100
colorStringthe color value, in the format of RGB value, "255:255:255"
timeOfSampleLongthe time stamp when the event is sent
{
    "eventType": "changeReport",
    "eventVersion": "1",
    "context": {
        "deviceType": "WoStrip",
        "deviceMac": DEVICE_MAC_ADDR,
        "powerState": "ON",
        "brightness": 10,
        "color": "255:245:235",
        "timeOfSample": 123456789
    }
}

Plug Mini (US)

Key NameValue TypeDescription
eventTypeStringthe type of events
eventVersionStringthe current event version
contextObjectthe detail info of the event
deviceTypeStringthe type of the device
deviceMacStringthe MAC address of the device
powerStateStringthe current power state of the device, "ON" or "OFF"
timeOfSampleLongthe time stamp when the event is sent
{
    "eventType": "changeReport",
    "eventVersion": "1",
    "context": {
        "deviceType": "WoPlugUS",
        "deviceMac": DEVICE_MAC_ADDR,
        "powerState": "ON",
        "timeOfSample": 123456789
    }
}

Plug Mini (JP)

Key NameValue TypeDescription
eventTypeStringthe type of events
eventVersionStringthe current event version
contextObjectthe detail info of the event
deviceTypeStringthe type of the device
deviceMacStringthe MAC address of the device
powerStateStringthe current power state of the device, "ON" or "OFF"
timeOfSampleLongthe time stamp when the event is sent
{
    "eventType": "changeReport",
    "eventVersion": "1",
    "context": {
        "deviceType": "WoPlugJP",
        "deviceMac": DEVICE_MAC_ADDR,
        "powerState": "ON",
        "timeOfSample": 123456789
    }
}

Robot Vacuum Cleaner S1

Key NameValue TypeDescription
eventTypeStringthe type of events
eventVersionStringthe current event version
contextObjectthe detail info of the event
deviceTypeStringattributes of the context object. the type of the device
deviceMacStringattributes of the context object. the MAC address of the device
workingStatusStringattributes of the context object. the working status of the device. StandBy, Clearing, Paused, GotoChargeBase, Charging, ChargeDone, Dormant, InTrouble, InRemoteControl, or InDustCollecting
onlineStatusStringattributes of the context object. the connection status of the device. online or offline
batteryIntegerattributes of the context object. the battery level, range from 0 to 100
timeOfSampleLongattributes of the context object. the time stamp when the event is sent
{
    "eventType": "changeReport",
    "eventVersion": "1",
    "context": {
        "deviceType": "WoSweeper",
        "deviceMac": DEVICE_MAC_ADDR,
        "workingStatus":"StandBy",
        "onlineStatus": "online",
        "battery": 100,
        "timeOfSample": 123456789
    }
}

Robot Vacuum Cleaner S1 Plus

Key NameValue TypeDescription
eventTypeStringthe type of events
eventVersionStringthe current event version
contextObjectthe detail info of the event
deviceTypeStringattributes of the context object. the type of the device
deviceMacStringattributes of the context object. the MAC address of the device
workingStatusStringattributes of the context object. the working status of the device. StandBy, Clearing, Paused, GotoChargeBase, Charging, ChargeDone, Dormant, InTrouble, InRemoteControl, or InDustCollecting
onlineStatusStringattributes of the context object. the connection status of the device. online or offline
batteryIntegerattributes of the context object. the battery level, range from 0 to 100
timeOfSampleLongattributes of the context object. the time stamp when the event is sent
{
    "eventType": "changeReport",
    "eventVersion": "1",
    "context": {
        "deviceType": "WoSweeperPlus",
        "deviceMac": DEVICE_MAC_ADDR,
        "workingStatus":"StandBy",
        "onlineStatus": "online",
        "battery": 100,
        "timeOfSample": 123456789
    }
}

Mini Robot Vacuum K10+

Key NameValue TypeDescription
eventTypeStringthe type of events
eventVersionStringthe current event version
contextObjectthe detail info of the event
deviceTypeStringattributes of the context object. the type of the device
deviceMacStringattributes of the context object. the MAC address of the device
workingStatusStringattributes of the context object. the working status of the device. StandBy, Clearing, Paused, GotoChargeBase, Charging, ChargeDone, Dormant, InTrouble, InRemoteControl, or InDustCollecting
onlineStatusStringattributes of the context object. the connection status of the device. online or offline
batteryIntegerattributes of the context object. the battery level, range from 0 to 100
timeOfSampleLongattributes of the context object. the time stamp when the event is sent
{
    "eventType": "changeReport",
    "eventVersion": "1",
    "context": {
        "deviceType": "WoSweeperMini",
        "deviceMac": DEVICE_MAC_ADDR,
        "workingStatus":"StandBy",
        "onlineStatus": "online",
        "battery": 100,
        "timeOfSample": 123456789
    }
}

Mini Robot Vacuum K10+ Pro

Key NameValue TypeDescription
eventTypeStringthe type of events
eventVersionStringthe current event version
contextObjectthe detail info of the event
deviceTypeStringattributes of the context object. the type of the device
deviceMacStringattributes of the context object. the MAC address of the device
workingStatusStringattributes of the context object. the working status of the device. StandBy, Clearing, Paused, GotoChargeBase, Charging, ChargeDone, Dormant, InTrouble, InRemoteControl, or InDustCollecting
onlineStatusStringattributes of the context object. the connection status of the device. online or offline
batteryIntegerattributes of the context object. the battery level, range from 0 to 100
timeOfSampleLongattributes of the context object. the time stamp when the event is sent
{
    "eventType": "changeReport",
    "eventVersion": "1",
    "context": {
        "deviceType": "WoSweeperMiniPro",
        "deviceMac": DEVICE_MAC_ADDR,
        "workingStatus":"StandBy",
        "onlineStatus": "online",
        "battery": 100,
        "timeOfSample": 123456789
    }
}

K10+ Pro Combo

Key NameValue TypeDescription
eventTypeStringthe type of events
eventVersionStringthe current event version
contextObjectthe detail info of the event
deviceTypeStringattributes of the context object. the type of the device
deviceMacStringattributes of the context object. the MAC address of the device
workingStatusStringattributes of the context object. the working status of the device. StandBy, Clearing, Paused, GotoChargeBase, Charging, ChargeDone, Dormant, InTrouble, InRemoteControl, or InDustCollecting
onlineStatusStringattributes of the context object. the connection status of the device. online or offline
batteryIntegerattributes of the context object. the battery level, range from 0 to 100
taskTypeStringattributes of the context object. the current task in progress. standBy, explore, cleanAll, cleanArea, cleanRoom, backToCharge, collectDust, remoteControl, cleanWithExplorer
timeOfSampleLongattributes of the context object. the time stamp when the event is sent
{
    "eventType": "changeReport",
    "eventVersion": "1",
    "context": {
        "deviceType": "Robot Vacuum Cleaner K10+ Pro Combo",
        "deviceMac": DEVICE_MAC_ADDR,
        "workingStatus":"StandBy",
        "onlineStatus": "online",
        "battery": 100,
        "taskType": "explore",
        "timeOfSample": 123456789
    }
}

Floor Cleaning Robot S10

Key NameValue TypeDescription
eventTypeStringthe type of events
eventVersionStringthe current event version
contextObjectthe detail info of the event
deviceTypeStringattributes of the context object. the type of the device
deviceMacStringattributes of the context object. the MAC address of the device
workingStatusStringattributes of the context object. the working status of the device. StandBy, Clearing, Paused, GotoChargeBase, Charging, ChargeDone, Dormant, InTrouble, InRemoteControl, or InDustCollecting
onlineStatusStringattributes of the context object. the connection status of the device. online or offline
batteryIntegerattributes of the context object. the battery level, 0-100
waterBaseBatteryIntegerthe current battery level 0-100
taskTypeStringthe current task in progress. standBy, explore, cleanAll, cleanArea, cleanRoom, fillWater, deepWashing, backToCharge, markingWaterBase, drying, collectDust, remoteControl, cleanWithExplorer, fillWaterForHumi, markingHumi
timeOfSampleLongattributes of the context object. the time stamp when the event is sent
{
    "eventType": "changeReport",
    "eventVersion": "1",
    "context": {
        "deviceType": "Robot Vacuum Cleaner S10",
        "deviceMac": DEVICE_MAC_ADDR,
        "workingStatus":"StandBy",
        "onlineStatus": "online",
        "battery": 100,// 0-100
        "waterBaseBattery": 100,
        "taskType": "explore",
        "timeOfSample": 123456789
    }
}

Ceiling Light

Key NameValue TypeDescription
eventTypeStringthe type of events
eventVersionStringthe current event version
contextObjectthe detail info of the event
deviceTypeStringattributes of the context object. the type of the device
deviceMacStringattributes of the context object. the MAC address of the device
powerStateStringattributes of the context object. ON/OFF state
brightnessIntegerattributes of the context object. the brightness value, range from 1 to 100
colorTemperatureIntegerattributes of the context object. the color temperature value, range from 2700 to 6500
timeOfSampleLongattributes of the context object. the time stamp when the event is sent
{
    "eventType": "changeReport",
    "eventVersion": "1",
    "context": {
        "deviceType": "WoCeiling",
        "deviceMac": DEVICE_MAC_ADDR,
        "powerState": "ON",
        "brightness": 10,
        "colorTemperature": 3500,
        "timeOfSample": 123456789
    }
}

Ceiling Light Pro

Key NameValue TypeDescription
eventTypeStringthe type of events
eventVersionStringthe current event version
contextObjectthe detail info of the event
deviceTypeStringattributes of the context object. the type of the device
deviceMacStringattributes of the context object. the MAC address of the device
powerStateStringattributes of the context object. ON/OFF state
brightnessIntegerattributes of the context object. the brightness value, range from 1 to 100
colorTemperatureIntegerattributes of the context object. the color temperature value, range from 2700 to 6500
timeOfSampleLongattributes of the context object. the time stamp when the event is sent
{
    "eventType": "changeReport",
    "eventVersion": "1",
    "context": {
        "deviceType": "WoCeilingPro",
        "deviceMac": DEVICE_MAC_ADDR,
        "powerState": "ON",
        "brightness": 10,
        "colorTemperature": 3500,
        "timeOfSample": 123456789
    }
}

Keypad

Key NameValue TypeDescription
eventTypeStringthe type of events
eventVersionStringthe current event version
contextObjectthe detail info of the event
deviceTypeStringattributes of the context object. the type of the device
deviceMacStringattributes of the context object. the MAC address of the device
eventNameStringattributes of the context object. the name of the command being sent
commandIdStringattributes of the context object. the command id
resultStringattributes of the context object. the result of the command. success, failed, or timeout. timeout duration is 1 minute
timeOfSampleLongattributes of the context object. the time stamp when the event is sent
Create a passcode
{
    "eventType": "changeReport",
    "eventVersion": "1",
    "context": {
        "deviceType": "WoKeypad",
        "deviceMac": DEVICE_MAC_ADDR,
        "eventName": "createKey",
        "commandId": "CMD-1663558451952-01",
        "result": "success",
        "timeOfSample": 123456789
    }
}
Delete a passcode
{
    "eventType": "changeReport",
    "eventVersion": "1",
    "context": {
        "deviceType": "WoKeypad",
        "deviceMac": DEVICE_MAC_ADDR,
        "eventName": "deleteKey ",
        "commandId": "CMD-1663558451952-01",
        "result": "success",
        "timeOfSample": 123456789
    }
}

Keypad Touch

Key NameValue TypeDescription
eventTypeStringthe type of events
eventVersionStringthe current event version
contextObjectthe detail info of the event
deviceTypeStringattributes of the context object. the type of the device
deviceMacStringattributes of the context object. the MAC address of the device
eventNameStringattributes of the context object. the name of the command being sent
commandIdStringattributes of the context object. the command id
resultStringattributes of the context object. the result of the command. success, failed, or timeout. timeout duration is 1 minute
timeOfSampleLongattributes of the context object. the time stamp when the event is sent
Create a passcode
{
    "eventType": "changeReport",
    "eventVersion": "1",
    "context": {
        "deviceType": "WoKeypadTouch",
        "deviceMac": DEVICE_MAC_ADDR,
        "eventName": "createKey",
        "commandId": "CMD-1663558451952-01",
        "result": "success",
        "timeOfSample": 123456789
    }
}
Delete a passcode
{
    "eventType": "changeReport",
    "eventVersion": "1",
    "context": {
        "deviceType": "WoKeypadTouch",
        "deviceMac": DEVICE_MAC_ADDR,
        "eventName": "deleteKey ",
        "commandId": "CMD-1663558451952-01",
        "result": "success",
        "timeOfSample": 123456789
    }
}

Hub 2

Key NameValue TypeDescription
eventTypeStringthe type of events
eventVersionStringthe current event version
contextObjectthe detail info of the event
deviceTypeStringattributes of the context object. the type of the device
deviceMacStringattributes of the context object. the MAC address of the device
temperatureFloatthe current temperature reading
humidityIntegerthe current humidity reading in percentage
lightLevelIntegerthe level of illuminance of the ambience light, 1~20
scaleStringthe current temperature unit being used
timeOfSampleLongattributes of the context object. the time stamp when the event is sent
{
    "eventType": "changeReport",
    "eventVersion": "1",
    "context": {
        "deviceType": "WoHub2",
        "deviceMac": DEVICE_MAC_ADDR,
        "temperature":13,
        "humidity":18,
        "lightLevel": 19,
        "scale": "CELSIUS",
        "timeOfSample": 123456789
    }
}

Battery Circulator Fan

Key NameValue TypeDescription
eventTypeStringthe type of events
eventVersionStringthe current event version
contextObjectthe detail info of the event
deviceTypeStringthe type of the device
deviceMacStringthe MAC address of the device
modeStringfan mode. direct mode: direct; natural mode: "natural"; sleep mode: "sleep"; ultra quiet mode: "baby"
versionStringthe current firmware version, e.g. V4.2
batteryIntegerthe current battery level
powerStateStringON/OFF state
nightStatusIntegerset nightlight status. turn off: off; mode 1: 1; mode 2: 2
oscillationStringset horizontal oscillation. turn on: on; turn off: off
verticalOscillationStringset vertical oscillation. turn on: on; turn off: off
chargingStatusStringbattery charge status. charging or uncharged
fanSpeedIntegerfan speed. 1~100
timeOfSampleLongthe time stamp when the event is sent
{
    "eventType": "changeReport",
    "eventVersion": "1",
    "context": {
        "deviceType": "WoFan2",
        "deviceMac": DEVICE_MAC_ADDR,
        "mode": "direct",
        "version": "V3.1",
        "battery": 22,
        "powerState": "ON",
        "nightStatus": "off",
        "oscillation": "on",
        "verticalOscillation": "on",
        "chargingStatus": "charging",
        "fanSpeed": 3,
        "timeOfSample": 123456789
    }
}

Circulator Fan

Key NameValue TypeDescription
eventTypeStringthe type of events
eventVersionStringthe current event version
contextObjectthe detail info of the event
deviceTypeStringthe type of the device
deviceMacStringthe MAC address of the device
modeStringfan mode. direct mode: direct; natural mode: "natural"; sleep mode: "sleep"; ultra quiet mode: "baby"
versionStringthe current firmware version, e.g. V4.2
powerStateStringON/OFF state
nightStatusIntegerset nightlight status. turn off: off; mode 1: 1; mode 2: 2
oscillationStringset horizontal oscillation. turn on: on; turn off: off
verticalOscillationStringset vertical oscillation. turn on: on; turn off: off
fanSpeedIntegerfan speed. 1~100
timeOfSampleLongthe time stamp when the event is sent
{
    "eventType": "changeReport",
    "eventVersion": "1",
    "context": {
        "deviceType": "WoFan2",
        "deviceMac": DEVICE_MAC_ADDR,
        "mode": "direct",
        "version": "V3.1",
        "powerState": "ON",
        "nightStatus": "off",
        "oscillation": "on",
        "verticalOscillation": "on",
        "fanSpeed": 3,
        "timeOfSample": 123456789
    }
}

Evaporative Humidifier

Key NameValue TypeDescription
eventTypeStringthe type of events
eventVersionStringthe current event version
contextObjectthe detail info of the event
deviceTypeStringthe type of the device
deviceMacStringthe MAC address of the device
powerStringthe power state of the device
modeIntegerthe current mode. 1, level 4; 2, level 3; 3, level 2; 4, level 1; 5, humidity mode; 6, sleep mode; 7, auto mode; 8, drying mode
dryingBooleandetermines if the device is drying its filter or not
timeOfSampleLongthe time stamp when the event is sent
{
    "eventType": "changeReport",
    "eventVersion": "1",
    "context": {
        "deviceType": "Humidifier2",
        "deviceMac": DEVICE_MAC_ADDR,
        "power": "on",
        "mode": 1,
        "drying": false,
        "timeOfSample": 123456789
    }
}

Evaporative Humidifier (Auto-refill)

Key NameValue TypeDescription
eventTypeStringthe type of events
eventVersionStringthe current event version
contextObjectthe detail info of the event
deviceTypeStringthe type of the device
deviceMacStringthe MAC address of the device
powerStringthe power state of the device
modeIntegerthe current mode. 1, level 4; 2, level 3; 3, level 2; 4, level 1; 5, humidity mode; 6, sleep mode; 7, auto mode; 8, drying mode
dryingBooleandetermines if the device is drying its filter or not
timeOfSampleLongthe time stamp when the event is sent
{
    "eventType": "changeReport",
    "eventVersion": "1",
    "context": {
        "deviceType": "Humidifier2",
        "deviceMac": DEVICE_MAC_ADDR,
        "power": "on",
        "mode": 1,
        "drying": false,
        "timeOfSample": 123456789
    }
}

Air Purifier VOC

Key NameValue TypeDescription
eventTypeStringthe type of events
eventVersionStringthe current event version
contextObjectthe detail info of the event
deviceTypeStringthe type of the device
deviceMacStringthe MAC address of the device
powerStringthe power state of the device
modeIntegerthe current mode. 1, level 4; 2, level 3; 3, level 2; 4, level 1; 5, humidity mode; 6, sleep mode; 7, auto mode; 8, drying mode
dryingBooleandetermines if the device is drying its filter or not
childLockIntegerchild lock. 0, disabled; 1, enabled
timeOfSampleLongthe time stamp when the event is sent
{
    "eventType": "changeReport",
    "eventVersion": "1",
    "context": {
        "deviceType": "Air Purifier VOC",
        "deviceMac": DEVICE_MAC_ADDR,
        "power": "ON",
        "mode": 4,
        "childLock": 0,
        "timeOfSample": 123456789
    }
}

Air Purifier Table VOC

Key NameValue TypeDescription
eventTypeStringthe type of events
eventVersionStringthe current event version
contextObjectthe detail info of the event
deviceTypeStringthe type of the device
deviceMacStringthe MAC address of the device
powerStringthe power state of the device
modeIntegerthe current mode. 1, level 4; 2, level 3; 3, level 2; 4, level 1; 5, humidity mode; 6, sleep mode; 7, auto mode; 8, drying mode
dryingBooleandetermines if the device is drying its filter or not
childLockIntegerchild lock. 0, disabled; 1, enabled
timeOfSampleLongthe time stamp when the event is sent
{
    "eventType": "changeReport",
    "eventVersion": "1",
    "context": {
        "deviceType": "Air Purifier Table VOC",
        "deviceMac": DEVICE_MAC_ADDR,
        "power": "ON",
        "mode": 4,
        "childLock": 0,
        "timeOfSample": 123456789
    }
}

Air Purifier PM2.5

Key NameValue TypeDescription
eventTypeStringthe type of events
eventVersionStringthe current event version
contextObjectthe detail info of the event
deviceTypeStringthe type of the device
deviceMacStringthe MAC address of the device
powerStringthe power state of the device
modeIntegerthe current mode. 1, level 4; 2, level 3; 3, level 2; 4, level 1; 5, humidity mode; 6, sleep mode; 7, auto mode; 8, drying mode
dryingBooleandetermines if the device is drying its filter or not
childLockIntegerchild lock. 0, disabled; 1, enabled
timeOfSampleLongthe time stamp when the event is sent
{
    "eventType": "changeReport",
    "eventVersion": "1",
    "context": {
        "deviceType": "Air Purifier PM2.5",
        "deviceMac": DEVICE_MAC_ADDR,
        "power": "ON",
        "mode": 4,
        "childLock": 0,
        "timeOfSample": 123456789
    }
}

Air Purifier Table PM2.5

Key NameValue TypeDescription
eventTypeStringthe type of events
eventVersionStringthe current event version
contextObjectthe detail info of the event
deviceTypeStringthe type of the device
deviceMacStringthe MAC address of the device
powerStringthe power state of the device
modeIntegerthe current mode. 1, level 4; 2, level 3; 3, level 2; 4, level 1; 5, humidity mode; 6, sleep mode; 7, auto mode; 8, drying mode
dryingBooleandetermines if the device is drying its filter or not
childLockIntegerchild lock. 0, disabled; 1, enabled
timeOfSampleLongthe time stamp when the event is sent
{
    "eventType": "changeReport",
    "eventVersion": "1",
    "context": {
        "deviceType": "Air Purifier Table PM2.5",
        "deviceMac": DEVICE_MAC_ADDR,
        "power": "ON",
        "mode": 4,
        "childLock": 0,
        "timeOfSample": 123456789
    }
}

Roller Shade

Key NameValue TypeDescription
eventTypeStringthe type of events
eventVersionStringthe current event version
contextObjectthe detail info of the event
deviceTypeStringthe type of the device
deviceMacStringthe MAC address of the device
calibrateBooleandetermines if the open position and the close position of a device have been properly calibrated or not
slidePositionIntegerthe percentage of the distance between the calibrated open position and closed position that the device has traversed
batteryIntegerthe battery level
timeOfSampleLongthe time stamp when the event is sent
{
    "eventType": "changeReport",
    "eventVersion": "1",
    "context": {
        "deviceType": "WoRollerShade",
        "deviceMac": DEVICE_MAC_ADDR,
        "calibrate":false,
        "slidePosition":50, //0~100
        "battery":100,
        "timeOfSample": 123456789
    }
}

Relay Switch 1PM

Key NameValue TypeDescription
eventTypeStringthe type of events
eventVersionStringthe current event version
contextObjectthe detail info of the event
deviceTypeStringthe type of the device
deviceMacStringthe MAC address of the device
onlineBooleandetermines if the device is connected to the internet or disconnected
switchStatusIntegerthe switch state of the device. 1, on; 0, off
overloadBooleandetermines if the device is power overloaded or not
overTemperatureBooleandetermines if the working temperature is over 100 degree celcius or not
timeOfSampleLongthe time stamp when the event is sent
{
    "eventType": "changeReport",
    "eventVersion": "1",
    "context": {
        "deviceType": "Relay Switch 1PM",
        "deviceMac": DEVICE_MAC_ADDR,
        "online": false,
        "overTemperature": true,
        "overload": true,
        "switchStatus": 1,
        "timeOfSample": 123456789
    }
}

Relay Switch 1

Key NameValue TypeDescription
eventTypeStringthe type of events
eventVersionStringthe current event version
contextObjectthe detail info of the event
deviceTypeStringthe type of the device
deviceMacStringthe MAC address of the device
onlineBooleandetermines if the device is connected to the internet or disconnected
switchStatusIntegerthe switch state of the device. 1, on; 0, off
overTemperatureBooleandetermines if the working temperature is over 100 degree celcius or not
timeOfSampleLongthe time stamp when the event is sent
{
    "eventType": "changeReport",
    "eventVersion": "1",
    "context": {
        "deviceType": "Relay Switch 1",
        "deviceMac": DEVICE_MAC_ADDR,
        "online": false,
        "overTemperature": true,
        "switchStatus": 1,
        "timeOfSample": 123456789
    }
}