Skip to content

Petkit integration throws Pydantic validation errors and API timeouts on HA 2026.3.2 #208

@Tregaron1

Description

@Tregaron1

System Health details

Version | core-2026.4.1
Installation type | Home Assistant OS
Development | false
Supervisor | true
Docker | true
Container architecture | amd64
User | root
Virtual environment | false
Python version | 3.14.2
Operating system family | Linux
Operating system version | 6.12.67-haos
CPU architecture | x86_64
Time zone | Europe/London

Integration version ?

1.24.2

In which region is your Petkit application registered?

EU

Device type

All devices

Checklist

  • I have enabled debug logging for my installation.
  • This issue only contains 1 issue (if you have multiple issues, open one issue for each issue).
  • This issue is not a duplicate issue of any previous issues..

Describe the issue

Every poll produces either a validation error or a timeout (see debug log examples). Because of the unhandled exceptions, the integration never updates the entities.

Notes / suspected cause:

  • The API now returns numeric IDs for packageRecord / packageChanged, but PackageInfoResult still type-hints them as strings.
  • The device_detail endpoint regularly exceeds the current timeout window.

Request:

  • Update PackageInfoResult (and related models) to accept integers as well as strings.
  • Consider increasing the default timeout/retry budget for device_detail.

Thank you very much for supporting this helpful integration!

Reproduction steps

  1. Start Home Assistant with the Petkit integration
  2. Wait for the scheduled background polling (occurs roughly every minute).
  3. Observe the system log.

Debug logs

2026-04-06 09:22:21 ERROR [pypetkitapi.client] Task failure in record_tasks:
2 validation errors for PackageInfoResult
packageRecord: Input should be a valid string (input_value=1775061783, input_type=int)
packageChanged: Input should be a valid string (input_value=1769718989, input_type=int)

2026-04-06 09:30:31 ERROR [pypetkitapi.client]
PetkitTimeoutError('Request to https://api.eu-pet.com/latest/t6/device_detail timed out')

Diagnostics dump

No response

Metadata

Metadata

Assignees

Labels

BugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions