Skip to content

Local API: setup crashes on stub devices (ogp://) missing controllableName #2165

Description

@ebellamy

Summary

On a TaHoma gateway accessed through the Local API, /setup returns devices where a subset are gateway-internal objects whose deviceURL starts with ogp:// and which do not carry a controllableName (also missing definition / type). get_setup() (and get_devices()) call converter.structure(response, Setup) / converter.structure(response, list[Device]), and cattrs raises a KeyError while structuring these stub devices — which aborts the entire setup, so no device loads at all.

In my dump: 14 of 30 devices are such ogp:// stubs without controllableName.

Reported stack (via Home Assistant overkiz integration, local API):

KeyError: 'controllableName'   # (also 'definition' / 'type') in structure_Device

Distinct from #2164 / home-assistant/core#175409

This is not the Rexel client-selection bug (KeyError: 'auth_implementation') fixed by home-assistant/core#175409 (which changes overkiz/__init__.py client factory). Here the crash is inside pyoverkiz converter.structure on real /setup payloads whose devices legitimately lack controllableName.

Stub device shape (redacted)

The 14 skipped objects are ogp://… gateway-internal entries, e.g. deviceURL: ogp://<PIN>/2550513B, ogp://<PIN>/6BFA79ED, ogp://<PIN>/6CEA3AD2, … — no controllableName / definition / type keys. Real controllable devices (io://…) are unaffected. A full redacted /setup JSON (PIN/tokens masked) can be attached on request.

Proposed fix

In get_setup and get_devices, skip (or tolerate) devices without controllableName before converter.structure — they are gateway-internal ogp:// objects, not controllable devices. A firmware that returns such stubs should not break the whole setup.

Workaround in use

Wrapping OverkizClient._get to filter response["devices"] (setup) / the list (setup/devices) on presence of controllableName before deserialization restores a working setup and cleanly loads the real devices (cover.portail, Velux, …).

Environment

  • pyoverkiz via Home Assistant overkiz integration, Local API mode
  • TaHoma gateway firmware (returns ogp:// stub devices)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions