Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

PyArlo

License: LGPL v3 Python 3.10+

An asynchronous Python library and command-line automation toolkit for Netgear/Arlo security cameras, doorbells, lights, sensors, and base stations.


⚠️ Alpha Release Notice (v0.9.0-alpha.9)

PyArlo v0.9 is a major rewrite transitioning the entire codebase from legacy synchronous threads to native Python asyncio.

This is an active alpha release — please expect bugs, edge cases, and evolving APIs.

Note on Hardware Testing: The maintainer does not own or have access to every Arlo hardware model (such as all generations of cameras, floodlights, doorbells, chimes, and SmartHubs) and cannot test every permutation. Community testing and feedback are essential to stabilizing this release!

If you encounter issues, regressions, or unexpected behavior with your hardware, please open a GitHub issue. Please include your Python version, Arlo device models, and sanitized/encrypted debug logs generated with --debug-report.

If you need the legacy synchronous documentation for PyArlo v0.8, it is archived in docs/README_v8.md.


Table of Contents


Breaking Changes in v0.9

If you are upgrading from PyArlo 0.8.x, please note the following architectural changes:

  1. Native asyncio Core:
    • PyArlo must be initialized with the asynchronous factory await PyArlo.create(...). The synchronous PyArlo(...) constructor is deprecated.
    • All network and device actions are now coroutines and must be awaited (e.g. await light.turn_on(), await location.set_mode(), await arlo.stop()).
  2. synchronous_mode renamed to inline_mode:
    • inline_mode=True tells PyArlo to wait for an operation's response or event acknowledgment inline before returning.
    • Legacy synchronous_mode remains as a deprecated alias.
  3. Execution & Startup Optimizations:
    • start_background=False: Fast one-shot mode that skips connecting to persistent MQTT/SSE event streams and cron loops.
    • refresh_devices=False: Skips querying /users/devices and reuses locally cached device definitions.
    • Optimistic token reuse: Valid session tokens are reused directly without making redundant network calls to /api/validateAccessToken.
  4. CLI Reorganization:
    • The CLI has been split into three purpose-built tools: pyaarlo, pyaarlo-monitor, and pyaarlo-utils.

Installation

Requires Python >= 3.10.

# Install latest release from git
pip install git+https://github.com/twrecked/pyaarlo.git

# Or install locally in editable mode for development
git clone https://github.com/twrecked/pyaarlo.git
cd pyaarlo
pip install -e .

Command Line Interface (CLI)

PyArlo provides three command-line tools:

1. pyaarlo — Device Actions & Automations

Perform instant actions on your devices with sub-second response times:

# Check token status and expiration
pyaarlo login --status

# Interactive configuration wizard (creates or updates ~/.config/pyaarlo/config.json)
pyaarlo config create
pyaarlo config update
pyaarlo config show

# Authenticate or refresh tokens (supports push, email:imap, sms)
pyaarlo login --push

# Control lights by name or ID
pyaarlo light turn-on "Side Light"
pyaarlo light turn-on --brightness 128 "Side Light"
pyaarlo light turn-off "Side Light"

# Security modes
pyaarlo location list
pyaarlo location set-mode "armHome"

# Media library
pyaarlo media list --days 1 --compact
pyaarlo media list --object animal
pyaarlo media download --limit 5 -o ./media

# Local storage (RATLS direct USB/SD access on SmartHub / Base Station)
pyaarlo local-media status "Front Base"
pyaarlo local-media list --base "Front Base" --compact
pyaarlo local-media download --base "Front Base" --limit 5 -o ./local_media

# List devices and status
pyaarlo list devices --compact

2. pyaarlo-monitor — Real-Time Event Stream

Observe incoming live events (motion, doorbell rings, battery, mode changes):

# Stream live events
pyaarlo-monitor --compact

# Filter by camera and truncate long payloads
pyaarlo-monitor --filter-device "Front Door Bell" -l 60

# Stream events formatted as JSON lines
pyaarlo-monitor --json

3. pyaarlo-utils — Diagnostic Tools

# Dump raw device dictionaries
pyaarlo-utils dump lights

# Anonymize logs and encrypt for GitHub issue reporting
cat error.log | pyaarlo-utils anonymize | pyaarlo-utils encrypt > error.log.enc

👉 See docs/cli.md for full configuration, arguments, and options.


Using the Python Module

import asyncio
from pyaarlo import PyArlo

async def main():
    # Initialize the PyArlo controller
    arlo = await PyArlo.create(
        username="user@example.com",
        password="your-password",
        tfa="push",
    )

    try:
        # Access devices
        for cam in arlo.cameras:
            print(f"Camera: {cam.name} (Battery: {cam.battery_level}%)")

        for light in arlo.lights:
            if not light.is_on:
                await light.turn_on(brightness=200)

        # Set location mode
        if arlo.locations:
            await arlo.locations[0].set_mode("armHome")

    finally:
        # Cleanly stop background tasks and connections
        await arlo.stop(logout=False)

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

Subscribing to Live Events

def on_event(device, attr, value):
    print(f"[{device.name}] {attr} -> {value}")

# Subscribe to motion on a camera
camera.add_attr_callback("motionDetected", on_event)

# Subscribe to doorbell presses
doorbell.add_attr_callback("ding", on_event)

# Subscribe to all events on a device
camera.add_attr_callback("*", on_event)

👉 See docs/api.md for detailed API documentation and one-shot execution patterns.


Two-Factor Authentication (2FA)

PyArlo supports three primary 2FA methods:

When logging in, Arlo sends a push notification to your trusted mobile device. PyArlo waits for you to tap "Approve".

  • CLI: pyaarlo login --push or export ARLO_TFA="push"
  • Python:
    arlo = await PyArlo.create(username="...", password="...", tfa="push")
    

2. Email via IMAP (email:imap) — Automated

PyArlo connects to your email account over IMAP and automatically reads the verification code from the email sent by Arlo.

  • CLI:
    pyaarlo login --tfa email:imap --tfa-host imap.gmail.com --tfa-user user@gmail.com --tfa-pass "app-password"
    
  • Python:
    arlo = await PyArlo.create(
        username="...", password="...",
        tfa="email:imap",
        tfa_host="imap.gmail.com", tfa_username="...", tfa_password="..."
    )
    

3. Interactive Console (email:console or sms)

PyArlo requests Arlo to send a code via email or SMS, and prompts you to type the code into the terminal.

  • CLI: pyaarlo login --tfa sms or pyaarlo login --tfa email:console
  • Python:
    arlo = await PyArlo.create(username="...", password="...", tfa="sms")
    

Choosing the factor

Arlo calls each 2FA destination a factor: an email address, a phone number, or a phone running the Arlo app. By default PyArlo picks one by matching the tfa type and then tfa_nickname. When the account has several factors of the same type, two phones for example, name the one you want with tfa_factor_id; it wins over both.

  • CLI: pyaarlo tfa-factors lists the ids, then pyaarlo login --factor-id <id> or export ARLO_TFA_FACTOR_ID="<id>"
  • Python:
    for factor in await arlo.tfa_factors():
        print(factor["factorType"], factor["factorNickname"], factor["factorId"])
    
    arlo = await PyArlo.create(username="...", password="...", tfa_factor_id="<id>")
    

The flow follows the factor: a PUSH factor always waits for the approval on the phone, whatever tfa says. PyArlo waits up to 5 minutes for the approval, like the Arlo web app, and stops straight away if you tap deny. Tune it with tfa_push_timeout and tfa_push_poll.

Step by step login for setup screens (ArloLogin)

A setup UI can show the user their real factors and let them choose, instead of asking which 2FA method to use up front. ArloLogin only logs in; it doesn't read devices or start the event stream.

from pyaarlo import ArloLogin, LoginStep

login = ArloLogin(username="...", password="...", storage_dir=STORAGE_DIR)
step = await login.start()
if step == LoginStep.NEEDS_FACTOR:
    step = await login.choose_factor(pick_one(login.factors)["factorId"])
while step == LoginStep.AWAITING_PUSH:
    await asyncio.sleep(login.push_poll)
    step = await login.poll_push()
if step == LoginStep.AWAITING_CODE:
    step = await login.submit_code(input("Code: "))
await login.close()

On SUCCESS the session and cookies are saved in storage_dir and Arlo trusts this "browser". A later PyArlo.create() with the same username, storage_dir and user_agent reuses them and doesn't need 2FA again until the trust expires.

PyArlo keeps presenting the user agent a browser was paired with, as long as the user_agent setting doesn't change, so random no longer throws the trust away on every login.


Operational Notes & Recommendations

Choosing an Event Stream Backend (MQTT vs. SSE)

