Skip to main content

pylitterbot

PyPI - Version Buy Me A Coffee/Beer Sponsor on GitHub Purchase Litter-Robot

GitHub License PyPI - Python Version Pepy Total Downloads PyPI - Downloads

Python package for controlling Whisker connected self-cleaning litter boxes and feeders.

This is an unofficial API for controlling various Whisker automated robots. It currently supports Litter-Robot 3 (with connect), Litter-Robot 4, Litter-Robot 5 (including the Litter-Robot 5 Pro camera) and Feeder-Robot.

Disclaimer

This API is experimental and was reverse-engineered by monitoring network traffic and decompiling source code from the Whisker app since no public API is currently available at this time. It may cease to work at any time. Use at your own risk.

Installation

Install using pip

pip install pylitterbot

To include the MCP server for AI assistant integration:

pip install pylitterbot[mcp]

To include live video streaming for the Litter-Robot 5 Pro camera:

pip install 'pylitterbot[camera]'

Alternatively, clone the repository and run

uv sync

adding --extra camera (uv sync --extra camera) for live camera video.

Usage

import asyncio

from pylitterbot import Account

# Set email and password for initial authentication.
username = "Your username"
password = "Your password"


async def main():
    # Create an account.
    account = Account()

    try:
        # Connect to the API and load robots.
        await account.connect(username=username, password=password, load_robots=True)

        # Print robots associated with account.
        print("Robots:")
        for robot in account.robots:
            print(robot)
    finally:
        # Disconnect from the API.
        await account.disconnect()


if __name__ == "__main__":
    asyncio.run(main())

which will output something like:

Name: Litter-Robot Name, Serial: LR3C012345, id: a0123b4567cd8e

If you only want to discover specific robot families, pass the classes you want to query when you create the account or when you load robots:

from pylitterbot import Account, LitterRobot4, LitterRobot5

...

account = Account(robot_types=[LitterRobot4, LitterRobot5])

await account.connect(
    username=username,
    password=password,
    load_robots=True,
)

To start a clean cycle

await robot.start_cleaning()

If no exception occurred, your Litter-Robot should now perform a clean cycle.

Currently the following methods are available in the Robot class:

  • refresh()
  • start_cleaning()
  • reset_settings()
  • set_panel_lockout()
  • set_night_light()
  • set_power_status()
  • set_sleep_mode()
  • set_wait_time()
  • set_name()
  • get_activity_history()
  • get_insight()

Litter-Robot 5 Pro camera

Litter-Robot 5 Pro robots expose their camera through the LitterRobot5 class (robot.has_camera is True):

from pylitterbot import LitterRobot5

for robot in account.get_robots(LitterRobot5):
    if not robot.has_camera:
        continue

    print(await robot.get_camera_status())  # e.g. "ONLINE"
    print(await robot.get_camera_view())  # "front", "globe" or None if unknown
    if not await robot.set_camera_view("globe"):
        print("Could not switch the camera view")

    # Recorded clips
    for clip in await robot.get_camera_videos(limit=5):
        print(clip.id, clip.event_type, clip.created_at)

Clip listings depend on the timezone sent with the request. get_camera_videos() uses the robot's timezone by default; pass timezone= to override it. Listing all clips can take many requests, so avoid calling it on a polling interval.

Live video uses WebRTC. With the camera extra installed, CameraStream receives the video and audio frames in Python:

robot = next((r for r in account.get_robots(LitterRobot5) if r.has_camera), None)

if robot is None:
    print("No Litter-Robot 5 Pro camera on this account")
else:
    async with robot.create_camera_stream() as stream:
        stream.on_video_frame(lambda frame: print(frame.width, frame.height))
        if await stream.wait_for_connection():
            await asyncio.sleep(10)

To show the stream in a browser instead (for example, Home Assistant's camera platform), use CameraSignalingRelay from pylitterbot.camera to pass the browser's WebRTC offer and ICE candidates to the camera. Its start() returns once the camera has answered (usually within a few seconds), so keep accepting the browser's ICE candidates while it runs.

Camera sessions are short-lived. If the camera does not answer an offer within 10 seconds, the offer is retried once on a fresh session before a CameraStreamException is raised.

MCP Server

pylitterbot includes an optional MCP (Model Context Protocol) server that lets AI assistants like Claude monitor and control your robots through natural language.

Installation

pip install pylitterbot[mcp]

Running

pylitterbot-mcp

or

python -m pylitterbot.mcp

Claude Desktop configuration

Add this to your Claude Desktop config (claude_desktop_config.json):

{
  "mcpServers": {
    "litter-robot": {
      "command": "python",
      "args": ["-m", "pylitterbot.mcp"],
      "env": {
        "LITTER_ROBOT_USERNAME": "your@email.com",
        "LITTER_ROBOT_PASSWORD": "your_password"
      }
    }
  }
}

Note: The configuration above stores credentials in plaintext. Ensure appropriate file permissions on your config file (owner-only read/write) and avoid committing it to version control.

Available tools

Status and info: get_robots, get_robot_status, get_activity_history, get_insight, get_pets

Commands: start_cleaning, reset_robot, give_snack, set_power_status

Settings: set_name, set_night_light, set_night_light_brightness, set_night_light_mode, set_panel_lockout, set_wait_time, set_sleep_mode

Compound operations that combine multiple API calls:

Tool Description
fleet_overview Prioritized status across all robots with alerts
clean_all_ready Start cleaning on all robots in READY state
sync_settings Copy one robot's settings to all others of the same model
pet_usage_report Activity data across all robots with pet info
maintenance_forecast Estimate when each robot needs emptying
household_digest Time-bounded summary of all activity
troubleshooting_report Diagnostic bundle for a robot with errors
robot_comparison Compare settings and metrics across robots

Contributing

Thank you for your interest in contributing! Please see CONTRIBUTING.md for how to get started.


❤️ Support Me

I maintain this python project in my spare time. If you find it useful, consider supporting development:

If you don't already own a Litter-Robot, please consider using my referral link to purchase your own robot and save $50!

📈 Star History

Star History Chart

Metadata

Release files for pylitterbot 2025.9.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pylitterbot 2025.9.0
File Size Uploaded Provenance Actions
pylitterbot-2025.9.0.tar.gz 79.4 kB Without provenance Details for pylitterbot-2025.9.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pylitterbot 2025.9.0
File Interpreter ABI Platform Actions
pylitterbot-2025.9.0-py3-none-any.whl Python 3 none any Details for pylitterbot-2025.9.0-py3-none-any.whl

Total release size: 175.7 kB

Release files / pylitterbot-2025.9.0.tar.gz

Download URL pylitterbot-2025.9.0.tar.gz
Size 79.4 kB
Tags Source
SHA-256 checksum
How to use checksums
4501cc3b4610b24dfbbe4debd4d6b6649b5916479b94ff6faab6a946311f8d76
BLAKE2b-256 checksum
How to use checksums
b0df1e3b0aaef1fcd07fff55d749e69d5f8b4201f653f10780b26c326e1d56f9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.0 {"installer":{"name":"uv","version":"0.13.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / pylitterbot-2025.9.0-py3-none-any.whl

Download URL pylitterbot-2025.9.0-py3-none-any.whl
Size 96.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6f40a5f7a211285da3cd96fafae6386f0473d1c03d5bb35e04e86e384252261b
BLAKE2b-256 checksum
How to use checksums
370880cec5a3712fb2d4b74f639d33b6d63d8d9997415fac8f629499d1accf66
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.0 {"installer":{"name":"uv","version":"0.13.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for pylitterbot 2025.9.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

2025.9.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page