JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 107
  • Score
    100M100P100Q82777F
  • License MIT

Unofficial Node.js client for XiaoMi Cloud Service.

Package Exports

  • mi-service-lite

Readme

Mi Service Lite

Unofficial Node.js client for XiaoMi Cloud Service.

⚡️ Installation

npm install mi-service-lite

# or
yarn add mi-service-lite

# or
pnpm install mi-service-lite

🔥 Usage

import { getMiIOT, getMiNA } from "mi-service-lite";

async function main() {
  console.log("hello world!", process.env.MI_USER);
  const config = {
    userId: process.env.MI_USER!, // Xiaomi Account
    password: process.env.MI_PASS!, // Account Password
    did: process.env.MI_DID, // Device ID or Name (optional - fill in after retrieving from the device list)
  };
  const MiNA = await getMiNA(config);
  const MiIOT = await getMiIOT(config);
  console.log("MiNA devices", await MiNA?.getDevices());
  console.log("MiIOT devices", await MiIOT?.getDevices());
  // Find your device Spec here: https://home.miot-spec.com/
  await MiIOT.doAction(5, 1, "Hello world, 你好!");
}

main();

❤️ Acknowledgement