### Install Pyaarlo via PIP Source: https://github.com/twrecked/pyaarlo/blob/master/README.md Installs the latest version of Pyaarlo directly from the GitHub repository. ```bash pip install git+https://github.com/twrecked/pyaarlo ``` -------------------------------- ### Get Snapshot and Save Source: https://context7.com/twrecked/pyaarlo/llms.txt Retrieve a snapshot from the camera, waiting for completion up to a timeout, and save it to a local file. ```python # Get snapshot (blocking, waits for completion) snapshot_data = camera.get_snapshot(timeout=60) with open('snapshot.jpg', 'wb') as f: f.write(snapshot_data) ``` -------------------------------- ### Initialize PyArlo and Get Camera Info Source: https://context7.com/twrecked/pyaarlo/llms.txt Connect to Arlo services using provided credentials and retrieve basic information about the first camera. Ensure 'pyaarlo' and 'time' are imported. ```python import pyaarlo import time arlo = pyaarlo.PyArlo( username='your-email@example.com', password='your-password', tfa_type='SMS', tfa_source='console' ) camera = arlo.cameras[0] # Get camera state and properties print(f"Camera: {camera.name}") print(f"State: {camera.state}") # 'idle', 'streaming', 'recording', etc. print(f"Is on: {camera.is_on}") print(f"Battery: {camera.battery_level}%") print(f"Signal strength: {camera.signal_strength}") ``` -------------------------------- ### Control Base Station Modes Source: https://context7.com/twrecked/pyaarlo/llms.txt Manage base station modes such as armed, disarmed, and custom modes. This example demonstrates how to get the current mode, list available modes, and retrieve their corresponding Arlo IDs. Ensure synchronous mode is enabled for immediate changes. ```python import pyaarlo import time arlo = pyaarlo.PyArlo( username='your-email@example.com', password='your-password', tfa_type='SMS', tfa_source='console', synchronous_mode=True # Enable for immediate mode changes ) base = arlo.base_stations[0] # Get current mode print(f"Current mode: {base.mode}") # e.g., 'disarmed', 'armed' # List available modes print(f"Available modes: {base.available_modes}") # Output: ['disarmed', 'armed', 'schedule', 'home'] # Get modes with their Arlo IDs print(f"Modes with IDs: {base.available_modes_with_ids}") # Output: {'armed': 'mode1', 'disarmed': 'mode0', 'home': 'mode2'} ``` -------------------------------- ### Get Live Stream URL Source: https://context7.com/twrecked/pyaarlo/llms.txt Obtain the RTSP URL for the camera's live stream. This is a prerequisite for starting recordings. ```python stream_url = camera.get_stream() # Returns rtsps:// URL print(f"Stream URL: {stream_url}") ``` -------------------------------- ### Start and Stop Recording Source: https://context7.com/twrecked/pyaarlo/llms.txt Initiate a video recording for a specified duration and then stop it. Requires an active stream. ```python # Start recording (requires active stream) stream_url = camera.start_stream() if stream_url: recording_url = camera.start_recording(duration=30) # Record for 30 seconds print(f"Recording started") time.sleep(35) camera.stop_recording() ``` -------------------------------- ### Registering with PyArlo TFA Helper Server Source: https://github.com/twrecked/pyaarlo/blob/master/README.md Example JSON response after registering with the PyArlo TFA helper server, containing the email, forward-to address, success status, and a token. ```json {"email":"testing@testing.com", "fwd-to":"pyaarlo@thewardrobe.ca", "success":true, "token":"4f529ea4dd20ca65e102e743e7f18914bcf8e596b909c02d"} ``` -------------------------------- ### GET /get Source: https://github.com/twrecked/pyaarlo/blob/master/README.md Retrieves the current TFA code from the server. ```APIDOC ## GET /get ### Description Retrieves the current TFA code stored on the server. ### Method GET ### Endpoint /get ### Parameters #### Query Parameters - **email** (string) - Required - The email address or unique ID associated with the account. - **token** (string) - Required - The authentication token provided during registration. ### Response #### Success Response (200) - **meta** (object) - Response metadata containing the status code. - **data** (object) - Contains the success status, email, code, and timestamp. #### Response Example { "meta": { "code": 200 }, "data": { "success": true, "email": "test@test.com", "code": "123456", "timestamp": "123445666" } } ``` -------------------------------- ### Get Base Station Handle Source: https://github.com/twrecked/pyaarlo/blob/master/README.md Retrieves the first base station from the list of available base stations. ```python # get base station handle # assuming only 1 base station is available base = arlo.base_stations[0] ``` -------------------------------- ### GET /add Source: https://github.com/twrecked/pyaarlo/blob/master/README.md Adds a new TFA code or message to the server. ```APIDOC ## GET /add ### Description Adds a new TFA code or a message containing a code to the server. ### Method GET ### Endpoint /add ### Parameters #### Query Parameters - **email** (string) - Required - The email address or unique ID associated with the account. - **token** (string) - Required - The authentication token provided during registration. - **code** (string) - Optional - The TFA code to store. - **msg** (string) - Optional - A message string from which the server will attempt to parse the code. ### Response #### Success Response (200) - **success** (boolean) - Indicates if the operation was successful. ``` -------------------------------- ### Get Camera Brightness Source: https://github.com/twrecked/pyaarlo/blob/master/README.md Retrieve the current brightness setting of a camera using the 'brightness' attribute. ```python # get brightness value of camera cam.brightness ``` -------------------------------- ### List All Cameras Source: https://github.com/twrecked/pyaarlo/blob/master/README.md Access the 'cameras' attribute to get a list of all Arlo cameras associated with the account. ```python # listing all cameras arlo.cameras ``` -------------------------------- ### Postfix Email Forwarding Alias Source: https://github.com/twrecked/pyaarlo/blob/master/README.md Example configuration for a postfix server to forward Arlo code messages to a script that processes them for PyArlo. ```text pyaarlo: "|/home/test/bin/pyaarlo-fwd" ``` -------------------------------- ### HTTP GET Request to Add TFA Code via Helper Server Source: https://github.com/twrecked/pyaarlo/blob/master/README.md Use this HTTP GET request to add a TFA code to the PyArlo helper server. The 'code' parameter can be replaced with 'msg' to parse the code from a message. ```http request https://custom-host/add?email=test@test.com&token=4f529ea4dd20ca65e102e743e7f18914bcf8e596b909c02d&code=123456 ``` -------------------------------- ### HTTP GET Request to Retrieve TFA Code Source: https://github.com/twrecked/pyaarlo/blob/master/README.md This HTTP GET request is used by PyArlo to look up the current TFA code from the custom host. ```http request https://custom-host/get?email=test@test.com&token=1234567890 ``` -------------------------------- ### Get Current Base Station Mode Source: https://github.com/twrecked/pyaarlo/blob/master/README.md Access the 'mode' attribute of a base station object to get its current operational mode. ```python # get the current base station mode base.mode # 'disarmed' ``` -------------------------------- ### GET /clear Source: https://github.com/twrecked/pyaarlo/blob/master/README.md Clears the current TFA code from the server. ```APIDOC ## GET /clear ### Description Clears the current TFA code stored on the server. ### Method GET ### Endpoint /clear ### Parameters #### Query Parameters - **email** (string) - Required - The email address or unique ID associated with the account. - **token** (string) - Required - The authentication token provided during registration. ### Response #### Success Response (200) - **meta** (object) - Response metadata containing the status code. - **data** (object) - Success confirmation and email address. #### Response Example { "meta": { "code": 200 }, "data": { "success": true, "email": "test@test.com" } } ``` -------------------------------- ### HTTP GET Request to Clear TFA Code Source: https://github.com/twrecked/pyaarlo/blob/master/README.md This HTTP GET request is used by PyArlo to clear the current TFA code from the custom host. ```http request https://custom-host/clear?email=test@test.com&token=1234567890 ``` -------------------------------- ### List Arlo Devices Source: https://github.com/twrecked/pyaarlo/blob/master/README.md Access the 'devices' attribute to get a list of all Arlo devices connected to the account. ```python # listing devices arlo.devices ``` -------------------------------- ### Asynchronous Mode Caveat Source: https://github.com/twrecked/pyaarlo/blob/master/README.md Example of code that may fail due to the asynchronous nature of Pyaarlo, where state updates are not instantaneous. ```python base.mode = 'armed' if base.mode == 'armed': print('it worked!') ``` -------------------------------- ### Get Multiple Recent Videos Source: https://context7.com/twrecked/pyaarlo/llms.txt Retrieve a specified number of the most recent recorded videos for a camera and iterate through their details. ```python # Get multiple recent videos recent_videos = camera.last_n_videos(5) for video in recent_videos: print(f"{video.created_at_pretty()} - {video.video_url}") ``` -------------------------------- ### Encrypt File with Pyaarlo-Encrypt Script Source: https://github.com/twrecked/pyaarlo/blob/master/README.md Encrypt an existing file using the pyaarlo-encrypt shell script, typically found in the bin directory after a git installation. This method does not support anonymization. ```bash cat output-file | ./bin/pyaarlo-encrypt encrypt ``` -------------------------------- ### Get Video Library Statistics Source: https://context7.com/twrecked/pyaarlo/llms.txt Retrieve statistics about recorded videos for a specific camera, such as unseen videos, captures today, and the timestamp of the last capture. ```python # Get video statistics print(f"Unseen videos: {camera.unseen_videos}") print(f"Captured today: {camera.captured_today}") print(f"Last capture: {camera.last_capture}") ``` -------------------------------- ### Get Videos for Specific Camera Source: https://context7.com/twrecked/pyaarlo/llms.txt Filter the Arlo media library to retrieve only the videos associated with a particular camera. Returns a count and a list of video objects. ```python # Get videos for specific camera count, camera_videos = arlo.ml.videos_for(camera) print(f"Videos for {camera.name}: {len(camera_videos)}") ``` -------------------------------- ### Get Last Cached Image Source: https://context7.com/twrecked/pyaarlo/llms.txt Access the most recently cached image from the camera and check its source. This does not capture a new image. ```python # Get last image from cache last_image = camera.last_image_from_cache print(f"Image source: {camera.last_image_source}") ``` -------------------------------- ### Success Response for Retrieving TFA Code Source: https://github.com/twrecked/pyaarlo/blob/master/README.md A successful response from the custom TFA host after a get request, containing the TFA code and timestamp. ```json { "meta": { "code": 200 }, "data": { "success": True, "email": "test@test.com", "code": "123456", "timestamp": "123445666" } } ``` -------------------------------- ### Register Callbacks and Monitor Events Source: https://github.com/twrecked/pyaarlo/blob/master/README.md Demonstrates logging in, registering attribute change callbacks for base stations and cameras, and performing basic mode switching. ```python # code to trap when attributes change def attribute_changed(device, attr, value): print('attribute_changed', time.strftime("%H:%M:%S"), device.name + ':' + attr + ':' + str(value)[:80]) # login, use console for 2FA if needed arlo = pyaarlo.PyArlo( username=USERNAME,password=PASSWORD, tfa_type='SMS',tfa_source='console') # get base stations, list their statuses, register state change callbacks for base in arlo.base_stations: print("base: name={},device_id={},state={}".format(base.name,base.device_id,base.state)) base.add_attr_callback('*', attribute_changed) # get cameras, list their statuses, register state change callbacks # * is any callback, you can use motionDetected just to get motion events for camera in arlo.cameras: print("camera: name={},device_id={},state={}".format(camera.name,camera.device_id,camera.state)) camera.add_attr_callback('*', attribute_changed) # disarm then arm the first base station base = arlo.base_stations[0] base.mode = 'disarmed' time.sleep(5) base.mode = 'armed' # wait 10 minutes, try moving in front of a camera to see motionDetected events time.sleep(600) ``` -------------------------------- ### Initialize PyArlo with Library Access Source: https://context7.com/twrecked/pyaarlo/llms.txt Connect to Arlo services and configure the library to load recordings from the last specified number of days. Requires 'pyaarlo' import. ```python import pyaarlo arlo = pyaarlo.PyArlo( username='your-email@example.com', password='your-password', tfa_type='SMS', tfa_source='console', library_days=7 # Load last 7 days of recordings ) camera = arlo.cameras[0] ``` -------------------------------- ### Initialize PyArlo with Basic Login Source: https://context7.com/twrecked/pyaarlo/llms.txt Instantiate the PyArlo class for basic login, supporting two-factor authentication via console input. Ensure connection status is checked after initialization. ```python import pyaarlo import time # Basic login with 2FA via console arlo = pyaarlo.PyArlo( username='your-email@example.com', password='your-password', tfa_type='EMAIL', # or 'SMS' tfa_source='console' ) # Check connection status if not arlo.is_connected: print(f"Failed to login: {arlo.last_error}") exit(1) # Access all device types print(f"Base Stations: {len(arlo.base_stations)}") print(f"Cameras: {len(arlo.cameras)}") print(f"Doorbells: {len(arlo.doorbells)}") print(f"Lights: {len(arlo.lights)}") # Lookup devices by name or ID camera = arlo.lookup_camera_by_name("Front Door") base = arlo.lookup_base_station_by_id("ABC123456") # Advanced configuration options arlo = pyaarlo.PyArlo( username='your-email@example.com', password='your-password', tfa_type='EMAIL', tfa_source='imap', tfa_host='imap.gmail.com', tfa_username='your-email@gmail.com', tfa_password='app-specific-password', synchronous_mode=True, # Wait for operations to complete library_days=7, # Days of recordings to load save_state=True, # Persist device state storage_dir='/path/to/storage', refresh_devices_every=3, # Hours between device refresh stream_timeout=180, # Seconds before stream timeout save_media_to='/path/to/media/${SN}/${Y}/${m}/${d}/${t}' # Auto-download media ) # Clean shutdown arlo.stop(logout=True) ``` -------------------------------- ### Configure Camera Spotlight and Floodlight Source: https://context7.com/twrecked/pyaarlo/llms.txt Provides methods for controlling integrated lighting features including spotlights, floodlights, and nightlights with color/temperature settings. ```python import pyaarlo arlo = pyaarlo.PyArlo( username='your-email@example.com', password='your-password', tfa_type='SMS', tfa_source='console' ) camera = arlo.cameras[0] # Spotlight control (Pro 3, Pro 4, Essential Spotlight, etc.) camera.set_spotlight_on() camera.set_spotlight_brightness(200) # 0-255 scale camera.set_spotlight_off() # Floodlight control (Pro 3 Floodlight) camera.floodlight_on() camera.set_floodlight_brightness(255) # 0-255 scale camera.floodlight_off() # Nightlight control (Baby camera) camera.nightlight_on() camera.set_nightlight_brightness(128) # 0-255 # Set nightlight color modes camera.set_nightlight_rgb(red=255, green=128, blue=0) # Orange camera.set_nightlight_color_temperature(3000) # Warm white (Kelvin) camera.set_nightlight_mode('rainbow') # 'rgb', 'temperature', or 'rainbow' camera.nightlight_off() ``` -------------------------------- ### Configure Two-Factor Authentication Source: https://context7.com/twrecked/pyaarlo/llms.txt Implement 2FA using console input, IMAP email, or a custom REST API server. ```python import pyaarlo # Method 1: Manual console input (simplest) arlo = pyaarlo.PyArlo( username='your-email@example.com', password='your-password', tfa_type='SMS', # or 'EMAIL' tfa_source='console' ) # Method 2: IMAP email (recommended for automation) arlo = pyaarlo.PyArlo( username='your-email@example.com', password='your-password', tfa_type='EMAIL', tfa_source='imap', tfa_host='imap.gmail.com', # or 'imap.gmail.com:993' tfa_username='your-email@gmail.com', tfa_password='your-app-specific-password', tfa_timeout=10, # Seconds between checks tfa_total_timeout=120 # Total wait time ) # Method 2b: IMAP with specific email address for 2FA arlo = pyaarlo.PyArlo( username='your-email@example.com', password='your-password', tfa_type='EMAIL', tfa_source='imap', tfa_host='imap.gmail.com', tfa_username='your-email@gmail.com', tfa_password='your-app-specific-password', tfa_nickname='specific-email@example.com' # For multiple emails ) # Method 3: REST API (for custom TFA server) arlo = pyaarlo.PyArlo( username='your-email@example.com', password='your-password', tfa_type='EMAIL', # or 'SMS' tfa_source='rest-api', tfa_host='pyaarlo-tfa.appspot.com', # or your custom server tfa_username='your-email@example.com', tfa_password='your-api-token' ) # REST API endpoints expected by PyAarlo: # Clear: GET https://host/clear?email=EMAIL&token=TOKEN # Get: GET https://host/get?email=EMAIL&token=TOKEN # Response: {"meta": {"code": 200}, "data": {"success": true, "code": "123456"}} ``` -------------------------------- ### Show Pyaarlo Actions Source: https://github.com/twrecked/pyaarlo/blob/master/README.md Use this command to display all available actions for the pyaarlo executable. ```bash pyaarlo --help ``` -------------------------------- ### Initialize Arlo Camera Audio Control Source: https://context7.com/twrecked/pyaarlo/llms.txt Initializes the PyArlo client for accessing camera audio playback features. ```python import pyaarlo arlo = pyaarlo.PyArlo( username='your-email@example.com', password='your-password', tfa_type='SMS', tfa_source='console' ) ``` -------------------------------- ### Initialize PyArlo with 2FA and Synchronous Mode Source: https://github.com/twrecked/pyaarlo/blob/master/README.md Initializes the PyArlo client with username, password, 2FA type and source, and enables synchronous mode for compatibility. ```python arlo = pyaarlo.PyArlo( username=USERNAME,password=PASSWORD, tfa_type='SMS',tfa_source='console',synchronous_mode=True) ``` -------------------------------- ### Initialize Pyaarlo in Synchronous Mode Source: https://github.com/twrecked/pyaarlo/blob/master/README.md Initializes the PyArlo client with synchronous mode enabled, requiring explicit configuration during startup. ```python # login, use console for 2FA if needed arlo = pyaarlo.PyArlo( username=USERNAME,password=PASSWORD, tfa_type='SMS',tfa_source='console', synchronous_mode=True) ``` -------------------------------- ### Control Arlo Lights and Motion Detection Source: https://context7.com/twrecked/pyaarlo/llms.txt Shows how to toggle light power, adjust brightness levels, and register callbacks for motion detection events. ```python import pyaarlo import time arlo = pyaarlo.PyArlo( username='your-email@example.com', password='your-password', tfa_type='SMS', tfa_source='console' ) for light in arlo.lights: print(f"Light: {light.name}") print(f"Device ID: {light.device_id}") print(f"State: {light.state}") print(f"Is on: {light.is_on}") print(f"Battery: {light.battery_level}%") # Turn light on light.turn_on() time.sleep(2) # Turn on with specific brightness (0-255) light.turn_on(brightness=200) time.sleep(2) # Adjust brightness while on (must turn off and on again) light.set_brightness(128) light.turn_off() light.turn_on() time.sleep(2) # Turn light off light.turn_off() # Monitor motion detection on lights def on_light_motion(device, attr, value): if attr == 'motionDetected' and value: print(f"Motion detected by {device.name}") for light in arlo.lights: light.add_attr_callback('motionDetected', on_light_motion) time.sleep(600) ``` -------------------------------- ### Initialize PyArlo with Manual 2FA Source: https://github.com/twrecked/pyaarlo/blob/master/README.md Initializes PyArlo, prompting the user for 2FA codes via the console when needed. ```python ar = pyaarlo.PyArlo(username=USERNAME, password=PASSWORD, tfa_source='console', tfa_type='SMS') ``` -------------------------------- ### Initialize PyArlo with IMAP 2FA and Nickname Source: https://github.com/twrecked/pyaarlo/blob/master/README.md Initializes PyArlo with IMAP support for 2FA, specifying a nickname to ensure the correct email account is used. ```python ar = pyaarlo.PyArlo(username=USERNAME, password=PASSWORD, tfa_source='imap',tfa_type='email', tfa_host='imap.host.com', tfa_username='your-user-name', tfa_password='your-imap-password', tfa_nickname='your-user-name@your-domain.com' ) ``` -------------------------------- ### List Pyaarlo Devices Source: https://github.com/twrecked/pyaarlo/blob/master/README.md List all known devices by providing your username and password. This command is used for device management. ```bash pyaarlo -u 'your-user-name' -p 'your-password' list all ``` -------------------------------- ### Initialize PyArlo with IMAP 2FA Source: https://github.com/twrecked/pyaarlo/blob/master/README.md Initializes PyArlo with IMAP support for automatic 2FA code retrieval from email. ```python ar = pyaarlo.PyArlo(username=USERNAME, password=PASSWORD, tfa_source='imap',tfa_type='email', tfa_host='imap.host.com', tfa_username='your-user-name', tfa_password='your-imap-password' ) ``` -------------------------------- ### CLI Device Management and Log Encryption Source: https://context7.com/twrecked/pyaarlo/llms.txt Use the command-line interface to list devices, anonymize data, and encrypt debug logs. ```bash # Install PyAarlo pip install git+https://github.com/twrecked/pyaarlo # Show available commands pyaarlo --help # List all devices pyaarlo -u 'your-email@example.com' -p 'your-password' list all # List with anonymized output (for sharing logs) pyaarlo -u 'your-email@example.com' -p 'your-password' --anonymize list all # Anonymize and encrypt output pyaarlo -u 'your-email@example.com' -p 'your-password' --anonymize --encrypt list all # Encrypt an existing log file cat debug.log | pyaarlo encrypt # Anonymize then encrypt a log file cat debug.log | pyaarlo -u 'your-email@example.com' -p 'your-password' anonymize | pyaarlo encrypt # Alternative encryption using included script cat debug.log | ./bin/pyaarlo-encrypt encrypt ``` -------------------------------- ### Initialize PyArlo with IMAP 2FA and Custom Port Source: https://github.com/twrecked/pyaarlo/blob/master/README.md Initializes PyArlo with IMAP support for 2FA, specifying a custom port for the IMAP host. ```python ar = pyaarlo.PyArlo(username=USERNAME, password=PASSWORD, tfa_source='imap',tfa_type='email', tfa_host='imap.host.com:1234', tfa_username='your-user-name', tfa_password='your-imap-password' ) ``` -------------------------------- ### Configure Media Saving with File Naming Scheme Source: https://github.com/twrecked/pyaarlo/blob/master/README.md Specifies a file naming scheme for saving media locally using substitutions for device and date information. ```yaml save_media_to: "/config/media/${SN}/${Y}/${m}/${d}/${T}" ``` -------------------------------- ### Register Event Callbacks for Real-time Monitoring Source: https://context7.com/twrecked/pyaarlo/llms.txt Set up callback functions to receive real-time notifications for device attribute changes, such as motion detection. Callbacks can be registered for all attributes or specific events on different device types. ```python import pyaarlo import time def attribute_changed(device, attr, value): """Callback function triggered on any attribute change.""" print(f"{time.strftime('%H:%M:%S')} {device.name}: {attr} = {value}") def motion_detected(device, attr, value): """Callback specifically for motion events.""" if value: print(f"Motion detected on {device.name}!") else: print(f"Motion stopped on {device.name}") # Login arlo = pyaarlo.PyArlo( username='your-email@example.com', password='your-password', tfa_type='SMS', tfa_source='console' ) # Register callbacks for all attributes on all devices for base in arlo.base_stations: base.add_attr_callback('*', attribute_changed) for camera in arlo.cameras: # Listen to all events camera.add_attr_callback('*', attribute_changed) # Or listen to specific events camera.add_attr_callback('motionDetected', motion_detected) camera.add_attr_callback('audioDetected', attribute_changed) for doorbell in arlo.doorbells: doorbell.add_attr_callback('buttonPressed', attribute_changed) doorbell.add_attr_callback('*', attribute_changed) for light in arlo.lights: light.add_attr_callback('*', attribute_changed) # Keep running to receive events print("Monitoring... Press Ctrl+C to stop") time.sleep(3600) # Monitor for 1 hour ``` -------------------------------- ### Manage Arlo Doorbell Operations Source: https://context7.com/twrecked/pyaarlo/llms.txt Demonstrates registering button press callbacks, managing silent modes, and triggering sirens on supported doorbell models. ```python import pyaarlo import time def on_button_press(device, attr, value): if value: print(f"Doorbell {device.name} was pressed!") arlo = pyaarlo.PyArlo( username='your-email@example.com', password='your-password', tfa_type='SMS', tfa_source='console' ) for doorbell in arlo.doorbells: print(f"Doorbell: {doorbell.name}") print(f"Device ID: {doorbell.device_id}") print(f"State: {doorbell.state}") print(f"Is video doorbell: {doorbell.is_video_doorbell}") # Register for button press events doorbell.add_attr_callback('buttonPressed', on_button_press) # Silent mode controls print(f"Is silenced: {doorbell.is_silenced}") print(f"Calls silenced: {doorbell.calls_are_silenced}") print(f"Chimes silenced: {doorbell.chimes_are_silenced}") # Enable silent mode (silence both calls and chimes) doorbell.silence_on() time.sleep(5) # Silence only chimes doorbell.silence_chimes() # Silence only calls doorbell.silence_calls() # Disable silent mode doorbell.silence_off() # Siren control (for supported models) if doorbell.siren_state == 'off': doorbell.siren_on(duration=10, volume=5) time.sleep(5) doorbell.siren_off() # Monitor doorbell events time.sleep(600) ``` -------------------------------- ### Initialize PyArlo with REST API Source: https://github.com/twrecked/pyaarlo/blob/master/README.md Configure PyArlo to use a custom REST API for TFA. Specify the TFA source, type, host, and credentials for the custom API. ```python ar = pyaarlo.PyArlo(username=USERNAME, password=PASSWORD, tfa_source='rest-api',tfa_type='email', tfa_host='custom-host', tfa_username='test@test.com', tfa_password='1234567890' ) ``` -------------------------------- ### List Available Base Station Modes Source: https://github.com/twrecked/pyaarlo/blob/master/README.md Access the 'available_modes' attribute of a base station object to see all possible modes. ```python # listing Arlo modes base.available_modes # ['armed', 'disarmed', 'schedule', 'custom'] ``` -------------------------------- ### Request Snapshot Source: https://context7.com/twrecked/pyaarlo/llms.txt Asynchronously request a snapshot from the camera. This call does not wait for the image to be captured. ```python # Request snapshot (non-blocking) camera.request_snapshot() ``` -------------------------------- ### Update Media Library Source: https://context7.com/twrecked/pyaarlo/llms.txt Manually trigger an update for the camera's media library and the last captured image. The 'wait=True' parameter ensures the operation completes before proceeding. ```python # Update media library manually camera.update_media(wait=True) camera.update_last_image(wait=True) ``` -------------------------------- ### Change Base Station Mode Source: https://context7.com/twrecked/pyaarlo/llms.txt Set the base station's operational mode. Ensure to include necessary imports like 'time'. ```python base.mode = 'armed' time.sleep(2) print(f"New mode: {base.mode}") base.mode = 'disarmed' ``` -------------------------------- ### Control Baby Camera Features Source: https://context7.com/twrecked/pyaarlo/llms.txt Manage playback, volume, and ambient sensors for Arlo baby cameras. ```python for camera in arlo.cameras: if camera.model_id.startswith('ABC1000'): # Baby camera model # Get current playback status camera.get_audio_playback_status() # Play a specific track camera.play_track(track_id='lullaby_01', position=0) # Resume current track camera.play_track() # Pause playback camera.pause_track() # Navigation camera.next_track() camera.previous_track() # Playback modes camera.set_music_loop_mode_continuous() # Repeat playlist camera.set_music_loop_mode_single() # Repeat current track camera.set_shuffle(True) # Enable shuffle # Volume control camera.set_volume(mute=False, volume=50) # Volume 0-100 camera.set_volume(mute=True, volume=50) # Mute # Ambient sensor readings (Baby camera) camera.update_ambient_sensors() # Access via callbacks or attributes: # temperature, humidity, airQuality ``` -------------------------------- ### Turn Camera On/Off Source: https://context7.com/twrecked/pyaarlo/llms.txt Control the power state of an Arlo camera. Includes a short delay between actions. ```python camera.turn_off() time.sleep(2) camera.turn_on() ``` -------------------------------- ### IFTTT Webhook Configuration for TFA Codes Source: https://github.com/twrecked/pyaarlo/blob/master/README.md Configure an IFTTT 'Make a web request' action to forward SMS codes to the PyArlo helper server. Ensure the URL, method, and content type are set correctly. ```text URL: https://pyaarlo-tfa.appspot.com/add?email=test@test.com&token=4f529ea4dd20ca65e102e743e7f18914bcf8e596b909c02d&msg={{Text}} Method: GET Content Type: text/plain ``` -------------------------------- ### Subscription Reply Packet Source: https://github.com/twrecked/pyaarlo/blob/master/docs/packets.md Received approximately once per minute for devices requiring subscription updates. ```json { "action": "is", "from": "XXXXXXXXXXXXX", "properties": {"devices": ["XXXXXXXXXXXXX"]}, "resource": "subscriptions/XXXXXXXXXXXXX24993_web", "to": "XXXXXXXXXXXXX24993_web", "transId": "web!33c2027d-9b96-4a9f-9b41-aaf412082e80"} ``` -------------------------------- ### Check Camera Connection Status Source: https://github.com/twrecked/pyaarlo/blob/master/README.md Use the 'is_camera_connected' attribute to determine if a camera is currently connected to its base station. ```python # check if camera is connected to base station cam.is_camera_connected # True ``` -------------------------------- ### Access and Download Last Video Source: https://context7.com/twrecked/pyaarlo/llms.txt Retrieve details of the most recent recorded video, including its URL, thumbnail, creation time, duration, and trigger event. Allows downloading the video and thumbnail. ```python # Get the last video last_video = camera.last_video if last_video: print(f"Video URL: {last_video.video_url}") print(f"Thumbnail: {last_video.thumbnail_url}") print(f"Created: {last_video.created_at_pretty()}") print(f"Duration: {last_video.media_duration_seconds} seconds") print(f"Triggered by: {last_video.triggered_by}") print(f"Object type: {last_video.object_type}") # 'person', 'vehicle', 'animal', 'other' # Download the video last_video.download_video('/path/to/video.mp4') # Download thumbnail last_video.download_thumbnail('/path/to/thumbnail.jpg') ``` -------------------------------- ### Encrypt File with Pyaarlo Source: https://github.com/twrecked/pyaarlo/blob/master/README.md Encrypt an existing file using the pyaarlo executable. This is useful for securing log files or other sensitive data. ```bash cat output-file | pyaarlo encrypt ``` -------------------------------- ### Subscription Reply Packet Source: https://github.com/twrecked/pyaarlo/blob/master/docs/packets.md Packet received approximately once a minute for devices requiring subscription updates. ```APIDOC ## Subscription Reply Packet ### Description This is a subscription reply packet received periodically for devices that require them. ### Response Example { "action": "is", "from": "XXXXXXXXXXXXX", "properties": {"devices": ["XXXXXXXXXXXXX"]}, "resource": "subscriptions/XXXXXXXXXXXXX24993_web", "to": "XXXXXXXXXXXXX24993_web", "transId": "web!33c2027d-9b96-4a9f-9b41-aaf412082e80" } ``` -------------------------------- ### Restart Base Station Source: https://context7.com/twrecked/pyaarlo/llms.txt Initiate a restart of the Arlo base station. This action requires the 'base' object to be available. ```python base.restart() ``` -------------------------------- ### Stop Live Stream Source: https://context7.com/twrecked/pyaarlo/llms.txt Terminate the active live stream for the camera. ```python camera.stop_stream() ``` -------------------------------- ### Access All Videos Directly Source: https://context7.com/twrecked/pyaarlo/llms.txt Retrieve all videos stored in the Arlo media library directly from the Arlo object. Returns a count and a list of video objects. ```python # Access media library directly count, all_videos = arlo.ml.videos print(f"Total videos in library: {len(all_videos)}") ``` -------------------------------- ### Access Last Video URLs Source: https://context7.com/twrecked/pyaarlo/llms.txt Directly access the URLs for the last recorded video and its thumbnail from the camera object. ```python # Access video properties print(f"Last video URL: {camera.last_video_url}") print(f"Last thumbnail URL: {camera.last_video_thumbnail_url}") ``` -------------------------------- ### Print Camera Attributes Source: https://github.com/twrecked/pyaarlo/blob/master/README.md Access various attributes of a camera object to retrieve information such as serial number, model ID, and unseen videos. ```python # printing camera attributes cam.serial_number cam.model_id cam.unseen_videos ``` -------------------------------- ### Anonymize and Encrypt File with Pyaarlo Source: https://github.com/twrecked/pyaarlo/blob/master/README.md Anonymize and then encrypt a file using the pyaarlo executable. This command requires user credentials for anonymization. ```bash cat output-file | pyaarlo -u 'your-user-name' -p 'your-password' anonymize | pyaarlo encrypt ``` -------------------------------- ### Check Base Station Schedule Status Source: https://context7.com/twrecked/pyaarlo/llms.txt Retrieve information about whether the base station is currently running a schedule and its name. This assumes 'base' object is already initialized. ```python print(f"On schedule: {base.on_schedule}") print(f"Schedule name: {base.schedule}") ``` -------------------------------- ### Device Activity Update Packet Source: https://github.com/twrecked/pyaarlo/blob/master/docs/packets.md Contains updates from individual devices regarding events such as motion, sound, or temperature changes. ```json { "action": "is", "from": "XXXXXXXXXXXXX", "properties": {"motionDetected": "True"}, "resource": "cameras/XXXXXXXXXXXXX", "transId": "XXXXXXXXXXXXX!c87fdfa6!1675735611287"} ``` -------------------------------- ### Wait for Active Stream Source: https://context7.com/twrecked/pyaarlo/llms.txt Poll the camera to determine if the user stream is active, with a specified timeout. Useful after initiating a stream. ```python # Wait for stream to become active if camera.wait_for_user_stream(timeout=15): print("Stream is active") ``` -------------------------------- ### Device Activity Update Packet Source: https://github.com/twrecked/pyaarlo/blob/master/docs/packets.md Packet containing updates from individual devices regarding activity such as motion, sound, or temperature changes. ```APIDOC ## Device Activity Update Packet ### Description Updates from individual devices indicating activity such as motion detection, sound, or temperature changes. ### Response Example { "action": "is", "from": "XXXXXXXXXXXXX", "properties": {"motionDetected": "True"}, "resource": "cameras/XXXXXXXXXXXXX", "transId": "XXXXXXXXXXXXX!c87fdfa6!1675735611287" } ``` -------------------------------- ### Update Base Station Mode Source: https://github.com/twrecked/pyaarlo/blob/master/README.md Set the 'mode' attribute of a base station object to change its operational mode. ```python # Updating the base station mode base.mode = 'custom' ``` -------------------------------- ### Failure Response from TFA Server Source: https://github.com/twrecked/pyaarlo/blob/master/README.md A failure response from the custom TFA host, indicated by a non-200 status code. ```json { "meta": { "code": 400 }, "data": { "success": False, "error": "permission denied" }} ``` -------------------------------- ### Adjust Camera Brightness Source: https://context7.com/twrecked/pyaarlo/llms.txt Modify the camera's brightness setting. The valid range for brightness is typically -2 to 2. ```python # Adjust camera settings camera.brightness = 1 # Range: -2 to 2 ``` -------------------------------- ### Success Response for Clearing TFA Code Source: https://github.com/twrecked/pyaarlo/blob/master/README.md A successful response from the custom TFA host after a clear request. ```json { "meta": { "code": 200 }, "data": { "success": True, "email": "test@test.com" } } ``` -------------------------------- ### Control Camera Siren Source: https://context7.com/twrecked/pyaarlo/llms.txt Activate and deactivate the siren on the camera itself, specifying duration and volume. ```python # Control camera siren (if supported) camera.siren_on(duration=10, volume=5) time.sleep(5) camera.siren_off() ``` -------------------------------- ### Control Base Station Siren Source: https://context7.com/twrecked/pyaarlo/llms.txt Activate and deactivate the base station's siren if the hardware supports it. Specify duration in seconds and volume level. ```python if base.siren_state == 'off': base.siren_on(duration=30, volume=8) # 30 seconds, max volume time.sleep(5) base.siren_off() ``` -------------------------------- ### Encrypt Data via Curl Source: https://github.com/twrecked/pyaarlo/blob/master/README.md Encrypt arbitrary data by piping it to a curl command that sends it to the pyaarlo encryption service. This is a direct method for encryption without anonymization. ```bash curl -s -F 'plain_text_file=@-;filename=clear.txt' https://pyaarlo-tfa.appspot.com/encrypt ``` -------------------------------- ### Anonymize Pyaarlo Output Source: https://github.com/twrecked/pyaarlo/blob/master/README.md Anonymize the output when listing devices. This is useful for debugging purposes to protect sensitive information. ```bash pyaarlo -u 'your-user-name' -p 'your-password' --anonymize list all ``` -------------------------------- ### List Arlo Base Stations Source: https://github.com/twrecked/pyaarlo/blob/master/README.md Access the 'base_stations' attribute to retrieve a list of all Arlo base stations. ```python # listing base stations arlo.base_stations ``` -------------------------------- ### Anonymize and Encrypt Pyaarlo Output Source: https://github.com/twrecked/pyaarlo/blob/master/README.md Anonymize and encrypt the output when listing devices. This provides enhanced security for debugging logs. ```bash pyaarlo -u 'your-user-name' -p 'your-password' --anonymize --encrypt list all ``` -------------------------------- ### Alarm Mode Change Packet Source: https://github.com/twrecked/pyaarlo/blob/master/docs/packets.md Packet indicating a change in the base station alarm mode. ```APIDOC ## Alarm Mode Change Packet ### Description Indicates that a base station has changed its alarm mode (e.g., disarmed to armed). This can be triggered by the user or another user. ### Response Example { "4R068BXXXXXXX": { "activeModes": ["mode1"], "activeSchedules": [], "timestamp": 1568142116238}, "resource": "activeAutomations" } ``` -------------------------------- ### Alarm Mode Change Packet Source: https://github.com/twrecked/pyaarlo/blob/master/docs/packets.md Indicates a change in the base station alarm mode, triggered by user action or system state changes. ```json { "4R068BXXXXXXX": { "activeModes": ["mode1"], "activeSchedules": [], "timestamp": 1568142116238}, "resource": "activeAutomations"} ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.