Hi,
I’m running Home Assistant with the custom integration dirigera_platform.
During setup the integration fails with a Pydantic ValidationError when at least
one motion sensor does not report attributes.batteryPercentage.
Stacktrace excerpt:
pydantic_core._pydantic_core.ValidationError: 1 validation error for MotionSensor
attributes.batteryPercentage
Field required [type=missing]
The IKEA Dirigera hub returns a valid motion sensor object, but without
batteryPercentage in attributes. This causes the entire config entry setup
to fail.
Observed behavior:
- Integration setup aborts completely
- No devices are created
- Happens consistently with a specific motion sensor
Expected behavior:
batteryPercentage should be optional
- Integration should tolerate missing battery values and continue setup
Additional notes:
- The affected device is visible in the IKEA Smart Home app
- Firmware is up to date
I believe should define batteryPercentage as optional
(e.g. int | None = None) to avoid hard failures on incomplete device payloads.
Thanks!
Hi,
I’m running Home Assistant with the custom integration
dirigera_platform.During setup the integration fails with a Pydantic ValidationError when at least
one motion sensor does not report
attributes.batteryPercentage.Stacktrace excerpt:
pydantic_core._pydantic_core.ValidationError: 1 validation error for MotionSensor
attributes.batteryPercentage
Field required [type=missing]
The IKEA Dirigera hub returns a valid motion sensor object, but without
batteryPercentageinattributes. This causes the entire config entry setupto fail.
Observed behavior:
Expected behavior:
batteryPercentageshould be optionalAdditional notes:
I believe should define
batteryPercentageas optional(e.g.
int | None = None) to avoid hard failures on incomplete device payloads.Thanks!