Skip to content

michaelahern/wattbox-api

Repository files navigation

WattBox API Client

npm node downloads types Ask DeepWiki

An unofficial Node.JS client library for WattBox IP Power devices.

Docs

https://michaelahern.github.io/wattbox-api/

Supported Devices

  • WB-800 Series
  • WB-250 Series
  • WB-150 Series

Note: This library implements the WattBox Integration Protocol used by the above series devices, which is not supported on WB-700 and WB-300 series devices...

Installing

$ npm install wattbox-api

Example

import { WattBoxClient, WattBoxOutletAction } from 'wattbox-api';

async function main() {
    const client = new WattBoxClient({
        host: '[HOST]',
        username: '[USERNAME]',
        password: '[PASSWORD]'
    });

    client.on('outletStatus', (outlets) => {
        console.log('Updated Outlet Status:', outlets);
        // Updated Outlet Status: [ true, true, true, true, true, false ]
    });

    await client.connect();

    await client.getModel()
        .then(resp => console.log('Model:', resp));
    // Model: WB-800-IPVM-6

    await client.getOutletCount()
        .then(resp => console.log('Outlet Count:', resp));
    // Outlet Count: 6

    await client.getOutletStatus()
        .then(resp => console.log('Outlet Status:', resp));
    // Outlet Status: [ true, true, true, true, true, true ]

    await client.setOutletAction(6, WattBoxOutletAction.OFF);
}

main().catch(err => console.error(err));

About

An unofficial Node.js client library for WattBox IP Power devices.

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Contributors 3

  •  
  •  
  •