You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Matter Server (6.6.1), Advanced SSH & Web Terminal (19.0.0), RTSPtoWeb - WebRTC (1.4.0), Studio Code Server (5.18.0), Samba share (12.3.2), ESPHome Device Builder (2024.12.2), Govee to MQTT Bridge (2025.01.01-ae1f0cc1), go2rtc (1.9.7)
Dashboards
dashboards
7
resources
35
views
26
mode
storage
Recorder
oldest_recorder_run
December 22, 2024 at 13:36
current_recorder_run
December 31, 2024 at 15:49
estimated_db_size
444.70 MiB
database_engine
sqlite
database_version
3.45.3
Sonoff
version
3.8.1 (ffa7e22)
cloud_online
2 / 2
local_online
2 / 2
Spotify
api_endpoint_reachable
ok
Integration version ?
v1.3.7
In which region is your Petkit application registered?
France
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
I see that sometimes around 3am token expires and integration is not capable of recovering from it. It's not happening every day. Here are logs from the time when it happens:
2025-01-02 03:49:14.470 DEBUG (MainThread) [pypetkitapi.client] Token still OK, but refreshing session
2025-01-02 03:49:14.470 DEBUG (MainThread) [pypetkitapi.client] Refreshing session
2025-01-02 03:49:14.470 DEBUG (MainThread) [pypetkitapi.client] Request: POST https://api.eu-pet.com/latest/user/refreshsession
2025-01-02 03:49:14.594 DEBUG (MainThread) [pypetkitapi.client] List devices data for account: device_list=[] expired=False group_id=300309966 name='My Family' owner=200082375 pet_list=[] user_list=[User(avatar='https://sandbox-img5.petkit.cn/banner/2022/10/13/6347d75a44ad08000b011e7dDzwc693i5', created_at=1734865925390, is_owner=1, user_id=200082375, user_name='User010640')]
2025-01-02 03:49:14.594 DEBUG (MainThread) [pypetkitapi.client] List devices data for account: device_list=[Device(created_at=1730472947656, device_id=300009176, device_name='Snezenka Feeder', device_type='D4sh', group_id=300277568, type=25, type_code=0, unique_id='300009176-25'), Device(created_at=1733342269803, device_id=300010329, device_name='Konvalinka Feeder', device_type='D4sh', group_id=300277568, type=25, type_code=0, unique_id='300010329-25')] expired=False group_id=300277568 name='Patrik & Wendy' owner=200052532 pet_list=[Pet(avatar='https://img2.petkit.cn/dogavatar/111.png', created_at=1730494092650, pet_id=101066365, pet_name='Sněženka', id=101066365, sn='101066365', name='Sněženka', device_type='pet', firmware=None, last_litter_usage=0, last_device_used=None, last_duration_usage=0, last_measured_weight=0), Pet(avatar='https://img2.petkit.cn/dogavatar/111.png', created_at=1730494144209, pet_id=101066366, pet_name='Konvalinka', id=101066366, sn='101066366', name='Konvalinka', device_type='pet', firmware=None, last_litter_usage=0, last_device_used=None, last_duration_usage=0, last_measured_weight=0)] user_list=[User(avatar='https://sandbox-img5.petkit.cn/banner/2022/10/13/6347d75a44ad08000b011e7dDzwc693i5', created_at=1730472852480, is_owner=1, user_id=200052532, user_name='Patrik'), User(avatar='https://petkit-storage-image-prod-eu.oss-eu-central-1.aliyuncs.com/uavatar/2024/12/5/1733343034200071035', created_at=1733342964215, is_owner=0, user_id=200071035, user_name='Weninky'), User(avatar='https://sandbox-img5.petkit.cn/banner/2022/10/13/6347d75a44ad08000b011e7dDzwc693i5', created_at=1734866079624, is_owner=0, user_id=200082375, user_name='User010640')]
2025-01-02 03:49:14.594 DEBUG (MainThread) [pypetkitapi.client] Devices in account: [Device(created_at=1730472947656, device_id=300009176, device_name='Snezenka Feeder', device_type='D4sh', group_id=300277568, type=25, type_code=0, unique_id='300009176-25'), Device(created_at=1733342269803, device_id=300010329, device_name='Konvalinka Feeder', device_type='D4sh', group_id=300277568, type=25, type_code=0, unique_id='300010329-25')]
2025-01-02 03:49:14.594 DEBUG (MainThread) [pypetkitapi.client] Found 2 devices
2025-01-02 03:49:14.594 DEBUG (MainThread) [pypetkitapi.client] Reading device type : d4sh (id=300009176)
2025-01-02 03:49:14.595 DEBUG (MainThread) [pypetkitapi.client] Request: POST https://api.eu-pet.com/latest/d4sh/device_detail
2025-01-02 03:49:14.596 DEBUG (MainThread) [pypetkitapi.client] Reading device type : d4sh (id=300010329)
2025-01-02 03:49:14.596 DEBUG (MainThread) [pypetkitapi.client] Request: POST https://api.eu-pet.com/latest/d4sh/device_detail
2025-01-02 03:49:14.633 DEBUG (MainThread) [pypetkitapi.client] Device data fetched OK for d4sh
2025-01-02 03:49:14.702 DEBUG (MainThread) [pypetkitapi.client] Device data fetched OK for d4sh
2025-01-02 03:49:14.703 DEBUG (MainThread) [pypetkitapi.client] Reading device type : d4sh (id=300009176)
2025-01-02 03:49:14.703 DEBUG (MainThread) [pypetkitapi.client] Request: POST https://api.eu-pet.com/latest/d4sh/getDeviceRecord
2025-01-02 03:49:14.704 DEBUG (MainThread) [pypetkitapi.client] Reading device type : d4sh (id=300010329)
2025-01-02 03:49:14.704 DEBUG (MainThread) [pypetkitapi.client] Request: POST https://api.eu-pet.com/latest/d4sh/getDeviceRecord
2025-01-02 03:49:14.752 DEBUG (MainThread) [pypetkitapi.client] Device records fetched OK for d4sh
2025-01-02 03:49:14.761 DEBUG (MainThread) [pypetkitapi.client] Device records fetched OK for d4sh
2025-01-02 03:49:14.762 DEBUG (MainThread) [pypetkitapi.client] Petkit data fetched successfully in: 0:00:00.167693
2025-01-02 03:49:14.762 DEBUG (MainThread) [custom_components.petkit] Finished fetching petkit data in 0.292 seconds (success: True)
2025-01-02 03:49:44.470 DEBUG (MainThread) [pypetkitapi.client] Token expired, re-logging in
2025-01-02 03:49:44.470 DEBUG (MainThread) [pypetkitapi.client] Getting API server list
2025-01-02 03:49:44.470 DEBUG (MainThread) [pypetkitapi.client] Request: GET https://api.eu-pet.com/latest/v1/regionservers
2025-01-02 03:49:44.574 ERROR (MainThread) [custom_components.petkit] Error fetching petkit data: Request failed with status code 404
2025-01-02 03:49:44.574 DEBUG (MainThread) [custom_components.petkit] Finished fetching petkit data in 0.104 seconds (success: False)
2025-01-02 03:49:47.938 INFO (MainThread) [custom_components.hacs] Loading known repositories
2025-01-02 03:50:14.470 DEBUG (MainThread) [pypetkitapi.client] Token expired, re-logging in
2025-01-02 03:50:14.470 DEBUG (MainThread) [pypetkitapi.client] Getting API server list
2025-01-02 03:50:14.470 DEBUG (MainThread) [pypetkitapi.client] Request: GET https://api.eu-pet.com/latest/v1/regionservers
2025-01-02 03:50:14.579 DEBUG (MainThread) [custom_components.petkit] Finished fetching petkit data in 0.110 seconds (success: False)
2025-01-02 03:50:44.469 DEBUG (MainThread) [pypetkitapi.client] Token expired, re-logging in
2025-01-02 03:50:44.470 DEBUG (MainThread) [pypetkitapi.client] Getting API server list
2025-01-02 03:50:44.470 DEBUG (MainThread) [pypetkitapi.client] Request: GET https://api.eu-pet.com/latest/v1/regionservers
2025-01-02 03:50:44.568 DEBUG (MainThread) [custom_components.petkit] Finished fetching petkit data in 0.099 seconds (success: False)
2025-01-02 03:51:14.469 DEBUG (MainThread) [pypetkitapi.client] Token expired, re-logging in
2025-01-02 03:51:14.469 DEBUG (MainThread) [pypetkitapi.client] Getting API server list
2025-01-02 03:51:14.470 DEBUG (MainThread) [pypetkitapi.client] Request: GET https://api.eu-pet.com/latest/v1/regionservers
2025-01-02 03:51:14.579 DEBUG (MainThread) [custom_components.petkit] Finished fetching petkit data in 0.110 seconds (success: False)
Reproduction steps
Wait for token to expire
Debug logs
Wait for token to expire. Workaround: Reload integration.
System Health details
System Information
Home Assistant Community Store
Home Assistant Cloud
Home Assistant Supervisor
Dashboards
Recorder
Sonoff
Spotify
Integration version ?
v1.3.7
In which region is your Petkit application registered?
France
Device type
All devices
Checklist
Describe the issue
I see that sometimes around 3am token expires and integration is not capable of recovering from it. It's not happening every day. Here are logs from the time when it happens:
2025-01-02 03:49:14.470 DEBUG (MainThread) [pypetkitapi.client] Token still OK, but refreshing session
2025-01-02 03:49:14.470 DEBUG (MainThread) [pypetkitapi.client] Refreshing session
2025-01-02 03:49:14.470 DEBUG (MainThread) [pypetkitapi.client] Request: POST https://api.eu-pet.com/latest/user/refreshsession
2025-01-02 03:49:14.594 DEBUG (MainThread) [pypetkitapi.client] List devices data for account: device_list=[] expired=False group_id=300309966 name='My Family' owner=200082375 pet_list=[] user_list=[User(avatar='https://sandbox-img5.petkit.cn/banner/2022/10/13/6347d75a44ad08000b011e7dDzwc693i5', created_at=1734865925390, is_owner=1, user_id=200082375, user_name='User010640')]
2025-01-02 03:49:14.594 DEBUG (MainThread) [pypetkitapi.client] List devices data for account: device_list=[Device(created_at=1730472947656, device_id=300009176, device_name='Snezenka Feeder', device_type='D4sh', group_id=300277568, type=25, type_code=0, unique_id='300009176-25'), Device(created_at=1733342269803, device_id=300010329, device_name='Konvalinka Feeder', device_type='D4sh', group_id=300277568, type=25, type_code=0, unique_id='300010329-25')] expired=False group_id=300277568 name='Patrik & Wendy' owner=200052532 pet_list=[Pet(avatar='https://img2.petkit.cn/dogavatar/111.png', created_at=1730494092650, pet_id=101066365, pet_name='Sněženka', id=101066365, sn='101066365', name='Sněženka', device_type='pet', firmware=None, last_litter_usage=0, last_device_used=None, last_duration_usage=0, last_measured_weight=0), Pet(avatar='https://img2.petkit.cn/dogavatar/111.png', created_at=1730494144209, pet_id=101066366, pet_name='Konvalinka', id=101066366, sn='101066366', name='Konvalinka', device_type='pet', firmware=None, last_litter_usage=0, last_device_used=None, last_duration_usage=0, last_measured_weight=0)] user_list=[User(avatar='https://sandbox-img5.petkit.cn/banner/2022/10/13/6347d75a44ad08000b011e7dDzwc693i5', created_at=1730472852480, is_owner=1, user_id=200052532, user_name='Patrik'), User(avatar='https://petkit-storage-image-prod-eu.oss-eu-central-1.aliyuncs.com/uavatar/2024/12/5/1733343034200071035', created_at=1733342964215, is_owner=0, user_id=200071035, user_name='Weninky'), User(avatar='https://sandbox-img5.petkit.cn/banner/2022/10/13/6347d75a44ad08000b011e7dDzwc693i5', created_at=1734866079624, is_owner=0, user_id=200082375, user_name='User010640')]
2025-01-02 03:49:14.594 DEBUG (MainThread) [pypetkitapi.client] Devices in account: [Device(created_at=1730472947656, device_id=300009176, device_name='Snezenka Feeder', device_type='D4sh', group_id=300277568, type=25, type_code=0, unique_id='300009176-25'), Device(created_at=1733342269803, device_id=300010329, device_name='Konvalinka Feeder', device_type='D4sh', group_id=300277568, type=25, type_code=0, unique_id='300010329-25')]
2025-01-02 03:49:14.594 DEBUG (MainThread) [pypetkitapi.client] Found 2 devices
2025-01-02 03:49:14.594 DEBUG (MainThread) [pypetkitapi.client] Reading device type : d4sh (id=300009176)
2025-01-02 03:49:14.595 DEBUG (MainThread) [pypetkitapi.client] Request: POST https://api.eu-pet.com/latest/d4sh/device_detail
2025-01-02 03:49:14.596 DEBUG (MainThread) [pypetkitapi.client] Reading device type : d4sh (id=300010329)
2025-01-02 03:49:14.596 DEBUG (MainThread) [pypetkitapi.client] Request: POST https://api.eu-pet.com/latest/d4sh/device_detail
2025-01-02 03:49:14.633 DEBUG (MainThread) [pypetkitapi.client] Device data fetched OK for d4sh
2025-01-02 03:49:14.702 DEBUG (MainThread) [pypetkitapi.client] Device data fetched OK for d4sh
2025-01-02 03:49:14.703 DEBUG (MainThread) [pypetkitapi.client] Reading device type : d4sh (id=300009176)
2025-01-02 03:49:14.703 DEBUG (MainThread) [pypetkitapi.client] Request: POST https://api.eu-pet.com/latest/d4sh/getDeviceRecord
2025-01-02 03:49:14.704 DEBUG (MainThread) [pypetkitapi.client] Reading device type : d4sh (id=300010329)
2025-01-02 03:49:14.704 DEBUG (MainThread) [pypetkitapi.client] Request: POST https://api.eu-pet.com/latest/d4sh/getDeviceRecord
2025-01-02 03:49:14.752 DEBUG (MainThread) [pypetkitapi.client] Device records fetched OK for d4sh
2025-01-02 03:49:14.761 DEBUG (MainThread) [pypetkitapi.client] Device records fetched OK for d4sh
2025-01-02 03:49:14.762 DEBUG (MainThread) [pypetkitapi.client] Petkit data fetched successfully in: 0:00:00.167693
2025-01-02 03:49:14.762 DEBUG (MainThread) [custom_components.petkit] Finished fetching petkit data in 0.292 seconds (success: True)
2025-01-02 03:49:44.470 DEBUG (MainThread) [pypetkitapi.client] Token expired, re-logging in
2025-01-02 03:49:44.470 DEBUG (MainThread) [pypetkitapi.client] Getting API server list
2025-01-02 03:49:44.470 DEBUG (MainThread) [pypetkitapi.client] Request: GET https://api.eu-pet.com/latest/v1/regionservers
2025-01-02 03:49:44.574 ERROR (MainThread) [custom_components.petkit] Error fetching petkit data: Request failed with status code 404
2025-01-02 03:49:44.574 DEBUG (MainThread) [custom_components.petkit] Finished fetching petkit data in 0.104 seconds (success: False)
2025-01-02 03:49:47.938 INFO (MainThread) [custom_components.hacs] Loading known repositories
2025-01-02 03:50:14.470 DEBUG (MainThread) [pypetkitapi.client] Token expired, re-logging in
2025-01-02 03:50:14.470 DEBUG (MainThread) [pypetkitapi.client] Getting API server list
2025-01-02 03:50:14.470 DEBUG (MainThread) [pypetkitapi.client] Request: GET https://api.eu-pet.com/latest/v1/regionservers
2025-01-02 03:50:14.579 DEBUG (MainThread) [custom_components.petkit] Finished fetching petkit data in 0.110 seconds (success: False)
2025-01-02 03:50:44.469 DEBUG (MainThread) [pypetkitapi.client] Token expired, re-logging in
2025-01-02 03:50:44.470 DEBUG (MainThread) [pypetkitapi.client] Getting API server list
2025-01-02 03:50:44.470 DEBUG (MainThread) [pypetkitapi.client] Request: GET https://api.eu-pet.com/latest/v1/regionservers
2025-01-02 03:50:44.568 DEBUG (MainThread) [custom_components.petkit] Finished fetching petkit data in 0.099 seconds (success: False)
2025-01-02 03:51:14.469 DEBUG (MainThread) [pypetkitapi.client] Token expired, re-logging in
2025-01-02 03:51:14.469 DEBUG (MainThread) [pypetkitapi.client] Getting API server list
2025-01-02 03:51:14.470 DEBUG (MainThread) [pypetkitapi.client] Request: GET https://api.eu-pet.com/latest/v1/regionservers
2025-01-02 03:51:14.579 DEBUG (MainThread) [custom_components.petkit] Finished fetching petkit data in 0.110 seconds (success: False)
Reproduction steps
Debug logs
Diagnostics dump
home-assistant_2025-01-02T19-25-32.365Z.log
The text was updated successfully, but these errors were encountered: