Skip to main content

Control iRobot cleaning robots

Project description

This ia a python module for controlling the iRobot Roomba 980 (and possibly Roomba 960 and Braava 300, but those are untested)

iRobot does not povide an official API for their robots; I reverse engineered this from the communication between my robot, the iRobot iOS app, and the Axeda IoT cloud service. The names of methods and attributes are mapped as closely as possible to the way the ap presents them.

This module is published to pypi, so you can install it via pip install pyirobot

Usage

Robot Password

To use any of the robot functions, you will need to get the password of your robot. Robot.GetPassword() can help you do this. Make sure your robot is on the home base and then hold down the home button for 3-4 seconds, until the LEDs illuminate and the robot emits a series of tones. Then quickly call Robot.GetPassword with the IP address of your robot.

Controlling the Robot

You can start and stop cleaning and send the robot back to the home base with StartCleaning, PauseCleaning, ResumeCleaning, EndCleaning and ReturnHome

from pyirobot import Robot
robot = Robot("192.168.0.0", "MtccDqXskShX|4jXnTd")
robot.StartCleaning()

robot.StopCleaning()
robot.ReturnHome()

Robot Configuration

GetCleaningPreferences returns the cleaning preferences for the robot. CarpetBoost, CleaningPasses, EdgeClean and FinishWhenBinFull are all enums in the module.

import json
from pyirobot import Robot
robot = Robot("192.168.0.0", "MtccDqXskShX|4jXnTd")
print json.dumps(robot.GetCleaningPreferences(), sort_keys=True, indent=4)

Output:

{
    "carpetBoost": "Auto",
    "cleaningPasses": "Auto",
    "edgeClean": "On",
    "finishWhenBinFull": "Off",
    "lang": 0,
    "name": "Roomba",
    "timezone": "America/Chicago"
}

There are other functions for getting the cleaning schedule, robot time, and various other settings, as well as the corresponding Set functions.

Errors

Any error coming back from the robot’s API is thrown as a RobotError. Errors from networking/communication with the robot are thrown by requests and uncaught/unmodified by this library.

Known Issues

This module is still a work in progress, so error handling and unit tests are pretty light and the API isn’t complete yet This first release only supports local communication with the robot; remote/cloud support is in progress

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyirobot-1.0.2.tar.gz (4.5 kB view hashes)

Uploaded Source

Built Distribution

pyirobot-1.0.2-py2-none-any.whl (6.8 kB view hashes)

Uploaded Python 2

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page