Need Project Manager

    tp-link-tapo-connect
    TypeScript icon, indicating that this package has built-in type declarations

    1.0.8 • Public • Published

    TP-Link Tapo Connect

    Unofficial Node.js library for connecting to TP-Link Tapo devices. Currently limited to the:

    • P100 & P105 smart plugs
    • L510E smart bulbs
    • IP cameras like C320WS

    Installation Instructions

      npm install tp-link-tapo-connect

    Usage

    Discovery

    In order to discover your devices it is advisable to login to your TP-Link account and call the listDevices function. To do this:

    const cloudToken = await cloudLogin(email, password);
        
    const devices = await listDevicesByType(cloudToken, 'SMART.TAPOPLUG');

    Once you have determined which device you wish to use. You can enquire of its current state using:

    const deviceToken = await loginDevice(email, password, devices[0]); // Performs a mac lookup to determine local IP address
    // OR
    const deviceToken = await loginDeviceByIp(email, password, deviceIp); // If you know your local device IP address
        
    const getDeviceInfoResponse = await getDeviceInfo(deviceToken);
    console.log(getDeviceInfoResponse);

    To change the device state e.g. turn it on or off use:

    await turnOn(deviceToken);
    await setBrightness(deviceToken, 75); // Sets brightness to 75% for smart bulbs only
    await turnOff(deviceToken);

    Changing the bulb colour (Colour smart bulbs only):

    await turnOn(deviceToken);
    await setColour(deviceToken, 'white'); // Sets the colour for colour smart bulbs only
    await setColour(deviceToken, '#FF00FF'); // Sets the colour for colour smart bulbs only using a hex value
    await turnOff(deviceToken);

    Availble Preset Colours

    white
    warmwhite
    daylightwhite
    blue
    red
    green
    yellow

    Load videos from tapo-care cloud

    const cloudVideos = await tapoCareCloudVideos(cloudToken, deviceId); //deviceId from listDevicesByType 

    Credits

    Credit to this API go to:

    Keywords

    none

    Install

    npm i tp-link-tapo-connect

    DownloadsWeekly Downloads

    467

    Version

    1.0.8

    License

    ISC

    Unpacked Size

    97.8 kB

    Total Files

    41

    Last publish

    Collaborators

    • pdickinson