A node module for Neato Botvac Connected. Based on tomrosenbacks PHP Port and kanggurus work on the undocumented Neato API.
npm install node-botvac
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);
});
}
});
});Login at the neato api.
email- your neato emailpassword- your neato passwortforce- force login if already authorizedcallback-function(error)errornull if no error occurred
Returns an array containing your registered robots.
callback-function(error, robots)errornull if no error occurredrobotsarray - your robots
robot.name- nickname of this robot (cannot be changed)
These properties will be updated every time robot.getState() is called:
robot.isChargingbooleanrobot.isDockedbooleanrobot.isScheduleEnabledbooleanrobot.dockHasBeenSeenbooleanrobot.chargenumber - charge in percentrobot.canStartboolean - robot is ready to start cleaningrobot.canStopboolean - cleaning can be stoppedrobot.canPauseboolean - cleaning can be pausedrobot.canResumeboolean - cleaning can be resumedrobot.canGoToBaseboolean - robot can be sent to baserobot.ecoboolean - set to true to clean in eco moderobot.noGoLinesboolean - set to true to enable noGoLinesrobot.navigationModenumber - 1: normal, 2: extra care (new models only)robot.spotWidthnumber - width for spot cleaning in cmrobot.spotHeightnumber - height for spot cleaning in cmrobot.spotRepeatboolean - set to true to clean spot two times
robot.getState()robot.getSchedule()robot.enableSchedule()robot.disableSchedule()robot.startCleaning()robot.startSpotCleaning()robot.stopCleaning()robot.pauseCleaning()robot.resumeCleaning()robot.getPersistentMaps()robot.getMapBoundaries()robot.setMapBoundaries()robot.startCleaningBoundary()robot.sendToBase()robot.findMe()
Returns the state object of the robot. Also updates all robot properties.
callback-function(error, state)errornullif no error occurredstateobject- example:
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'}};Returns the scheduling state of the robot.
callback-function(error, schedule)errornull if no error occurredscheduleboolean - true if scheduling is enabled
Enables scheduling.
callback-function(error, result)errornull if no error occurredresultstring - 'ok' if scheduling got enabled
Disables scheduling.
callback-function(error, result)errornull if no error occurredresultstring - 'ok' if scheduling got disabled
Start cleaning.
ecoboolean - clean in eco modenavigationModenumber - 1: normal, 2: extra care (new models only)ecoboolean - clean with enabled nogo linescallback-function(error, result)errornull if no error occurredresultstring - 'ok' if cleaning could be started
Start spot cleaning.
ecoboolean - clean in eco modewidthnumber - spot width in cm (min 100cm)heightnumber - spot height in cm (min 100cm)repeatboolean - clean spot two timesnavigationModenumber - 1: normal, 2: extra care (new models only)callback-function(error, result)errornull if no error occurredresultstring - 'ok' if spot cleaning could be started
Stop cleaning.
callback-function(error, result)errornull if no error occurredresultstring - 'ok' if cleaning could be stopped
Pause cleaning.
callback-function(error, result)errornull if no error occurredresultstring - 'ok' if cleaning could be paused
Resume cleaning.
callback-function(error, result)errornull if no error occurredresultstring - 'ok' if cleaning could be resumed
Returns the persistent maps of the robot
callback-function(error, schedule)errornull if no error occurredmapsMaps[] - array of maps
Returns the boundaries of a map
mapIdstring - a Map id for which to get the boundariescallback-function(error, schedule)errornull if no error occurredboundariesBoundary[] - array of boundaries
Sets boundaries for a map
mapIdstring - a Map id for which to get the boundariesboundariesBoundary[] - array of boundariescallback-function(error, schedule)errornull if no error occurredboundariesBoundary[] - array of boundaries
Start cleaning with boundaries
ecoboolean - clean in eco modeextraCareboolean - clean in extra care (new models only)boundaryIdstring - a boundary id (zone) to cleancallback-function(error, result)errornull if no error occurredresultstring - 'ok' if cleaning could be started
Send robot to base.
callback-function(error, result)errornull if no error occurredresultstring - 'ok' if robot could be sent to base
Locate the robot by emitting a sound and light
callback-function(error, result)errornull if no error occurredresultstring - 'ok' if robot could be located
- (naofireblade) add findMe
- (az0uz) add persistent maps and boundaries
- (koush) http transport changes and updates
- (naofireblade) add support for new parameter navigationMode (newer models)
- (naofireblade) add support for new parameter noGoLines (newer models)
- (naofireblade) changed to keep cleaning parameters in sync with neato app