Skip to content

Shortcut functions

Sascha edited this page May 16, 2021 · 41 revisions

There are shortcut functions available to run actions on your bot.

Cleaning

vacbot.run("Clean"); // auto clean
vacbot.run("Edge");
vacbot.run("Spot");
vacbot.run("SpotArea", "start", areas);
vacbot.run("CustomArea", "start", boundaryCoordinates, numberOfCleanings);

Various control commands

vacbot.run("Charge"); // return to charging station
vacbot.run("Stop");
vacbot.run("Pause");
vacbot.run("Resume"); // resume if paused

Manual control

Please note:

  • Each command is executed only 1 time by the Ecovacs API.
  • You must first execute another command before the command can be executed the next time.
vacbot.run("MoveBackward");
vacbot.run("MoveLeft");
vacbot.run("MoveRight");
vacbot.run("MoveForward");

Retrieve states

vacbot.run("GetCleanState"); // retrieve the cleaning status
vacbot.run("GetChargeState"); // retrieve the charging status
vacbot.run("GetBatteryState"); // retrieve the battery level
vacbot.run("GetSleepStatus"); // retrieve info if the vacuum is in sleeping mode

Cleaning log and consumable

vacbot.run("GetCleanLogs");
vacbot.run("GetCleanSum");
vacbot.run("GetLifeSpan"); // retrieve combined LifeSpan event
vacbot.run("GetLifeSpan", "main_brush"); // deprecated
vacbot.run("GetLifeSpan", "side_brush"); // deprecated
vacbot.run("GetLifeSpan", "filter"); // deprecated
vacbot.run("ResetLifeSpan", "main_brush");
vacbot.run("ResetLifeSpan", "side_brush");
vacbot.run("ResetLifeSpan", "filter");

Voice and sound

You can find a list of soundIDs here.

vacbot.run("PlaySound"); // soundID = 0 "startup music chime"
vacbot.run("PlaySound", soundID);
vacbot.run("GetVolume");
vacbot.run("SetVolume", volume); // value range: 0-10

Position

vacbot.run("GetPosition"); // retrieve current position of the vacuum
vacbot.run("GetChargerPos"); // retrieve charging position
vacbot.run("Relocate"); // send command to relocate position

Map data, spot areas and virtual boundaries

vacbot.run("GetMaps"); // retrieve map data
vacbot.run("GetSpotAreas", mapID); // retrieve spot areas
vacbot.run("GetVirtualBoundaries", mapID); // retrieve virtual boundaries

Spot areas

vacbot.run("GetSpotAreaInfo", mapID, spotAreaID); // retrieve various data for a spot area
vacbot.run("RenameSpotArea", mapSetID, spotAreaID, name) // works only with a few models (e.g. OZMO 930)

Virtual boundaries

boundaryType:

  • "vw" = virtual wall
  • "mw" = no-mop-zone
vacbot.run("GetVirtualBoundaryInfo", mapID, boundaryID, boundaryType); // retrieve various data for a virtual boundary
vacbot.run("DeleteVirtualBoundary", mapID, boundaryID, boundaryType); // delete a virtual boundary
// boundaryCoordinates are passed as a string with a comma-separated 
// list of boundaries (x, y pairs), formatted like an array.
// example: "[-1072,-3142,-1072,-4240,1349,-4240,1349,-3142]"
vacbot.run("AddVirtualBoundary", mapID, boundaryCoordinates, boundaryType);

Vacuum power

vacbot.run("GetCleanSpeed"); // retrieve vacuum power value
vacbot.run("SetCleanSpeed", level); // value range: 1-4

Mopping and waterbox

vacbot.run("GetWaterLevel"); // retrieve mopping water amount
vacbot.run("SetWaterLevel", level); // Water level adjustment - value range: 1-4
vacbot.run("GetWaterBoxInfo"); // indicates if waterbox is installed

Various other commands

vacbot.run("GetNetInfo");
vacbot.run("GetOnOff", "do_not_disturb");
vacbot.run("GetOnOff", "continuous_cleaning");
vacbot.run("GetOnOff", "silence_voice_report");
vacbot.run("SetOnOff", "do_not_disturb", value); // 0 = off, 1 = on
vacbot.run("SetOnOff", "continuous_cleaning", value); // 0 = off, 1 = on
vacbot.run("SetOnOff", "silence_voice_report", value); // 0 = off, 1 = on

Auto empty station

vacbot.run("GetAutoEmpty"); // retrieve info if auto empty is enabled
vacbot.run("SetAutoEmpty", value); // 0 = disabled, 1 = enabled
Clone this wiki locally