obniz Parts Library

Switchbot_Meter_Plus

GitHub
Switchbot_Meter_Plus
Usable Devices :
obniz_board
m5stickc
obnizble
esp32
esp32gateway
m5stackbasic
ak-030
obnizble_lte
obniz_plc

Switchbot_Meter_Plus

Switchbot Meter Plus (WoSensorTH) module

getData()

  • temperature: number;
  • humidity: number;
  • battery: number;

Example

// Javascript
const Switchbot_Meter_Plus = Obniz.getPartsClass("Switchbot_Meter_Plus");
await obniz.ble.initWait();
obniz.ble.scan.onfind = async (peripheral) => {
  if (Switchbot_Meter_Plus.isDevice(peripheral)) {
    console.log(Switchbot_Meter_Plus.getData(peripheral));
  }
};
await obniz.ble.scan.startWait(null, {duplicate: true, duration: null});

Supported from: obniz.js 3.30.0