Home

Awesome

node-botvac

A node module for Neato Botvac Connected. Based on tomrosenbacks PHP Port and kanggurus work on the undocumented Neato API.

Installation

npm install node-botvac

<a name="example"></a>

Usage Example

var botvac = require('node-botvac');

var client = new botvac.Client();
//authorize
client.authorize('email', 'password', false, function (error) {
    if (error) {
        console.log(error);
        return;
    }
    //get your robots
    client.getRobots(function (error, robots) {
        if (error) {
            console.log(error);
            return;
        }
        if (robots.length) {
            //do something        
            robots[0].getState(function (error, result) {
               console.log(result);
            });
        }
    });
});

<a name="client"></a>

Client API


<a name="authorize"></a>

client.authorize(email, password, force, callback)

Login at the neato api.


<a name="getRobots"></a>

client.getRobots(callback)

Returns an array containing your registered <a href="#robot">robots</a>.

<a name="robot"></a>

Robot Properties

These properties will be updated every time <a href="#getState"><code>robot.<b>getState()</b></code></a> is called:

<a name="api"></a>

Robot API


<a name="getState"></a>

robot.getState([callback])

Returns the state object of the robot. Also updates all robot properties.

var state = {
   version: 1,
   reqId: '1',
   result: 'ok',
   error: 'ui_alert_invalid',
   data: {},
   state: 1,
   action: 0,
   cleaning: {category: 2, mode: 1, modifier: 1, spotWidth: 0, spotHeight: 0},
   details: {
       isCharging: false,
       isDocked: true,
       isScheduleEnabled: false,
       dockHasBeenSeen: false,
       charge: 98
   },
   availableCommands: {
       start: true,
       stop: false,
       pause: false,
       resume: false,
       goToBase: false
   },
   availableServices: {
       houseCleaning: 'basic-1',
       spotCleaning: 'basic-1',
       manualCleaning: 'basic-1',
       easyConnect: 'basic-1',
       schedule: 'basic-1'
   },
   meta: {modelName: 'BotVacConnected', firmware: '2.0.0'}};

<a name="getSchedule"></a>

robot.getSchedule([callback])

Returns the scheduling state of the robot.


<a name="enableSchedule"></a>

robot.enableSchedule([callback])

Enables scheduling.


<a name="disableSchedule"></a>

robot.disableSchedule([callback])

Disables scheduling.


<a name="startCleaning"></a>

robot.startCleaning([eco], [navigationMode], [noGoLines], [callback])

Start cleaning.


<a name="startSpotCleaning"></a>

robot.startSpotCleaning([eco], [width], [height], [repeat], [navigationMode], [callback])

Start spot cleaning.


<a name="stopCleaning"></a>

robot.stopCleaning([callback])

Stop cleaning.


<a name="pauseCleaning"></a>

robot.pauseCleaning([callback])

Pause cleaning.


<a name="resumeCleaning"></a>

robot.resumeCleaning([callback])

Resume cleaning.


<a name="getPersistentMaps"></a>

robot.getPersistentMaps([callback])

Returns the persistent maps of the robot


<a name="getMapBoundaries"></a>

robot.getMapBoundaries(mapId, [callback])

Returns the boundaries of a map


<a name="setMapBoundaries"></a>

robot.setMapBoundaries(mapId, [callback])

Sets boundaries for a map


<a name="startCleaningBoundary"></a>

robot.startCleaningBoundary([eco], [extraCare], [boundaryId], [callback])

Start cleaning with boundaries


<a name="sendToBase"></a>

robot.sendToBase([callback])

Send robot to base.


<a name="findMe"></a>

robot.findMe([callback])

Locate the robot by emitting a sound and light

Changelog

0.4.1

0.4.0

0.3.0

0.2.0

0.1.5

0.1.6