Skip to content

Unable to Retrieve Encryption Key – Device Stuck as “Owned by Another User” #378

@coasttech

Description

@coasttech

Error Summary (using obfuscated MAC address)

I am unable to retrieve the encryption key for two SwitchBot devices.
Primary errors:
• "not the device owner, status code: 190"
• "parameter keyType invalid, status code: 190" (with keyTypes other than user)
• HTTP 403 on all device discovery endpoints
• Empty responses for certain MAC/keyType combinations

Environment
• OS: macOS
• Python: 3.13 (virtual environment: switchbot-env)
• pySwitchbot: 0.68.2 (latest from repo)
• Region: US
• Account(s): [email protected] (multiple, as explained below)
• All commands run in: Warp terminal

Both devices show identical results.

Test Results & Steps

  1. Authentication & User Info
    • Always successful (✓ Authentication successful, user info returned, region: US)

  2. Device Discovery

All endpoints tested:
• wonder/device/v1/list → 403 Forbidden
• wonder/device/list → 403 Forbidden
• device/v1/list → 403 Forbidden
• v1/devices → 403 Forbidden
• wonder/keys/v1/list → Empty response

  1. Key Retrieval Attempts

By MAC format (all fail):
• AABBCCDDEEFF (uppercase, no separators) → Empty response
• aabbccddeeff (lowercase, no separators) → “not the device owner, status code: 190”
• AA:BB:CC:DD:EE:FF (uppercase, with colons) → “not the device owner, status code: 190”
• aa:bb:cc:dd:ee:ff (lowercase, with colons) → “not the device owner, status code: 190”

By keyType:
• user → Empty response
• admin → “parameter keyType invalid, status code: 190”
• guest → “parameter keyType invalid, status code: 190”
• owner → “parameter keyType invalid, status code: 190”

  1. Application-level Error
    • Always fails with:
    Failed to retrieve encryption key from SwitchBot Account: 'communicationKey'

Detailed Account/Device Troubleshooting Performed
1. Removed device from original account, re-paired to same account:
• Error persists.
2. Removed from original account, created new account, paired device:
• Error persists.
3. Removed from new account, re-paired to original account:
• Error persists.
4. Tested with multiple MAC formats:
• Only “user” keyType does not immediately error (but returns empty).
5. Device is present in the SwitchBot app and Home system and functions as expected.

Key Findings
1. Multiple error codes: Not just “owned by another user” — also “not the device owner” and “parameter keyType invalid.”
2. Device discovery endpoints (all tested) always return 403 Forbidden.
3. MAC address format affects response: some return empty, some return 190 error.
4. Alternative keyTypes (admin, guest, owner) all rejected (status code 190).
5. Consistent behaviour for two different devices and multiple accounts.

Questions for SwitchBot / pySwitchbot Maintainers
1. What is the precise meaning of “not the device owner, status code: 190” compared to “owned by another user”? Are they different backend states?
2. Why are all device-listing endpoints returning 403? Is this expected when logged in via the official API?
3. Should “admin”, “guest”, and “owner” keyType parameters work? Or are they deprecated/unsupported?
4. Is there any way to truly reset device ownership and allow another account to claim/pair and generate keys?
5. Is there a way to fully wipe/release the device in the app or via API that would resolve this?
6. Are there backend flags or server-side issues that can block key retrieval even when the device is paired and functional in the app?

Full Sample Output (Warp Session)

✓ Authentication successful
=== STEP 2: User Info ===
✓ User info retrieved
Using region: us
=== STEP 3: Device Discovery ===
Failed wonder/device/v1/list: 403
Failed wonder/device/list: 403
Failed device/v1/list: 403
Failed v1/devices: 403
wonder/keys/v1/list: Empty response
=== STEP 4: Key Retrieval Attempts ===

Attempt 1: MAC format 'AABBCCDDEEFF'
✓ Response received for MAC 'AABBCCDDEEFF': {}
Empty response

Attempt 2: MAC format 'aabbccddeeff'
❌ Failed with MAC 'aabbccddeeff': not the device owner, status code: 190

Attempt 3: MAC format 'AA:BB:CC:DD:EE:FF'
❌ Failed with MAC 'AA:BB:CC:DD:EE:FF': not the device owner, status code: 190

Attempt 4: MAC format 'aa:bb:cc:dd:ee:ff'
❌ Failed with MAC 'aa:bb:cc:dd:ee:ff': not the device owner, status code: 190

=== STEP 5: Different Key Types ===

Trying keyType: user
Empty response for keyType 'user'

Trying keyType: admin
Failed with keyType 'admin': parameter keyType invalid, status code: 190

Trying keyType: guest
Failed with keyType 'guest': parameter keyType invalid, status code: 190

Trying keyType: owner
Failed with keyType 'owner': parameter keyType invalid, status code: 190

❌ FAILED TO RETRIEVE KEY

I assume that I'm missing something in order for you to assess me so just let me know if I need to provide anything else.

This support request was drafted with the assistance of ChatGPT for clarity and completeness. All troubleshooting steps and outputs were assisted using the Warp terminal.

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