PyArlo supports two streaming backends for real-time device updates:

  1. MQTT (mqtt) — Default:
    • Modern, lightweight WebSocket protocol used by Arlo's official mobile apps.
    • Supports multiple concurrent connections: you can run pyaarlo-monitor in one terminal while running action commands or scripts in another without interrupting your session.
    • Limitation: Arlo does not publish every legacy event type (such as stream snapshot notifications) over MQTT.
  2. SSE (sse) — Legacy:
    • HTTP Server-Sent Events stream (/subscribe).
    • Emits a broader range of legacy event types (like stream snapshots).
    • Limitation: Arlo restricts SSE to a single active connection per account. Opening a second stream will disconnect the first. You can select it with --backend sse or --sse on pyaarlo-monitor.

Dedicated Arlo Account Recommendation

Even though MQTT allows concurrent event streams with your primary mobile app without immediately logging you out, we strongly recommend creating a separate, dedicated Arlo account and sharing your cameras/devices to it:

  • Security & Least Privilege: Protects your primary account credentials and limits access strictly to the shared devices.
  • Session Stability: Prevents token refresh races and conflicting login state between automation scripts, Home Assistant, and your mobile phone app.

Diagnostics & Error Reporting

Automated Debug Report (--debug-report)

You can append --debug-report to any pyaarlo command. It automatically records all debug logs, anonymizes sensitive tokens/passwords, and encrypts the diagnostic package using PyArlo's public key:

pyaarlo --debug-report light turn-on "Side Light"
pyaarlo --debug-report login

This writes pyaarlo-debug-report.enc, which you can safely attach directly to a GitHub Issue.

Enabling Verbose Logs

Pass -v (INFO) or -vv (DEBUG) to any CLI tool, or enable debug logging in Python:

import logging
logging.basicConfig(level=logging.DEBUG)

Anonymizing & Encrypting Diagnostics for Issues

To safely report bugs without exposing personal credentials, device IDs, or tokens:

# Anonymize account identifiers and encrypt using PyArlo's public key
cat trace.log | pyaarlo-utils anonymize | pyaarlo-utils encrypt > trace.log.enc

You can paste the resulting -----BEGIN PYAARLO DUMP----- block directly into a GitHub Issue. Only the repository maintainers holding the private key can decrypt it.

Recording Browser Traffic (.har)

If troubleshooting unexpected Arlo web changes:

  1. Open my.arlo.com in Chrome/Firefox.
  2. Open Developer Tools (F12), switch to the Network tab, and check Preserve log.
  3. Perform the action (e.g. view stream, arm device, toggle light).
  4. Right-click any network request and select Save all as HAR with content.
  5. Anonymize and encrypt the .har file using pyaarlo-utils before sharing.


Credits

Special thanks to:

  • Edwin Anne for reverse-engineering the SIP/WebRTC signaling protocol and contributing the foundational SDP repairs and SIP client (PR #210).
  • Pyarlo and Arlo for the original foundational reverse-engineering work.
  • JetBrains for their past support providing open source development licenses throughout most of the v0.8 releases.

Metadata

Release files for pyaarlo 0.9.0b5

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

Source distribution (sdist)

Source distribution for pyaarlo 0.9.0b5
File Size Uploaded Provenance Actions
pyaarlo-0.9.0b5.tar.gz 201.3 kB Without provenance Details for pyaarlo-0.9.0b5.tar.gz

Built distribution (wheel)

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

Total release size: 370.2 kB

Release files / pyaarlo-0.9.0b5.tar.gz

Download URL pyaarlo-0.9.0b5.tar.gz
Size 201.3 kB
Tags Source
SHA-256 checksum
How to use checksums
9a1b5879b9f9e2a2675c7bb20bc27049ee31a90d285382cd8ab65b052476e03d
BLAKE2b-256 checksum
How to use checksums
e9d06e991b1d4925b5f33117fe2dfacdb5c58e71d9f1af54b28e2a2ca0eb00bf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.18

Release files / pyaarlo-0.9.0b5-py3-none-any.whl

Download URL pyaarlo-0.9.0b5-py3-none-any.whl
Size 168.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
81a91fa796cef72b08133a847a44750a0e247e1f76182561408cb021d5725aa5
BLAKE2b-256 checksum
How to use checksums
6b2c86bdd10899cb92dd9a24621047aadd63c4e3a6ce8bbcdf7530cbfc75d269
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.18

Security for pyaarlo 0.9.0b5

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
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