Skip to content

Motion detection toggle gives unhelpful 404 error for shared users #520

@loganrosen

Description

@loganrosen

Problem

When a shared user (role: shared_user) tries to toggle motion_detection on a doorbell, the Ring API returns a 404 on PATCH /devices/v1/devices/{id}/settings. The library raises a generic RingError with no indication that the problem is permissions-related.

In Home Assistant, this shows up as "Error communicating with Ring API", leading users to think the integration is broken.

Root Cause

Ring's API returns 404 (not 403) when a shared user attempts to PATCH device settings. Reads work fine:

GET   /devices/v1/devices/{id}          → 200 (authorization.role: "shared_user")
GET   /devices/v1/devices/{id}/settings → 200
PATCH /devices/v1/devices/{id}/settings → 404 {"error": "Not Found"}

The device's authorization.role field is available from the GET response and could be checked before attempting the PATCH.

The ring-mqtt project already handles this —

Suggested Fix

In doorbot.py, the async_set_motion_detection method could either:

  1. Check self.shared (already available on the class) before attempting the PATCH and raise a descriptive error
  2. Or catch the 404 response specifically and raise something like:
    RingError("Cannot change motion detection: shared users do not have permission to modify device settings. Log in with the device owner account.")

Option 1 seems cleanest since self.shared is already tracked — it's just never used to guard write operations.

Environment

  • ring-doorbell version: 0.9.14
  • Device: Doorbell 2nd Gen (cocoa_doorbell_v2)
  • Account role: shared_user

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions