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:
- Check
self.shared (already available on the class) before attempting the PATCH and raise a descriptive error
- 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
Problem
When a shared user (
role: shared_user) tries to togglemotion_detectionon a doorbell, the Ring API returns a 404 onPATCH /devices/v1/devices/{id}/settings. The library raises a genericRingErrorwith 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:
The device's
authorization.rolefield is available from the GET response and could be checked before attempting the PATCH.The
ring-mqttproject already handles this —Suggested Fix
In
doorbot.py, theasync_set_motion_detectionmethod could either:self.shared(already available on the class) before attempting the PATCH and raise a descriptive errorRingError("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.sharedis already tracked — it's just never used to guard write operations.Environment
ring-doorbellversion: 0.9.14cocoa_doorbell_v2)shared_userRelated