RobertD502 / home-assistant-petkit

Home Assistant integration for PetKit devices
MIT License
213 stars 32 forks source link

Litter level & weight always zero #50

Closed panteLx closed 11 months ago

panteLx commented 11 months ago

Hi,

thank you for this integration. It works well so far but i noticed that the litter level and weight is always 0%/KG even if i refill the litter box.

There is one log error but i dont know if its related to this bug.

Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 243, in _handle_refresh_interval
    await self._async_refresh(log_failures=True, scheduled=True)
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 399, in _async_refresh
    self.async_update_listeners()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 182, in async_update_listeners
    update_callback()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 479, in _handle_coordinator_update
    self.async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 745, in async_write_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 845, in _async_write_ha_state
    state, attr = self._async_generate_attributes()
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 786, in _async_generate_attributes
    state = self._stringify_state(available)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 751, in _stringify_state
    if (state := self.state) is None:
                 ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 501, in state
    value = self.native_value
            ^^^^^^^^^^^^^^^^^
  File "/config/custom_components/petkit/sensor.py", line 2874, in native_value
    if work_state['petInTime'] == 0:
       ~~~~~~~~~~^^^^^^^^^^^^^
KeyError: 'petInTime'
RobertD502 commented 11 months ago

Please turn on debug logging and share your log. This will let me know what the PETKIT API is returning.

panteLx commented 11 months ago
2023-12-12 07:11:26.844 DEBUG (MainThread) [custom_components.petkit] Found the following PetKit devices/pets: PetKitData(user_id='100657138', feeders={}, litter_boxes={400003401: LitterBox(id=400003401, device_detail={'id': 400003401, 'mac': 'b8d61a75b3d8', 'sn': '20230603L22203', 'secret': '20837b82cb22184f', 'createdAt': '2023-09-06T14:43:57.937+0000', 'name': 'Kackiklo', 'hardware': 1, 'firmware': '1.456', 'firmwareDetails': [{'module': 'userbin', 'version': 2310010}, {'module': 'pics', 'version': 2220001}, {'module': 'lans', 'version': 2245001}], 'timezone': 1.0, 'signupAt': '2023-12-12T05:46:23.874+0000', 'locale': 'Europe/Berlin', 'user': {'id': '100657138', 'nick': 'SebastianMAIN', 'gender': 3, 'avatar': 'http://sandbox.img5.petkit.cn/banner/2022/10/13/6347d75a44ad08000b011e7dDzwc693i5', 'point': {'honour': 'LV0', 'rank': 0, 'growth': 15, 'icon': 'http://img5-us.petkit.cn/misc/point/n0', 'icon2': 'http://img5-us.petkit.cn/misc/point/l0', 'startGrowth': 0, 'endGrowth': 50}}, 'shareOpen': 1, 'autoUpgrade': 1, 'relation': {'userId': '100657138'}, 'withK3': 1, 'k3Id': 400002990, 'btMac': 'b8d61a75b3da', 'settings': {'litterFullNotify': 1, 'lackSandNotify': 1, 'workNotify': 1, 'petInNotify': 0, 'lackLiquidNotify': 1, 'deodorantNotify': 1, 'sandType': 1, 'manualLock': 0, 'lightMode': 1, 'lightRange': [0, 1440], 'autoWork': 1, 'fixedTimeClear': 0, 'fixedTimeRefresh': 0, 'downpos': 1, 'deepRefresh': 0, 'weightPopup': 1, 'autoIntervalMin': 0, 'stillTime': 1500, 'unit': 0, 'language': 'de_DE', 'languageFollow': 0, 'softMode': 0, 'avoidRepeat': 1, 'underweight': 0, 'kitten': 0, 'kittenTipsTime': 0, 'stopTime': 600, 'languages': ['zh_CN', 'zh_TW', 'en_US', 'es_ES', 'ko_KR', 'it_IT', 'ja_JP', 'pt_PT', 'de_DE', 'fr_FR', 'ru_RU'], 'kittenPercent': 0.8, 'dumpSwitch': 1, 'autoRefresh': 1, 'disturbMode': 0, 'disturbRange': [1425, 465], 'relateK3Switch': 1, 'lightest': 3539, 'deepClean': 0, 'lightConfig': 1, 'bury': 1, 'lightMultiRange': [], 'disturbConfig': 2, 'distrubMultiRange': [[1425, 465]], 'controlSettings': 0}, 'k3Device': {'id': 400002990, 'mac': 'a4c138590d66', 'sn': '01230510M10822', 'secret': '86e940a0f45a', 'createdAt': '2023-09-06T14:48:52.000+0000', 'updateAt': '2023-12-12T05:48:48.000+0000', 'userId': '100657138', 'name': 'AIR SMART SPRAY', 'hardware': 1, 'firmware': 39, 'settings': {'liquidLackSwitch': 1, 'fixedTimeRefresh': 0}, 'timezone': 1.0, 'relation': {'userId': '100657138'}, 'relateT4': 400003401, 'battery': 94, 'liquid': 100, 'refreshing': 0, 'lighting': 0, 'voltage': 5910, 'liquidLack': 3}, 'petOutTip': 1, 'multiConfig': True, 'state': {'wifi': {'ssid': 'BuDu', 'bssid': '3ca62fa9a94d', 'rsq': -70}, 'pim': 1, 'ota': 0, 'overall': 1, 'sandCorrect': 0, 'liquidReset': 0, 'sandWeight': 0, 'sandPercent': 0, 'usedTimes': 0, 'sandType': 1, 'sandStatus': 1, 'box': 0, 'liquid': 100, 'battery': 94, 'petInTime': 0, 'power': 1, 'petError': False, 'deodorantLeftDays': 19, 'liquidLack': False, 'boxFull': False, 'liquidEmpty': False, 'sandLack': False, 'lowPower': False}, 'lastOutTime': 117, 'petOutRecords': [[13340, 58], [23954, 58], [24046, 27], [24131, 55], [24291, 74], [24373, 117]], 'inTimes': 6, 'totalTime': 4076, 'specialLitterAd': {'adDetailUrl': 'http://m.petkit.com/app/cat_litter.html', 'adSwitch': 0, 'adLinkUrl': 'https://m.tb.cn/h.f8XZ8IM?sm=846b3a', 'label': '跨年', 'labelUrl': 'http://sandbox.img5.petkit.cn/post/2021/12/7/61af3624a8c9cc16b23736e8ywX6LUO8P', 'labelName': '专用猫砂'}, 'maintenanceTime': 0, 'petInTipLimit': 15}, device_record=[{'deviceId': 400003401, 'eventType': 10, 'timestamp': 1702348998, 'content': {'timeIn': 1702348940, 'timeOut': 1702348998, 'autoClear': 1, 'interval': 25, 'petWeight': 4661}, 'enumEventType': 'pet_out', 'userId': '100657138', 'petId': '-2', 'subContent': [{'deviceId': 400003401, 'eventType': 8, 'timestamp': 1702349039, 'content': {'startTime': 1702349013, 'startReason': 0, 'liquid': 99, 'result': 0, 'fromClear': 1, 'liquidLack': False}, 'enumEventType': 'spray_over', 'userId': '100657138', 'subContent': []}, {'deviceId': 400003401, 'eventType': 5, 'timestamp': 1702350736, 'content': {'startTime': 1702350499, 'startReason': 0, 'litterPercent': 0, 'box': 0, 'result': 0, 'boxFull': False}, 'enumEventType': 'clean_over', 'userId': '100657138', 'subContent': []}]}, {'deviceId': 400003401, 'eventType': 10, 'timestamp': 1702359612, 'content': {'timeIn': 1702359554, 'timeOut': 1702359612, 'autoClear': 1, 'interval': 25, 'petWeight': 4622}, 'enumEventType': 'pet_out', 'userId': '100657138', 'petId': '100900992', 'subContent': [{'deviceId': 400003401, 'eventType': 8, 'timestamp': 1702359712, 'content': {'startTime': 1702359687, 'startReason': 0, 'liquid': 100, 'result': 0, 'fromClear': 1, 'liquidLack': False}, 'enumEventType': 'spray_over', 'userId': '100657138', 'subContent': []}], 'avatar': 'http://img5-us.petkit.cn/uavatar/2023/11/20/655a691aeb4f8d000b6c1d51IPRMLhiKV', 'petName': 'Rufa'}, {'deviceId': 400003401, 'eventType': 10, 'timestamp': 1702359673, 'content': {'timeIn': 1702359646, 'timeOut': 1702359673, 'autoClear': 1, 'interval': 25, 'petWeight': 4844}, 'enumEventType': 'pet_out', 'userId': '100657138', 'petId': '100900989', 'subContent': [{'deviceId': 400003401, 'eventType': 8, 'timestamp': 1702359712, 'content': {'startTime': 1702359687, 'startReason': 0, 'liquid': 100, 'result': 0, 'fromClear': 1, 'liquidLack': False}, 'enumEventType': 'spray_over', 'userId': '100657138', 'subContent': []}], 'avatar': 'http://img5-us.petkit.cn/uavatar/2023/11/20/655a68c28cb7a2000c1e7779HwWvM4xj2', 'petName': 'Simba'}, {'deviceId': 400003401, 'eventType': 10, 'timestamp': 1702359786, 'content': {'timeIn': 1702359731, 'timeOut': 1702359786, 'autoClear': 1, 'interval': 25, 'petWeight': 4423}, 'enumEventType': 'pet_out', 'userId': '100657138', 'petId': '100900992', 'subContent': [{'deviceId': 400003401, 'eventType': 8, 'timestamp': 1702359824, 'content': {'startTime': 1702359799, 'startReason': 0, 'liquid': 100, 'result': 0, 'fromClear': 1, 'liquidLack': False}, 'enumEventType': 'spray_over', 'userId': '100657138', 'subContent': []}], 'avatar': 'http://img5-us.petkit.cn/uavatar/2023/11/20/655a691aeb4f8d000b6c1d51IPRMLhiKV', 'petName': 'Rufa'}, {'deviceId': 400003401, 'eventType': 10, 'timestamp': 1702359965, 'content': {'timeIn': 1702359891, 'timeOut': 1702359965, 'autoClear': 1, 'interval': 25, 'petWeight': 4699}, 'enumEventType': 'pet_out', 'userId': '100657138', 'petId': '100900989', 'subContent': [], 'avatar': 'http://img5-us.petkit.cn/uavatar/2023/11/20/655a68c28cb7a2000c1e7779HwWvM4xj2', 'petName': 'Simba'}, {'deviceId': 400003401, 'eventType': 10, 'timestamp': 1702360090, 'content': {'timeIn': 1702359973, 'timeOut': 1702360090, 'autoClear': 1, 'interval': 25, 'petWeight': 4624}, 'enumEventType': 'pet_out', 'userId': '100657138', 'petId': '100900992', 'subContent': [{'deviceId': 400003401, 'eventType': 8, 'timestamp': 1702360128, 'content': {'startTime': 1702360096, 'startReason': 0, 'liquid': 100, 'result': 6, 'fromClear': 1, 'liquidLack': False}, 'enumEventType': 'spray_over', 'userId': '100657138', 'subContent': []}], 'avatar': 'http://img5-us.petkit.cn/uavatar/2023/11/20/655a691aeb4f8d000b6c1d51IPRMLhiKV', 'petName': 'Rufa'}], statistics={'statisticTime': '20231212', 'totalTime': 389, 'times': 6, 'avgTime': 64, 'statisticInfo': [{'statisticDate': '20231212', 'petTimes': 1, 'petTotalTime': 58, 'petWeight': 4661, 'petId': '0', 'petName': '', 'xTime': 13340}, {'statisticDate': '20231212', 'petTimes': 1, 'petTotalTime': 58, 'petWeight': 4622, 'petId': '100900992', 'petName': 'Rufa', 'xTime': 23954}, {'statisticDate': '20231212', 'petTimes': 1, 'petTotalTime': 27, 'petWeight': 4844, 'petId': '100900989', 'petName': 'Simba', 'xTime': 24046}, {'statisticDate': '20231212', 'petTimes': 1, 'petTotalTime': 55, 'petWeight': 4423, 'petId': '100900992', 'petName': 'Rufa', 'xTime': 24131}, {'statisticDate': '20231212', 'petTimes': 1, 'petTotalTime': 74, 'petWeight': 4699, 'petId': '100900989', 'petName': 'Simba', 'xTime': 24291}, {'statisticDate': '20231212', 'petTimes': 1, 'petTotalTime': 117, 'petWeight': 4624, 'petId': '100900992', 'petName': 'Rufa', 'xTime': 24373}], 'petIds': [{'id': '100900992', 'name': 'Rufa'}, {'id': '100900989', 'name': 'Simba'}, {'id': '0', 'name': ''}]}, type='t4', manually_paused=False, manual_pause_end=None)}, water_fountains={}, pets={100900989: Pet(id='100900989', data={'activeDegree': 0, 'avatar': 'http://img5-us.petkit.cn/uavatar/2023/11/20/655a68c28cb7a2000c1e7779HwWvM4xj2', 'birth': '2022-06-24', 'category': {'avatar': 'http://img5-us.petkit.cn/dogavatar/2017/8/10/598c150b98953a0fc0b2ad7eDHh42Ty1z', 'id': 10063, 'name': 'European Shorthair'}, 'createdAt': '2023-11-19T19:58:43.000Z', 'deviceCount': 0, 'emotion': 0, 'familyId': 300111542, 'femaleState': 0, 'gender': 1, 'id': '100900989', 'isRoyalCaninPet': 0, 'maleState': 1, 'name': 'Simba', 'owner': {'deviceCount': 0, 'id': '100657138', 'petCount': 0, 'userCount': 0}, 'size': {'id': 1, 'name': 'Standard'}, 'states': [], 'type': {'id': 2, 'name': 'Cat'}, 'updatedAt': '2023-11-20T04:39:45.000Z', 'weight': 4.918, 'weightControl': 3, 'weightControlTips': {}, 'weightLabel': 'Normal'}, type='Cat'), 100900992: Pet(id='100900992', data={'activeDegree': 0, 'avatar': 'http://img5-us.petkit.cn/uavatar/2023/11/20/655a691aeb4f8d000b6c1d51IPRMLhiKV', 'birth': '2022-04-24', 'category': {'avatar': 'http://img5-us.petkit.cn/dogavatar/2017/8/10/598c150b98953a0fc0b2ad7eDHh42Ty1z', 'id': 10063, 'name': 'European Shorthair'}, 'createdAt': '2023-11-19T19:59:49.000Z', 'deviceCount': 0, 'emotion': 0, 'familyId': 300111542, 'femaleState': 1, 'gender': 2, 'id': '100900992', 'isRoyalCaninPet': 0, 'maleState': 0, 'name': 'Rufa', 'owner': {'deviceCount': 0, 'id': '100657138', 'petCount': 0, 'userCount': 0}, 'size': {'id': 1, 'name': 'Standard'}, 'states': [], 'type': {'id': 2, 'name': 'Cat'}, 'updatedAt': '2023-11-24T11:07:21.000Z', 'weight': 4.424, 'weightControl': 3, 'weightControlTips': {}, 'weightLabel': 'Normal'}, type='Cat')}, purifiers={})
2023-12-12 07:11:26.845 DEBUG (MainThread) [custom_components.petkit] Finished fetching petkit data in 0.524 seconds (success: True)
2023-12-12 07:13:26.755 DEBUG (MainThread) [custom_components.petkit] Found the following PetKit devices/pets: PetKitData(user_id='100657138', feeders={}, litter_boxes={400003401: LitterBox(id=400003401, device_detail={'id': 400003401, 'mac': 'b8d61a75b3d8', 'sn': '20230603L22203', 'secret': '20837b82cb22184f', 'createdAt': '2023-09-06T14:43:57.937+0000', 'name': 'Kackiklo', 'hardware': 1, 'firmware': '1.456', 'firmwareDetails': [{'module': 'userbin', 'version': 2310010}, {'module': 'pics', 'version': 2220001}, {'module': 'lans', 'version': 2245001}], 'timezone': 1.0, 'signupAt': '2023-12-12T05:46:23.874+0000', 'locale': 'Europe/Berlin', 'user': {'id': '100657138', 'nick': 'SebastianMAIN', 'gender': 3, 'avatar': 'http://sandbox.img5.petkit.cn/banner/2022/10/13/6347d75a44ad08000b011e7dDzwc693i5', 'point': {'honour': 'LV0', 'rank': 0, 'growth': 15, 'icon': 'http://img5-us.petkit.cn/misc/point/n0', 'icon2': 'http://img5-us.petkit.cn/misc/point/l0', 'startGrowth': 0, 'endGrowth': 50}}, 'shareOpen': 1, 'autoUpgrade': 1, 'relation': {'userId': '100657138'}, 'withK3': 1, 'k3Id': 400002990, 'btMac': 'b8d61a75b3da', 'settings': {'litterFullNotify': 1, 'lackSandNotify': 1, 'workNotify': 1, 'petInNotify': 0, 'lackLiquidNotify': 1, 'deodorantNotify': 1, 'sandType': 1, 'manualLock': 0, 'lightMode': 1, 'lightRange': [0, 1440], 'autoWork': 1, 'fixedTimeClear': 0, 'fixedTimeRefresh': 0, 'downpos': 1, 'deepRefresh': 0, 'weightPopup': 1, 'autoIntervalMin': 0, 'stillTime': 1500, 'unit': 0, 'language': 'de_DE', 'languageFollow': 0, 'softMode': 0, 'avoidRepeat': 1, 'underweight': 0, 'kitten': 0, 'kittenTipsTime': 0, 'stopTime': 600, 'languages': ['zh_CN', 'zh_TW', 'en_US', 'es_ES', 'ko_KR', 'it_IT', 'ja_JP', 'pt_PT', 'de_DE', 'fr_FR', 'ru_RU'], 'kittenPercent': 0.8, 'dumpSwitch': 1, 'autoRefresh': 1, 'disturbMode': 0, 'disturbRange': [1425, 465], 'relateK3Switch': 1, 'lightest': 3539, 'deepClean': 0, 'lightConfig': 1, 'bury': 1, 'lightMultiRange': [], 'disturbConfig': 2, 'distrubMultiRange': [[1425, 465]], 'controlSettings': 0}, 'k3Device': {'id': 400002990, 'mac': 'a4c138590d66', 'sn': '01230510M10822', 'secret': '86e940a0f45a', 'createdAt': '2023-09-06T14:48:52.000+0000', 'updateAt': '2023-12-12T06:13:11.000+0000', 'userId': '100657138', 'name': 'AIR SMART SPRAY', 'hardware': 1, 'firmware': 39, 'settings': {'liquidLackSwitch': 1, 'fixedTimeRefresh': 0}, 'timezone': 1.0, 'relation': {'userId': '100657138'}, 'relateT4': 400003401, 'battery': 94, 'liquid': 100, 'refreshing': 0, 'lighting': 0, 'voltage': 5910, 'liquidLack': 3}, 'petOutTip': 1, 'multiConfig': True, 'state': {'wifi': {'ssid': 'BuDu', 'bssid': '3ca62fa9a94d', 'rsq': -70}, 'pim': 1, 'ota': 0, 'overall': 1, 'workState': {'workMode': 0, 'workReason': 0, 'workProcess': 13, 'stopTime': 600}, 'refreshState': {'workReason': 0, 'workProcess': 1}, 'sandCorrect': 0, 'liquidReset': 0, 'sandWeight': 0, 'sandPercent': 0, 'usedTimes': 0, 'sandType': 1, 'sandStatus': 1, 'box': 0, 'liquid': 100, 'battery': 94, 'petInTime': 0, 'power': 1, 'petError': False, 'deodorantLeftDays': 19, 'liquidLack': False, 'boxFull': False, 'liquidEmpty': False, 'sandLack': False, 'lowPower': False}, 'lastOutTime': 117, 'petOutRecords': [[13340, 58], [23954, 58], [24046, 27], [24131, 55], [24291, 74], [24373, 117]], 'inTimes': 6, 'totalTime': 4076, 'specialLitterAd': {'adDetailUrl': 'http://m.petkit.com/app/cat_litter.html', 'adSwitch': 0, 'adLinkUrl': 'https://m.tb.cn/h.f8XZ8IM?sm=846b3a', 'label': '跨年', 'labelUrl': 'http://sandbox.img5.petkit.cn/post/2021/12/7/61af3624a8c9cc16b23736e8ywX6LUO8P', 'labelName': '专用猫砂'}, 'maintenanceTime': 0, 'petInTipLimit': 15}, device_record=[{'deviceId': 400003401, 'eventType': 10, 'timestamp': 1702348998, 'content': {'timeIn': 1702348940, 'timeOut': 1702348998, 'autoClear': 1, 'interval': 25, 'petWeight': 4661}, 'enumEventType': 'pet_out', 'userId': '100657138', 'petId': '-2', 'subContent': [{'deviceId': 400003401, 'eventType': 8, 'timestamp': 1702349039, 'content': {'startTime': 1702349013, 'startReason': 0, 'liquid': 99, 'result': 0, 'fromClear': 1, 'liquidLack': False}, 'enumEventType': 'spray_over', 'userId': '100657138', 'subContent': []}, {'deviceId': 400003401, 'eventType': 5, 'timestamp': 1702350736, 'content': {'startTime': 1702350499, 'startReason': 0, 'litterPercent': 0, 'box': 0, 'result': 0, 'boxFull': False}, 'enumEventType': 'clean_over', 'userId': '100657138', 'subContent': []}]}, {'deviceId': 400003401, 'eventType': 10, 'timestamp': 1702359612, 'content': {'timeIn': 1702359554, 'timeOut': 1702359612, 'autoClear': 1, 'interval': 25, 'petWeight': 4622}, 'enumEventType': 'pet_out', 'userId': '100657138', 'petId': '100900992', 'subContent': [{'deviceId': 400003401, 'eventType': 8, 'timestamp': 1702359712, 'content': {'startTime': 1702359687, 'startReason': 0, 'liquid': 100, 'result': 0, 'fromClear': 1, 'liquidLack': False}, 'enumEventType': 'spray_over', 'userId': '100657138', 'subContent': []}], 'avatar': 'http://img5-us.petkit.cn/uavatar/2023/11/20/655a691aeb4f8d000b6c1d51IPRMLhiKV', 'petName': 'Rufa'}, {'deviceId': 400003401, 'eventType': 10, 'timestamp': 1702359673, 'content': {'timeIn': 1702359646, 'timeOut': 1702359673, 'autoClear': 1, 'interval': 25, 'petWeight': 4844}, 'enumEventType': 'pet_out', 'userId': '100657138', 'petId': '100900989', 'subContent': [{'deviceId': 400003401, 'eventType': 8, 'timestamp': 1702359712, 'content': {'startTime': 1702359687, 'startReason': 0, 'liquid': 100, 'result': 0, 'fromClear': 1, 'liquidLack': False}, 'enumEventType': 'spray_over', 'userId': '100657138', 'subContent': []}], 'avatar': 'http://img5-us.petkit.cn/uavatar/2023/11/20/655a68c28cb7a2000c1e7779HwWvM4xj2', 'petName': 'Simba'}, {'deviceId': 400003401, 'eventType': 10, 'timestamp': 1702359786, 'content': {'timeIn': 1702359731, 'timeOut': 1702359786, 'autoClear': 1, 'interval': 25, 'petWeight': 4423}, 'enumEventType': 'pet_out', 'userId': '100657138', 'petId': '100900992', 'subContent': [{'deviceId': 400003401, 'eventType': 8, 'timestamp': 1702359824, 'content': {'startTime': 1702359799, 'startReason': 0, 'liquid': 100, 'result': 0, 'fromClear': 1, 'liquidLack': False}, 'enumEventType': 'spray_over', 'userId': '100657138', 'subContent': []}], 'avatar': 'http://img5-us.petkit.cn/uavatar/2023/11/20/655a691aeb4f8d000b6c1d51IPRMLhiKV', 'petName': 'Rufa'}, {'deviceId': 400003401, 'eventType': 10, 'timestamp': 1702359965, 'content': {'timeIn': 1702359891, 'timeOut': 1702359965, 'autoClear': 1, 'interval': 25, 'petWeight': 4699}, 'enumEventType': 'pet_out', 'userId': '100657138', 'petId': '100900989', 'subContent': [], 'avatar': 'http://img5-us.petkit.cn/uavatar/2023/11/20/655a68c28cb7a2000c1e7779HwWvM4xj2', 'petName': 'Simba'}, {'deviceId': 400003401, 'eventType': 10, 'timestamp': 1702360090, 'content': {'timeIn': 1702359973, 'timeOut': 1702360090, 'autoClear': 1, 'interval': 25, 'petWeight': 4624}, 'enumEventType': 'pet_out', 'userId': '100657138', 'petId': '100900992', 'subContent': [{'deviceId': 400003401, 'eventType': 8, 'timestamp': 1702360128, 'content': {'startTime': 1702360096, 'startReason': 0, 'liquid': 100, 'result': 6, 'fromClear': 1, 'liquidLack': False}, 'enumEventType': 'spray_over', 'userId': '100657138', 'subContent': []}], 'avatar': 'http://img5-us.petkit.cn/uavatar/2023/11/20/655a691aeb4f8d000b6c1d51IPRMLhiKV', 'petName': 'Rufa'}], statistics={'statisticTime': '20231212', 'totalTime': 389, 'times': 6, 'avgTime': 64, 'statisticInfo': [{'statisticDate': '20231212', 'petTimes': 1, 'petTotalTime': 58, 'petWeight': 4661, 'petId': '0', 'petName': '', 'xTime': 13340}, {'statisticDate': '20231212', 'petTimes': 1, 'petTotalTime': 58, 'petWeight': 4622, 'petId': '100900992', 'petName': 'Rufa', 'xTime': 23954}, {'statisticDate': '20231212', 'petTimes': 1, 'petTotalTime': 27, 'petWeight': 4844, 'petId': '100900989', 'petName': 'Simba', 'xTime': 24046}, {'statisticDate': '20231212', 'petTimes': 1, 'petTotalTime': 55, 'petWeight': 4423, 'petId': '100900992', 'petName': 'Rufa', 'xTime': 24131}, {'statisticDate': '20231212', 'petTimes': 1, 'petTotalTime': 74, 'petWeight': 4699, 'petId': '100900989', 'petName': 'Simba', 'xTime': 24291}, {'statisticDate': '20231212', 'petTimes': 1, 'petTotalTime': 117, 'petWeight': 4624, 'petId': '100900992', 'petName': 'Rufa', 'xTime': 24373}], 'petIds': [{'id': '100900992', 'name': 'Rufa'}, {'id': '100900989', 'name': 'Simba'}, {'id': '0', 'name': ''}]}, type='t4', manually_paused=False, manual_pause_end=None)}, water_fountains={}, pets={100900989: Pet(id='100900989', data={'activeDegree': 0, 'avatar': 'http://img5-us.petkit.cn/uavatar/2023/11/20/655a68c28cb7a2000c1e7779HwWvM4xj2', 'birth': '2022-06-24', 'category': {'avatar': 'http://img5-us.petkit.cn/dogavatar/2017/8/10/598c150b98953a0fc0b2ad7eDHh42Ty1z', 'id': 10063, 'name': 'European Shorthair'}, 'createdAt': '2023-11-19T19:58:43.000Z', 'deviceCount': 0, 'emotion': 0, 'familyId': 300111542, 'femaleState': 0, 'gender': 1, 'id': '100900989', 'isRoyalCaninPet': 0, 'maleState': 1, 'name': 'Simba', 'owner': {'deviceCount': 0, 'id': '100657138', 'petCount': 0, 'userCount': 0}, 'size': {'id': 1, 'name': 'Standard'}, 'states': [], 'type': {'id': 2, 'name': 'Cat'}, 'updatedAt': '2023-11-20T04:39:45.000Z', 'weight': 4.918, 'weightControl': 3, 'weightControlTips': {}, 'weightLabel': 'Normal'}, type='Cat'), 100900992: Pet(id='100900992', data={'activeDegree': 0, 'avatar': 'http://img5-us.petkit.cn/uavatar/2023/11/20/655a691aeb4f8d000b6c1d51IPRMLhiKV', 'birth': '2022-04-24', 'category': {'avatar': 'http://img5-us.petkit.cn/dogavatar/2017/8/10/598c150b98953a0fc0b2ad7eDHh42Ty1z', 'id': 10063, 'name': 'European Shorthair'}, 'createdAt': '2023-11-19T19:59:49.000Z', 'deviceCount': 0, 'emotion': 0, 'familyId': 300111542, 'femaleState': 1, 'gender': 2, 'id': '100900992', 'isRoyalCaninPet': 0, 'maleState': 0, 'name': 'Rufa', 'owner': {'deviceCount': 0, 'id': '100657138', 'petCount': 0, 'userCount': 0}, 'size': {'id': 1, 'name': 'Standard'}, 'states': [], 'type': {'id': 2, 'name': 'Cat'}, 'updatedAt': '2023-11-24T11:07:21.000Z', 'weight': 4.424, 'weightControl': 3, 'weightControlTips': {}, 'weightLabel': 'Normal'}, type='Cat')}, purifiers={})
2023-12-12 07:13:26.755 DEBUG (MainThread) [custom_components.petkit] Finished fetching petkit data in 0.435 seconds (success: True)
2023-12-12 07:15:26.807 DEBUG (MainThread) [custom_components.petkit] Found the following PetKit devices/pets: PetKitData(user_id='100657138', feeders={}, litter_boxes={400003401: LitterBox(id=400003401, device_detail={'id': 400003401, 'mac': 'b8d61a75b3d8', 'sn': '20230603L22203', 'secret': '20837b82cb22184f', 'createdAt': '2023-09-06T14:43:57.937+0000', 'name': 'Kackiklo', 'hardware': 1, 'firmware': '1.456', 'firmwareDetails': [{'module': 'userbin', 'version': 2310010}, {'module': 'pics', 'version': 2220001}, {'module': 'lans', 'version': 2245001}], 'timezone': 1.0, 'signupAt': '2023-12-12T05:46:23.874+0000', 'locale': 'Europe/Berlin', 'user': {'id': '100657138', 'nick': 'SebastianMAIN', 'gender': 3, 'avatar': 'http://sandbox.img5.petkit.cn/banner/2022/10/13/6347d75a44ad08000b011e7dDzwc693i5', 'point': {'honour': 'LV0', 'rank': 0, 'growth': 15, 'icon': 'http://img5-us.petkit.cn/misc/point/n0', 'icon2': 'http://img5-us.petkit.cn/misc/point/l0', 'startGrowth': 0, 'endGrowth': 50}}, 'shareOpen': 1, 'autoUpgrade': 1, 'relation': {'userId': '100657138'}, 'withK3': 1, 'k3Id': 400002990, 'btMac': 'b8d61a75b3da', 'settings': {'litterFullNotify': 1, 'lackSandNotify': 1, 'workNotify': 1, 'petInNotify': 0, 'lackLiquidNotify': 1, 'deodorantNotify': 1, 'sandType': 1, 'manualLock': 0, 'lightMode': 1, 'lightRange': [0, 1440], 'autoWork': 1, 'fixedTimeClear': 0, 'fixedTimeRefresh': 0, 'downpos': 1, 'deepRefresh': 0, 'weightPopup': 1, 'autoIntervalMin': 0, 'stillTime': 1500, 'unit': 0, 'language': 'de_DE', 'languageFollow': 0, 'softMode': 0, 'avoidRepeat': 1, 'underweight': 0, 'kitten': 0, 'kittenTipsTime': 0, 'stopTime': 600, 'languages': ['zh_CN', 'zh_TW', 'en_US', 'es_ES', 'ko_KR', 'it_IT', 'ja_JP', 'pt_PT', 'de_DE', 'fr_FR', 'ru_RU'], 'kittenPercent': 0.8, 'dumpSwitch': 1, 'autoRefresh': 1, 'disturbMode': 0, 'disturbRange': [1425, 465], 'relateK3Switch': 1, 'lightest': 3539, 'deepClean': 0, 'lightConfig': 1, 'bury': 1, 'lightMultiRange': [], 'disturbConfig': 2, 'distrubMultiRange': [[1425, 465]], 'controlSettings': 0}, 'k3Device': {'id': 400002990, 'mac': 'a4c138590d66', 'sn': '01230510M10822', 'secret': '86e940a0f45a', 'createdAt': '2023-09-06T14:48:52.000+0000', 'updateAt': '2023-12-12T06:14:03.000+0000', 'userId': '100657138', 'name': 'AIR SMART SPRAY', 'hardware': 1, 'firmware': 39, 'settings': {'liquidLackSwitch': 1, 'fixedTimeRefresh': 0}, 'timezone': 1.0, 'relation': {'userId': '100657138'}, 'relateT4': 400003401, 'battery': 94, 'liquid': 100, 'refreshing': 0, 'lighting': 0, 'voltage': 5910, 'liquidLack': 3}, 'petOutTip': 1, 'multiConfig': True, 'state': {'wifi': {'ssid': 'BuDu', 'bssid': '3ca62fa9a94d', 'rsq': -70}, 'pim': 1, 'ota': 0, 'overall': 1, 'workState': {'workMode': 0, 'workReason': 0, 'workProcess': 22, 'stopTime': 600, 'safeWarn': 0}, 'sandCorrect': 0, 'liquidReset': 0, 'sandWeight': 0, 'sandPercent': 0, 'usedTimes': 0, 'sandType': 1, 'sandStatus': 1, 'box': 0, 'liquid': 100, 'battery': 94, 'petInTime': 1702361643, 'power': 1, 'petError': True, 'deodorantLeftDays': 19, 'liquidLack': False, 'boxFull': False, 'liquidEmpty': False, 'sandLack': False, 'lowPower': False}, 'lastOutTime': 117, 'petOutRecords': [[13340, 58], [23954, 58], [24046, 27], [24131, 55], [24291, 74], [24373, 117]], 'inTimes': 6, 'totalTime': 4076, 'specialLitterAd': {'adDetailUrl': 'http://m.petkit.com/app/cat_litter.html', 'adSwitch': 0, 'adLinkUrl': 'https://m.tb.cn/h.f8XZ8IM?sm=846b3a', 'label': '跨年', 'labelUrl': 'http://sandbox.img5.petkit.cn/post/2021/12/7/61af3624a8c9cc16b23736e8ywX6LUO8P', 'labelName': '专用猫砂'}, 'maintenanceTime': 0, 'petInTipLimit': 15}, device_record=[{'deviceId': 400003401, 'eventType': 10, 'timestamp': 1702348998, 'content': {'timeIn': 1702348940, 'timeOut': 1702348998, 'autoClear': 1, 'interval': 25, 'petWeight': 4661}, 'enumEventType': 'pet_out', 'userId': '100657138', 'petId': '-2', 'subContent': [{'deviceId': 400003401, 'eventType': 8, 'timestamp': 1702349039, 'content': {'startTime': 1702349013, 'startReason': 0, 'liquid': 99, 'result': 0, 'fromClear': 1, 'liquidLack': False}, 'enumEventType': 'spray_over', 'userId': '100657138', 'subContent': []}, {'deviceId': 400003401, 'eventType': 5, 'timestamp': 1702350736, 'content': {'startTime': 1702350499, 'startReason': 0, 'litterPercent': 0, 'box': 0, 'result': 0, 'boxFull': False}, 'enumEventType': 'clean_over', 'userId': '100657138', 'subContent': []}]}, {'deviceId': 400003401, 'eventType': 10, 'timestamp': 1702359612, 'content': {'timeIn': 1702359554, 'timeOut': 1702359612, 'autoClear': 1, 'interval': 25, 'petWeight': 4622}, 'enumEventType': 'pet_out', 'userId': '100657138', 'petId': '100900992', 'subContent': [{'deviceId': 400003401, 'eventType': 8, 'timestamp': 1702359712, 'content': {'startTime': 1702359687, 'startReason': 0, 'liquid': 100, 'result': 0, 'fromClear': 1, 'liquidLack': False}, 'enumEventType': 'spray_over', 'userId': '100657138', 'subContent': []}], 'avatar': 'http://img5-us.petkit.cn/uavatar/2023/11/20/655a691aeb4f8d000b6c1d51IPRMLhiKV', 'petName': 'Rufa'}, {'deviceId': 400003401, 'eventType': 10, 'timestamp': 1702359673, 'content': {'timeIn': 1702359646, 'timeOut': 1702359673, 'autoClear': 1, 'interval': 25, 'petWeight': 4844}, 'enumEventType': 'pet_out', 'userId': '100657138', 'petId': '100900989', 'subContent': [{'deviceId': 400003401, 'eventType': 8, 'timestamp': 1702359712, 'content': {'startTime': 1702359687, 'startReason': 0, 'liquid': 100, 'result': 0, 'fromClear': 1, 'liquidLack': False}, 'enumEventType': 'spray_over', 'userId': '100657138', 'subContent': []}], 'avatar': 'http://img5-us.petkit.cn/uavatar/2023/11/20/655a68c28cb7a2000c1e7779HwWvM4xj2', 'petName': 'Simba'}, {'deviceId': 400003401, 'eventType': 10, 'timestamp': 1702359786, 'content': {'timeIn': 1702359731, 'timeOut': 1702359786, 'autoClear': 1, 'interval': 25, 'petWeight': 4423}, 'enumEventType': 'pet_out', 'userId': '100657138', 'petId': '100900992', 'subContent': [{'deviceId': 400003401, 'eventType': 8, 'timestamp': 1702359824, 'content': {'startTime': 1702359799, 'startReason': 0, 'liquid': 100, 'result': 0, 'fromClear': 1, 'liquidLack': False}, 'enumEventType': 'spray_over', 'userId': '100657138', 'subContent': []}], 'avatar': 'http://img5-us.petkit.cn/uavatar/2023/11/20/655a691aeb4f8d000b6c1d51IPRMLhiKV', 'petName': 'Rufa'}, {'deviceId': 400003401, 'eventType': 10, 'timestamp': 1702359965, 'content': {'timeIn': 1702359891, 'timeOut': 1702359965, 'autoClear': 1, 'interval': 25, 'petWeight': 4699}, 'enumEventType': 'pet_out', 'userId': '100657138', 'petId': '100900989', 'subContent': [], 'avatar': 'http://img5-us.petkit.cn/uavatar/2023/11/20/655a68c28cb7a2000c1e7779HwWvM4xj2', 'petName': 'Simba'}, {'deviceId': 400003401, 'eventType': 10, 'timestamp': 1702360090, 'content': {'timeIn': 1702359973, 'timeOut': 1702360090, 'autoClear': 1, 'interval': 25, 'petWeight': 4624}, 'enumEventType': 'pet_out', 'userId': '100657138', 'petId': '100900992', 'subContent': [{'deviceId': 400003401, 'eventType': 8, 'timestamp': 1702360128, 'content': {'startTime': 1702360096, 'startReason': 0, 'liquid': 100, 'result': 6, 'fromClear': 1, 'liquidLack': False}, 'enumEventType': 'spray_over', 'userId': '100657138', 'subContent': []}], 'avatar': 'http://img5-us.petkit.cn/uavatar/2023/11/20/655a691aeb4f8d000b6c1d51IPRMLhiKV', 'petName': 'Rufa'}], statistics={'statisticTime': '20231212', 'totalTime': 389, 'times': 6, 'avgTime': 64, 'statisticInfo': [{'statisticDate': '20231212', 'petTimes': 1, 'petTotalTime': 58, 'petWeight': 4661, 'petId': '0', 'petName': '', 'xTime': 13340}, {'statisticDate': '20231212', 'petTimes': 1, 'petTotalTime': 58, 'petWeight': 4622, 'petId': '100900992', 'petName': 'Rufa', 'xTime': 23954}, {'statisticDate': '20231212', 'petTimes': 1, 'petTotalTime': 27, 'petWeight': 4844, 'petId': '100900989', 'petName': 'Simba', 'xTime': 24046}, {'statisticDate': '20231212', 'petTimes': 1, 'petTotalTime': 55, 'petWeight': 4423, 'petId': '100900992', 'petName': 'Rufa', 'xTime': 24131}, {'statisticDate': '20231212', 'petTimes': 1, 'petTotalTime': 74, 'petWeight': 4699, 'petId': '100900989', 'petName': 'Simba', 'xTime': 24291}, {'statisticDate': '20231212', 'petTimes': 1, 'petTotalTime': 117, 'petWeight': 4624, 'petId': '100900992', 'petName': 'Rufa', 'xTime': 24373}], 'petIds': [{'id': '100900992', 'name': 'Rufa'}, {'id': '100900989', 'name': 'Simba'}, {'id': '0', 'name': ''}]}, type='t4', manually_paused=False, manual_pause_end=None)}, water_fountains={}, pets={100900989: Pet(id='100900989', data={'activeDegree': 0, 'avatar': 'http://img5-us.petkit.cn/uavatar/2023/11/20/655a68c28cb7a2000c1e7779HwWvM4xj2', 'birth': '2022-06-24', 'category': {'avatar': 'http://img5-us.petkit.cn/dogavatar/2017/8/10/598c150b98953a0fc0b2ad7eDHh42Ty1z', 'id': 10063, 'name': 'European Shorthair'}, 'createdAt': '2023-11-19T19:58:43.000Z', 'deviceCount': 0, 'emotion': 0, 'familyId': 300111542, 'femaleState': 0, 'gender': 1, 'id': '100900989', 'isRoyalCaninPet': 0, 'maleState': 1, 'name': 'Simba', 'owner': {'deviceCount': 0, 'id': '100657138', 'petCount': 0, 'userCount': 0}, 'size': {'id': 1, 'name': 'Standard'}, 'states': [], 'type': {'id': 2, 'name': 'Cat'}, 'updatedAt': '2023-11-20T04:39:45.000Z', 'weight': 4.918, 'weightControl': 3, 'weightControlTips': {}, 'weightLabel': 'Normal'}, type='Cat'), 100900992: Pet(id='100900992', data={'activeDegree': 0, 'avatar': 'http://img5-us.petkit.cn/uavatar/2023/11/20/655a691aeb4f8d000b6c1d51IPRMLhiKV', 'birth': '2022-04-24', 'category': {'avatar': 'http://img5-us.petkit.cn/dogavatar/2017/8/10/598c150b98953a0fc0b2ad7eDHh42Ty1z', 'id': 10063, 'name': 'European Shorthair'}, 'createdAt': '2023-11-19T19:59:49.000Z', 'deviceCount': 0, 'emotion': 0, 'familyId': 300111542, 'femaleState': 1, 'gender': 2, 'id': '100900992', 'isRoyalCaninPet': 0, 'maleState': 0, 'name': 'Rufa', 'owner': {'deviceCount': 0, 'id': '100657138', 'petCount': 0, 'userCount': 0}, 'size': {'id': 1, 'name': 'Standard'}, 'states': [], 'type': {'id': 2, 'name': 'Cat'}, 'updatedAt': '2023-11-24T11:07:21.000Z', 'weight': 4.424, 'weightControl': 3, 'weightControlTips': {}, 'weightLabel': 'Normal'}, type='Cat')}, purifiers={})
2023-12-12 07:15:26.807 DEBUG (MainThread) [custom_components.petkit] Finished fetching petkit data in 0.487 seconds (success: True)
2023-12-12 07:15:26.811 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 243, in _handle_refresh_interval
    await self._async_refresh(log_failures=True, scheduled=True)
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 399, in _async_refresh
    self.async_update_listeners()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 182, in async_update_listeners
    update_callback()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 479, in _handle_coordinator_update
    self.async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 745, in async_write_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 845, in _async_write_ha_state
    state, attr = self._async_generate_attributes()
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 786, in _async_generate_attributes
    state = self._stringify_state(available)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 751, in _stringify_state
    if (state := self.state) is None:
                 ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 501, in state
    value = self.native_value
            ^^^^^^^^^^^^^^^^^
  File "/config/custom_components/petkit/sensor.py", line 2874, in native_value
    if work_state['petInTime'] == 0:
       ~~~~~~~~~~^^^^^^^^^^^^^
KeyError: 'petInTime'
2023-12-12 07:17:26.879 DEBUG (MainThread) [custom_components.petkit] Found the following PetKit devices/pets: PetKitData(user_id='100657138', feeders={}, litter_boxes={400003401: LitterBox(id=400003401, device_detail={'id': 400003401, 'mac': 'b8d61a75b3d8', 'sn': '20230603L22203', 'secret': '20837b82cb22184f', 'createdAt': '2023-09-06T14:43:57.937+0000', 'name': 'Kackiklo', 'hardware': 1, 'firmware': '1.456', 'firmwareDetails': [{'module': 'userbin', 'version': 2310010}, {'module': 'pics', 'version': 2220001}, {'module': 'lans', 'version': 2245001}], 'timezone': 1.0, 'signupAt': '2023-12-12T05:46:23.874+0000', 'locale': 'Europe/Berlin', 'user': {'id': '100657138', 'nick': 'SebastianMAIN', 'gender': 3, 'avatar': 'http://sandbox.img5.petkit.cn/banner/2022/10/13/6347d75a44ad08000b011e7dDzwc693i5', 'point': {'honour': 'LV0', 'rank': 0, 'growth': 15, 'icon': 'http://img5-us.petkit.cn/misc/point/n0', 'icon2': 'http://img5-us.petkit.cn/misc/point/l0', 'startGrowth': 0, 'endGrowth': 50}}, 'shareOpen': 1, 'autoUpgrade': 1, 'relation': {'userId': '100657138'}, 'withK3': 1, 'k3Id': 400002990, 'btMac': 'b8d61a75b3da', 'settings': {'litterFullNotify': 1, 'lackSandNotify': 1, 'workNotify': 1, 'petInNotify': 0, 'lackLiquidNotify': 1, 'deodorantNotify': 1, 'sandType': 1, 'manualLock': 0, 'lightMode': 1, 'lightRange': [0, 1440], 'autoWork': 1, 'fixedTimeClear': 0, 'fixedTimeRefresh': 0, 'downpos': 1, 'deepRefresh': 0, 'weightPopup': 1, 'autoIntervalMin': 0, 'stillTime': 1500, 'unit': 0, 'language': 'de_DE', 'languageFollow': 0, 'softMode': 0, 'avoidRepeat': 1, 'underweight': 0, 'kitten': 0, 'kittenTipsTime': 0, 'stopTime': 600, 'languages': ['zh_CN', 'zh_TW', 'en_US', 'es_ES', 'ko_KR', 'it_IT', 'ja_JP', 'pt_PT', 'de_DE', 'fr_FR', 'ru_RU'], 'kittenPercent': 0.8, 'dumpSwitch': 1, 'autoRefresh': 1, 'disturbMode': 0, 'disturbRange': [1425, 465], 'relateK3Switch': 1, 'lightest': 3539, 'deepClean': 0, 'lightConfig': 1, 'bury': 1, 'lightMultiRange': [], 'disturbConfig': 2, 'distrubMultiRange': [[1425, 465]], 'controlSettings': 0}, 'k3Device': {'id': 400002990, 'mac': 'a4c138590d66', 'sn': '01230510M10822', 'secret': '86e940a0f45a', 'createdAt': '2023-09-06T14:48:52.000+0000', 'updateAt': '2023-12-12T06:17:20.000+0000', 'userId': '100657138', 'name': 'AIR SMART SPRAY', 'hardware': 1, 'firmware': 39, 'settings': {'liquidLackSwitch': 1, 'fixedTimeRefresh': 0}, 'timezone': 1.0, 'relation': {'userId': '100657138'}, 'relateT4': 400003401, 'battery': 94, 'liquid': 100, 'refreshing': 0, 'lighting': 0, 'voltage': 5910, 'liquidLack': 3}, 'petOutTip': 1, 'multiConfig': True, 'state': {'wifi': {'ssid': 'BuDu', 'bssid': '3ca62fa9a94d', 'rsq': -70}, 'pim': 1, 'ota': 0, 'overall': 1, 'workState': {'workMode': 0, 'workReason': 0, 'workProcess': 14, 'stopTime': 600}, 'sandCorrect': 0, 'liquidReset': 0, 'sandWeight': 0, 'sandPercent': 0, 'usedTimes': 0, 'sandType': 1, 'sandStatus': 1, 'box': 0, 'liquid': 100, 'battery': 94, 'petInTime': 0, 'power': 1, 'petError': False, 'deodorantLeftDays': 19, 'liquidLack': False, 'boxFull': False, 'liquidEmpty': False, 'sandLack': False, 'lowPower': False}, 'lastOutTime': 117, 'petOutRecords': [[13340, 58], [23954, 58], [24046, 27], [24131, 55], [24291, 74], [24373, 117]], 'inTimes': 6, 'totalTime': 4076, 'specialLitterAd': {'adDetailUrl': 'http://m.petkit.com/app/cat_litter.html', 'adSwitch': 0, 'adLinkUrl': 'https://m.tb.cn/h.f8XZ8IM?sm=846b3a', 'label': '跨年', 'labelUrl': 'http://sandbox.img5.petkit.cn/post/2021/12/7/61af3624a8c9cc16b23736e8ywX6LUO8P', 'labelName': '专用猫砂'}, 'maintenanceTime': 0, 'petInTipLimit': 15}, device_record=[{'deviceId': 400003401, 'eventType': 10, 'timestamp': 1702348998, 'content': {'timeIn': 1702348940, 'timeOut': 1702348998, 'autoClear': 1, 'interval': 25, 'petWeight': 4661}, 'enumEventType': 'pet_out', 'userId': '100657138', 'petId': '-2', 'subContent': [{'deviceId': 400003401, 'eventType': 8, 'timestamp': 1702349039, 'content': {'startTime': 1702349013, 'startReason': 0, 'liquid': 99, 'result': 0, 'fromClear': 1, 'liquidLack': False}, 'enumEventType': 'spray_over', 'userId': '100657138', 'subContent': []}, {'deviceId': 400003401, 'eventType': 5, 'timestamp': 1702350736, 'content': {'startTime': 1702350499, 'startReason': 0, 'litterPercent': 0, 'box': 0, 'result': 0, 'boxFull': False}, 'enumEventType': 'clean_over', 'userId': '100657138', 'subContent': []}]}, {'deviceId': 400003401, 'eventType': 10, 'timestamp': 1702359612, 'content': {'timeIn': 1702359554, 'timeOut': 1702359612, 'autoClear': 1, 'interval': 25, 'petWeight': 4622}, 'enumEventType': 'pet_out', 'userId': '100657138', 'petId': '100900992', 'subContent': [{'deviceId': 400003401, 'eventType': 8, 'timestamp': 1702359712, 'content': {'startTime': 1702359687, 'startReason': 0, 'liquid': 100, 'result': 0, 'fromClear': 1, 'liquidLack': False}, 'enumEventType': 'spray_over', 'userId': '100657138', 'subContent': []}], 'avatar': 'http://img5-us.petkit.cn/uavatar/2023/11/20/655a691aeb4f8d000b6c1d51IPRMLhiKV', 'petName': 'Rufa'}, {'deviceId': 400003401, 'eventType': 10, 'timestamp': 1702359673, 'content': {'timeIn': 1702359646, 'timeOut': 1702359673, 'autoClear': 1, 'interval': 25, 'petWeight': 4844}, 'enumEventType': 'pet_out', 'userId': '100657138', 'petId': '100900989', 'subContent': [{'deviceId': 400003401, 'eventType': 8, 'timestamp': 1702359712, 'content': {'startTime': 1702359687, 'startReason': 0, 'liquid': 100, 'result': 0, 'fromClear': 1, 'liquidLack': False}, 'enumEventType': 'spray_over', 'userId': '100657138', 'subContent': []}], 'avatar': 'http://img5-us.petkit.cn/uavatar/2023/11/20/655a68c28cb7a2000c1e7779HwWvM4xj2', 'petName': 'Simba'}, {'deviceId': 400003401, 'eventType': 10, 'timestamp': 1702359786, 'content': {'timeIn': 1702359731, 'timeOut': 1702359786, 'autoClear': 1, 'interval': 25, 'petWeight': 4423}, 'enumEventType': 'pet_out', 'userId': '100657138', 'petId': '100900992', 'subContent': [{'deviceId': 400003401, 'eventType': 8, 'timestamp': 1702359824, 'content': {'startTime': 1702359799, 'startReason': 0, 'liquid': 100, 'result': 0, 'fromClear': 1, 'liquidLack': False}, 'enumEventType': 'spray_over', 'userId': '100657138', 'subContent': []}], 'avatar': 'http://img5-us.petkit.cn/uavatar/2023/11/20/655a691aeb4f8d000b6c1d51IPRMLhiKV', 'petName': 'Rufa'}, {'deviceId': 400003401, 'eventType': 10, 'timestamp': 1702359965, 'content': {'timeIn': 1702359891, 'timeOut': 1702359965, 'autoClear': 1, 'interval': 25, 'petWeight': 4699}, 'enumEventType': 'pet_out', 'userId': '100657138', 'petId': '100900989', 'subContent': [], 'avatar': 'http://img5-us.petkit.cn/uavatar/2023/11/20/655a68c28cb7a2000c1e7779HwWvM4xj2', 'petName': 'Simba'}, {'deviceId': 400003401, 'eventType': 10, 'timestamp': 1702360090, 'content': {'timeIn': 1702359973, 'timeOut': 1702360090, 'autoClear': 1, 'interval': 25, 'petWeight': 4624}, 'enumEventType': 'pet_out', 'userId': '100657138', 'petId': '100900992', 'subContent': [{'deviceId': 400003401, 'eventType': 8, 'timestamp': 1702360128, 'content': {'startTime': 1702360096, 'startReason': 0, 'liquid': 100, 'result': 6, 'fromClear': 1, 'liquidLack': False}, 'enumEventType': 'spray_over', 'userId': '100657138', 'subContent': []}], 'avatar': 'http://img5-us.petkit.cn/uavatar/2023/11/20/655a691aeb4f8d000b6c1d51IPRMLhiKV', 'petName': 'Rufa'}], statistics={'statisticTime': '20231212', 'totalTime': 389, 'times': 6, 'avgTime': 64, 'statisticInfo': [{'statisticDate': '20231212', 'petTimes': 1, 'petTotalTime': 58, 'petWeight': 4661, 'petId': '0', 'petName': '', 'xTime': 13340}, {'statisticDate': '20231212', 'petTimes': 1, 'petTotalTime': 58, 'petWeight': 4622, 'petId': '100900992', 'petName': 'Rufa', 'xTime': 23954}, {'statisticDate': '20231212', 'petTimes': 1, 'petTotalTime': 27, 'petWeight': 4844, 'petId': '100900989', 'petName': 'Simba', 'xTime': 24046}, {'statisticDate': '20231212', 'petTimes': 1, 'petTotalTime': 55, 'petWeight': 4423, 'petId': '100900992', 'petName': 'Rufa', 'xTime': 24131}, {'statisticDate': '20231212', 'petTimes': 1, 'petTotalTime': 74, 'petWeight': 4699, 'petId': '100900989', 'petName': 'Simba', 'xTime': 24291}, {'statisticDate': '20231212', 'petTimes': 1, 'petTotalTime': 117, 'petWeight': 4624, 'petId': '100900992', 'petName': 'Rufa', 'xTime': 24373}], 'petIds': [{'id': '100900992', 'name': 'Rufa'}, {'id': '100900989', 'name': 'Simba'}, {'id': '0', 'name': ''}]}, type='t4', manually_paused=False, manual_pause_end=None)}, water_fountains={}, pets={100900989: Pet(id='100900989', data={'activeDegree': 0, 'avatar': 'http://img5-us.petkit.cn/uavatar/2023/11/20/655a68c28cb7a2000c1e7779HwWvM4xj2', 'birth': '2022-06-24', 'category': {'avatar': 'http://img5-us.petkit.cn/dogavatar/2017/8/10/598c150b98953a0fc0b2ad7eDHh42Ty1z', 'id': 10063, 'name': 'European Shorthair'}, 'createdAt': '2023-11-19T19:58:43.000Z', 'deviceCount': 0, 'emotion': 0, 'familyId': 300111542, 'femaleState': 0, 'gender': 1, 'id': '100900989', 'isRoyalCaninPet': 0, 'maleState': 1, 'name': 'Simba', 'owner': {'deviceCount': 0, 'id': '100657138', 'petCount': 0, 'userCount': 0}, 'size': {'id': 1, 'name': 'Standard'}, 'states': [], 'type': {'id': 2, 'name': 'Cat'}, 'updatedAt': '2023-11-20T04:39:45.000Z', 'weight': 4.918, 'weightControl': 3, 'weightControlTips': {}, 'weightLabel': 'Normal'}, type='Cat'), 100900992: Pet(id='100900992', data={'activeDegree': 0, 'avatar': 'http://img5-us.petkit.cn/uavatar/2023/11/20/655a691aeb4f8d000b6c1d51IPRMLhiKV', 'birth': '2022-04-24', 'category': {'avatar': 'http://img5-us.petkit.cn/dogavatar/2017/8/10/598c150b98953a0fc0b2ad7eDHh42Ty1z', 'id': 10063, 'name': 'European Shorthair'}, 'createdAt': '2023-11-19T19:59:49.000Z', 'deviceCount': 0, 'emotion': 0, 'familyId': 300111542, 'femaleState': 1, 'gender': 2, 'id': '100900992', 'isRoyalCaninPet': 0, 'maleState': 0, 'name': 'Rufa', 'owner': {'deviceCount': 0, 'id': '100657138', 'petCount': 0, 'userCount': 0}, 'size': {'id': 1, 'name': 'Standard'}, 'states': [], 'type': {'id': 2, 'name': 'Cat'}, 'updatedAt': '2023-11-24T11:07:21.000Z', 'weight': 4.424, 'weightControl': 3, 'weightControlTips': {}, 'weightLabel': 'Normal'}, type='Cat')}, purifiers={})
2023-12-12 07:17:26.879 DEBUG (MainThread) [custom_components.petkit] Finished fetching petkit data in 0.560 seconds (success: True)
2023-12-12 07:19:26.834 DEBUG (MainThread) [custom_components.petkit] Found the following PetKit devices/pets: PetKitData(user_id='100657138', feeders={}, litter_boxes={400003401: LitterBox(id=400003401, device_detail={'id': 400003401, 'mac': 'b8d61a75b3d8', 'sn': '20230603L22203', 'secret': '20837b82cb22184f', 'createdAt': '2023-09-06T14:43:57.937+0000', 'name': 'Kackiklo', 'hardware': 1, 'firmware': '1.456', 'firmwareDetails': [{'module': 'userbin', 'version': 2310010}, {'module': 'pics', 'version': 2220001}, {'module': 'lans', 'version': 2245001}], 'timezone': 1.0, 'signupAt': '2023-12-12T05:46:23.874+0000', 'locale': 'Europe/Berlin', 'user': {'id': '100657138', 'nick': 'SebastianMAIN', 'gender': 3, 'avatar': 'http://sandbox.img5.petkit.cn/banner/2022/10/13/6347d75a44ad08000b011e7dDzwc693i5', 'point': {'honour': 'LV0', 'rank': 0, 'growth': 15, 'icon': 'http://img5-us.petkit.cn/misc/point/n0', 'icon2': 'http://img5-us.petkit.cn/misc/point/l0', 'startGrowth': 0, 'endGrowth': 50}}, 'shareOpen': 1, 'autoUpgrade': 1, 'relation': {'userId': '100657138'}, 'withK3': 1, 'k3Id': 400002990, 'btMac': 'b8d61a75b3da', 'settings': {'litterFullNotify': 1, 'lackSandNotify': 1, 'workNotify': 1, 'petInNotify': 0, 'lackLiquidNotify': 1, 'deodorantNotify': 1, 'sandType': 1, 'manualLock': 0, 'lightMode': 1, 'lightRange': [0, 1440], 'autoWork': 1, 'fixedTimeClear': 0, 'fixedTimeRefresh': 0, 'downpos': 1, 'deepRefresh': 0, 'weightPopup': 1, 'autoIntervalMin': 0, 'stillTime': 1500, 'unit': 0, 'language': 'de_DE', 'languageFollow': 0, 'softMode': 0, 'avoidRepeat': 1, 'underweight': 0, 'kitten': 0, 'kittenTipsTime': 0, 'stopTime': 600, 'languages': ['zh_CN', 'zh_TW', 'en_US', 'es_ES', 'ko_KR', 'it_IT', 'ja_JP', 'pt_PT', 'de_DE', 'fr_FR', 'ru_RU'], 'kittenPercent': 0.8, 'dumpSwitch': 1, 'autoRefresh': 1, 'disturbMode': 0, 'disturbRange': [1425, 465], 'relateK3Switch': 1, 'lightest': 3539, 'deepClean': 0, 'lightConfig': 1, 'bury': 1, 'lightMultiRange': [], 'disturbConfig': 2, 'distrubMultiRange': [[1425, 465]], 'controlSettings': 0}, 'k3Device': {'id': 400002990, 'mac': 'a4c138590d66', 'sn': '01230510M10822', 'secret': '86e940a0f45a', 'createdAt': '2023-09-06T14:48:52.000+0000', 'updateAt': '2023-12-12T06:17:20.000+0000', 'userId': '100657138', 'name': 'AIR SMART SPRAY', 'hardware': 1, 'firmware': 39, 'settings': {'liquidLackSwitch': 1, 'fixedTimeRefresh': 0}, 'timezone': 1.0, 'relation': {'userId': '100657138'}, 'relateT4': 400003401, 'battery': 94, 'liquid': 100, 'refreshing': 0, 'lighting': 0, 'voltage': 5910, 'liquidLack': 3}, 'petOutTip': 1, 'multiConfig': True, 'state': {'wifi': {'ssid': 'BuDu', 'bssid': '3ca62fa9a94d', 'rsq': -70}, 'pim': 1, 'ota': 0, 'overall': 1, 'workState': {'workMode': 0, 'workReason': 0, 'workProcess': 14, 'stopTime': 600}, 'sandCorrect': 0, 'liquidReset': 0, 'sandWeight': 0, 'sandPercent': 0, 'usedTimes': 0, 'sandType': 1, 'sandStatus': 1, 'box': 0, 'liquid': 100, 'battery': 94, 'petInTime': 0, 'power': 1, 'petError': False, 'deodorantLeftDays': 19, 'liquidLack': False, 'boxFull': False, 'liquidEmpty': False, 'sandLack': False, 'lowPower': False}, 'lastOutTime': 117, 'petOutRecords': [[13340, 58], [23954, 58], [24046, 27], [24131, 55], [24291, 74], [24373, 117]], 'inTimes': 6, 'totalTime': 4076, 'specialLitterAd': {'adDetailUrl': 'http://m.petkit.com/app/cat_litter.html', 'adSwitch': 0, 'adLinkUrl': 'https://m.tb.cn/h.f8XZ8IM?sm=846b3a', 'label': '跨年', 'labelUrl': 'http://sandbox.img5.petkit.cn/post/2021/12/7/61af3624a8c9cc16b23736e8ywX6LUO8P', 'labelName': '专用猫砂'}, 'maintenanceTime': 0, 'petInTipLimit': 15}, device_record=[{'deviceId': 400003401, 'eventType': 10, 'timestamp': 1702348998, 'content': {'timeIn': 1702348940, 'timeOut': 1702348998, 'autoClear': 1, 'interval': 25, 'petWeight': 4661}, 'enumEventType': 'pet_out', 'userId': '100657138', 'petId': '-2', 'subContent': [{'deviceId': 400003401, 'eventType': 8, 'timestamp': 1702349039, 'content': {'startTime': 1702349013, 'startReason': 0, 'liquid': 99, 'result': 0, 'fromClear': 1, 'liquidLack': False}, 'enumEventType': 'spray_over', 'userId': '100657138', 'subContent': []}, {'deviceId': 400003401, 'eventType': 5, 'timestamp': 1702350736, 'content': {'startTime': 1702350499, 'startReason': 0, 'litterPercent': 0, 'box': 0, 'result': 0, 'boxFull': False}, 'enumEventType': 'clean_over', 'userId': '100657138', 'subContent': []}]}, {'deviceId': 400003401, 'eventType': 10, 'timestamp': 1702359612, 'content': {'timeIn': 1702359554, 'timeOut': 1702359612, 'autoClear': 1, 'interval': 25, 'petWeight': 4622}, 'enumEventType': 'pet_out', 'userId': '100657138', 'petId': '100900992', 'subContent': [{'deviceId': 400003401, 'eventType': 8, 'timestamp': 1702359712, 'content': {'startTime': 1702359687, 'startReason': 0, 'liquid': 100, 'result': 0, 'fromClear': 1, 'liquidLack': False}, 'enumEventType': 'spray_over', 'userId': '100657138', 'subContent': []}], 'avatar': 'http://img5-us.petkit.cn/uavatar/2023/11/20/655a691aeb4f8d000b6c1d51IPRMLhiKV', 'petName': 'Rufa'}, {'deviceId': 400003401, 'eventType': 10, 'timestamp': 1702359673, 'content': {'timeIn': 1702359646, 'timeOut': 1702359673, 'autoClear': 1, 'interval': 25, 'petWeight': 4844}, 'enumEventType': 'pet_out', 'userId': '100657138', 'petId': '100900989', 'subContent': [{'deviceId': 400003401, 'eventType': 8, 'timestamp': 1702359712, 'content': {'startTime': 1702359687, 'startReason': 0, 'liquid': 100, 'result': 0, 'fromClear': 1, 'liquidLack': False}, 'enumEventType': 'spray_over', 'userId': '100657138', 'subContent': []}], 'avatar': 'http://img5-us.petkit.cn/uavatar/2023/11/20/655a68c28cb7a2000c1e7779HwWvM4xj2', 'petName': 'Simba'}, {'deviceId': 400003401, 'eventType': 10, 'timestamp': 1702359786, 'content': {'timeIn': 1702359731, 'timeOut': 1702359786, 'autoClear': 1, 'interval': 25, 'petWeight': 4423}, 'enumEventType': 'pet_out', 'userId': '100657138', 'petId': '100900992', 'subContent': [{'deviceId': 400003401, 'eventType': 8, 'timestamp': 1702359824, 'content': {'startTime': 1702359799, 'startReason': 0, 'liquid': 100, 'result': 0, 'fromClear': 1, 'liquidLack': False}, 'enumEventType': 'spray_over', 'userId': '100657138', 'subContent': []}], 'avatar': 'http://img5-us.petkit.cn/uavatar/2023/11/20/655a691aeb4f8d000b6c1d51IPRMLhiKV', 'petName': 'Rufa'}, {'deviceId': 400003401, 'eventType': 10, 'timestamp': 1702359965, 'content': {'timeIn': 1702359891, 'timeOut': 1702359965, 'autoClear': 1, 'interval': 25, 'petWeight': 4699}, 'enumEventType': 'pet_out', 'userId': '100657138', 'petId': '100900989', 'subContent': [], 'avatar': 'http://img5-us.petkit.cn/uavatar/2023/11/20/655a68c28cb7a2000c1e7779HwWvM4xj2', 'petName': 'Simba'}, {'deviceId': 400003401, 'eventType': 10, 'timestamp': 1702360090, 'content': {'timeIn': 1702359973, 'timeOut': 1702360090, 'autoClear': 1, 'interval': 25, 'petWeight': 4624}, 'enumEventType': 'pet_out', 'userId': '100657138', 'petId': '100900992', 'subContent': [{'deviceId': 400003401, 'eventType': 8, 'timestamp': 1702360128, 'content': {'startTime': 1702360096, 'startReason': 0, 'liquid': 100, 'result': 6, 'fromClear': 1, 'liquidLack': False}, 'enumEventType': 'spray_over', 'userId': '100657138', 'subContent': []}], 'avatar': 'http://img5-us.petkit.cn/uavatar/2023/11/20/655a691aeb4f8d000b6c1d51IPRMLhiKV', 'petName': 'Rufa'}], statistics={'statisticTime': '20231212', 'totalTime': 389, 'times': 6, 'avgTime': 64, 'statisticInfo': [{'statisticDate': '20231212', 'petTimes': 1, 'petTotalTime': 58, 'petWeight': 4661, 'petId': '0', 'petName': '', 'xTime': 13340}, {'statisticDate': '20231212', 'petTimes': 1, 'petTotalTime': 58, 'petWeight': 4622, 'petId': '100900992', 'petName': 'Rufa', 'xTime': 23954}, {'statisticDate': '20231212', 'petTimes': 1, 'petTotalTime': 27, 'petWeight': 4844, 'petId': '100900989', 'petName': 'Simba', 'xTime': 24046}, {'statisticDate': '20231212', 'petTimes': 1, 'petTotalTime': 55, 'petWeight': 4423, 'petId': '100900992', 'petName': 'Rufa', 'xTime': 24131}, {'statisticDate': '20231212', 'petTimes': 1, 'petTotalTime': 74, 'petWeight': 4699, 'petId': '100900989', 'petName': 'Simba', 'xTime': 24291}, {'statisticDate': '20231212', 'petTimes': 1, 'petTotalTime': 117, 'petWeight': 4624, 'petId': '100900992', 'petName': 'Rufa', 'xTime': 24373}], 'petIds': [{'id': '100900992', 'name': 'Rufa'}, {'id': '100900989', 'name': 'Simba'}, {'id': '0', 'name': ''}]}, type='t4', manually_paused=False, manual_pause_end=None)}, water_fountains={}, pets={100900989: Pet(id='100900989', data={'activeDegree': 0, 'avatar': 'http://img5-us.petkit.cn/uavatar/2023/11/20/655a68c28cb7a2000c1e7779HwWvM4xj2', 'birth': '2022-06-24', 'category': {'avatar': 'http://img5-us.petkit.cn/dogavatar/2017/8/10/598c150b98953a0fc0b2ad7eDHh42Ty1z', 'id': 10063, 'name': 'European Shorthair'}, 'createdAt': '2023-11-19T19:58:43.000Z', 'deviceCount': 0, 'emotion': 0, 'familyId': 300111542, 'femaleState': 0, 'gender': 1, 'id': '100900989', 'isRoyalCaninPet': 0, 'maleState': 1, 'name': 'Simba', 'owner': {'deviceCount': 0, 'id': '100657138', 'petCount': 0, 'userCount': 0}, 'size': {'id': 1, 'name': 'Standard'}, 'states': [], 'type': {'id': 2, 'name': 'Cat'}, 'updatedAt': '2023-11-20T04:39:45.000Z', 'weight': 4.918, 'weightControl': 3, 'weightControlTips': {}, 'weightLabel': 'Normal'}, type='Cat'), 100900992: Pet(id='100900992', data={'activeDegree': 0, 'avatar': 'http://img5-us.petkit.cn/uavatar/2023/11/20/655a691aeb4f8d000b6c1d51IPRMLhiKV', 'birth': '2022-04-24', 'category': {'avatar': 'http://img5-us.petkit.cn/dogavatar/2017/8/10/598c150b98953a0fc0b2ad7eDHh42Ty1z', 'id': 10063, 'name': 'European Shorthair'}, 'createdAt': '2023-11-19T19:59:49.000Z', 'deviceCount': 0, 'emotion': 0, 'familyId': 300111542, 'femaleState': 1, 'gender': 2, 'id': '100900992', 'isRoyalCaninPet': 0, 'maleState': 0, 'name': 'Rufa', 'owner': {'deviceCount': 0, 'id': '100657138', 'petCount': 0, 'userCount': 0}, 'size': {'id': 1, 'name': 'Standard'}, 'states': [], 'type': {'id': 2, 'name': 'Cat'}, 'updatedAt': '2023-11-24T11:07:21.000Z', 'weight': 4.424, 'weightControl': 3, 'weightControlTips': {}, 'weightLabel': 'Normal'}, type='Cat')}, purifiers={})
2023-12-12 07:19:26.835 DEBUG (MainThread) [custom_components.petkit] Finished fetching petkit data in 0.514 seconds (success: True)
2023-12-12 07:21:26.797 DEBUG (MainThread) [custom_components.petkit] Found the following PetKit devices/pets: PetKitData(user_id='100657138', feeders={}, litter_boxes={400003401: LitterBox(id=400003401, device_detail={'id': 400003401, 'mac': 'b8d61a75b3d8', 'sn': '20230603L22203', 'secret': '20837b82cb22184f', 'createdAt': '2023-09-06T14:43:57.937+0000', 'name': 'Kackiklo', 'hardware': 1, 'firmware': '1.456', 'firmwareDetails': [{'module': 'userbin', 'version': 2310010}, {'module': 'pics', 'version': 2220001}, {'module': 'lans', 'version': 2245001}], 'timezone': 1.0, 'signupAt': '2023-12-12T05:46:23.874+0000', 'locale': 'Europe/Berlin', 'user': {'id': '100657138', 'nick': 'SebastianMAIN', 'gender': 3, 'avatar': 'http://sandbox.img5.petkit.cn/banner/2022/10/13/6347d75a44ad08000b011e7dDzwc693i5', 'point': {'honour': 'LV0', 'rank': 0, 'growth': 15, 'icon': 'http://img5-us.petkit.cn/misc/point/n0', 'icon2': 'http://img5-us.petkit.cn/misc/point/l0', 'startGrowth': 0, 'endGrowth': 50}}, 'shareOpen': 1, 'autoUpgrade': 1, 'relation': {'userId': '100657138'}, 'withK3': 1, 'k3Id': 400002990, 'btMac': 'b8d61a75b3da', 'settings': {'litterFullNotify': 1, 'lackSandNotify': 1, 'workNotify': 1, 'petInNotify': 0, 'lackLiquidNotify': 1, 'deodorantNotify': 1, 'sandType': 1, 'manualLock': 0, 'lightMode': 1, 'lightRange': [0, 1440], 'autoWork': 1, 'fixedTimeClear': 0, 'fixedTimeRefresh': 0, 'downpos': 1, 'deepRefresh': 0, 'weightPopup': 1, 'autoIntervalMin': 0, 'stillTime': 1500, 'unit': 0, 'language': 'de_DE', 'languageFollow': 0, 'softMode': 0, 'avoidRepeat': 1, 'underweight': 0, 'kitten': 0, 'kittenTipsTime': 0, 'stopTime': 600, 'languages': ['zh_CN', 'zh_TW', 'en_US', 'es_ES', 'ko_KR', 'it_IT', 'ja_JP', 'pt_PT', 'de_DE', 'fr_FR', 'ru_RU'], 'kittenPercent': 0.8, 'dumpSwitch': 1, 'autoRefresh': 1, 'disturbMode': 0, 'disturbRange': [1425, 465], 'relateK3Switch': 1, 'lightest': 3539, 'deepClean': 0, 'lightConfig': 1, 'bury': 1, 'lightMultiRange': [], 'disturbConfig': 2, 'distrubMultiRange': [[1425, 465]], 'controlSettings': 0}, 'k3Device': {'id': 400002990, 'mac': 'a4c138590d66', 'sn': '01230510M10822', 'secret': '86e940a0f45a', 'createdAt': '2023-09-06T14:48:52.000+0000', 'updateAt': '2023-12-12T06:20:26.000+0000', 'userId': '100657138', 'name': 'AIR SMART SPRAY', 'hardware': 1, 'firmware': 39, 'settings': {'liquidLackSwitch': 1, 'fixedTimeRefresh': 0}, 'timezone': 1.0, 'relation': {'userId': '100657138'}, 'relateT4': 400003401, 'battery': 94, 'liquid': 100, 'refreshing': 0, 'lighting': 0, 'voltage': 5910, 'liquidLack': 3}, 'petOutTip': 1, 'multiConfig': True, 'state': {'wifi': {'ssid': 'BuDu', 'bssid': '3ca62fa9a94d', 'rsq': -70}, 'pim': 1, 'ota': 0, 'overall': 1, 'sandCorrect': 0, 'liquidReset': 0, 'sandWeight': 0, 'sandPercent': 0, 'usedTimes': 0, 'sandType': 1, 'sandStatus': 1, 'box': 0, 'liquid': 100, 'battery': 94, 'petInTime': 0, 'power': 1, 'petError': False, 'deodorantLeftDays': 19, 'liquidLack': False, 'boxFull': False, 'liquidEmpty': False, 'sandLack': False, 'lowPower': False}, 'lastOutTime': 117, 'petOutRecords': [[13340, 58], [23954, 58], [24046, 27], [24131, 55], [24291, 74], [24373, 117]], 'inTimes': 6, 'totalTime': 4076, 'specialLitterAd': {'adDetailUrl': 'http://m.petkit.com/app/cat_litter.html', 'adSwitch': 0, 'adLinkUrl': 'https://m.tb.cn/h.f8XZ8IM?sm=846b3a', 'label': '跨年', 'labelUrl': 'http://sandbox.img5.petkit.cn/post/2021/12/7/61af3624a8c9cc16b23736e8ywX6LUO8P', 'labelName': '专用猫砂'}, 'maintenanceTime': 0, 'petInTipLimit': 15}, device_record=[{'deviceId': 400003401, 'eventType': 10, 'timestamp': 1702348998, 'content': {'timeIn': 1702348940, 'timeOut': 1702348998, 'autoClear': 1, 'interval': 25, 'petWeight': 4661}, 'enumEventType': 'pet_out', 'userId': '100657138', 'petId': '-2', 'subContent': [{'deviceId': 400003401, 'eventType': 8, 'timestamp': 1702349039, 'content': {'startTime': 1702349013, 'startReason': 0, 'liquid': 99, 'result': 0, 'fromClear': 1, 'liquidLack': False}, 'enumEventType': 'spray_over', 'userId': '100657138', 'subContent': []}, {'deviceId': 400003401, 'eventType': 5, 'timestamp': 1702350736, 'content': {'startTime': 1702350499, 'startReason': 0, 'litterPercent': 0, 'box': 0, 'result': 0, 'boxFull': False}, 'enumEventType': 'clean_over', 'userId': '100657138', 'subContent': []}]}, {'deviceId': 400003401, 'eventType': 10, 'timestamp': 1702359612, 'content': {'timeIn': 1702359554, 'timeOut': 1702359612, 'autoClear': 1, 'interval': 25, 'petWeight': 4622}, 'enumEventType': 'pet_out', 'userId': '100657138', 'petId': '100900992', 'subContent': [{'deviceId': 400003401, 'eventType': 8, 'timestamp': 1702359712, 'content': {'startTime': 1702359687, 'startReason': 0, 'liquid': 100, 'result': 0, 'fromClear': 1, 'liquidLack': False}, 'enumEventType': 'spray_over', 'userId': '100657138', 'subContent': []}], 'avatar': 'http://img5-us.petkit.cn/uavatar/2023/11/20/655a691aeb4f8d000b6c1d51IPRMLhiKV', 'petName': 'Rufa'}, {'deviceId': 400003401, 'eventType': 10, 'timestamp': 1702359673, 'content': {'timeIn': 1702359646, 'timeOut': 1702359673, 'autoClear': 1, 'interval': 25, 'petWeight': 4844}, 'enumEventType': 'pet_out', 'userId': '100657138', 'petId': '100900989', 'subContent': [{'deviceId': 400003401, 'eventType': 8, 'timestamp': 1702359712, 'content': {'startTime': 1702359687, 'startReason': 0, 'liquid': 100, 'result': 0, 'fromClear': 1, 'liquidLack': False}, 'enumEventType': 'spray_over', 'userId': '100657138', 'subContent': []}], 'avatar': 'http://img5-us.petkit.cn/uavatar/2023/11/20/655a68c28cb7a2000c1e7779HwWvM4xj2', 'petName': 'Simba'}, {'deviceId': 400003401, 'eventType': 10, 'timestamp': 1702359786, 'content': {'timeIn': 1702359731, 'timeOut': 1702359786, 'autoClear': 1, 'interval': 25, 'petWeight': 4423}, 'enumEventType': 'pet_out', 'userId': '100657138', 'petId': '100900992', 'subContent': [{'deviceId': 400003401, 'eventType': 8, 'timestamp': 1702359824, 'content': {'startTime': 1702359799, 'startReason': 0, 'liquid': 100, 'result': 0, 'fromClear': 1, 'liquidLack': False}, 'enumEventType': 'spray_over', 'userId': '100657138', 'subContent': []}], 'avatar': 'http://img5-us.petkit.cn/uavatar/2023/11/20/655a691aeb4f8d000b6c1d51IPRMLhiKV', 'petName': 'Rufa'}, {'deviceId': 400003401, 'eventType': 10, 'timestamp': 1702359965, 'content': {'timeIn': 1702359891, 'timeOut': 1702359965, 'autoClear': 1, 'interval': 25, 'petWeight': 4699}, 'enumEventType': 'pet_out', 'userId': '100657138', 'petId': '100900989', 'subContent': [], 'avatar': 'http://img5-us.petkit.cn/uavatar/2023/11/20/655a68c28cb7a2000c1e7779HwWvM4xj2', 'petName': 'Simba'}, {'deviceId': 400003401, 'eventType': 10, 'timestamp': 1702360090, 'content': {'timeIn': 1702359973, 'timeOut': 1702360090, 'autoClear': 1, 'interval': 25, 'petWeight': 4624}, 'enumEventType': 'pet_out', 'userId': '100657138', 'petId': '100900992', 'subContent': [{'deviceId': 400003401, 'eventType': 8, 'timestamp': 1702360128, 'content': {'startTime': 1702360096, 'startReason': 0, 'liquid': 100, 'result': 6, 'fromClear': 1, 'liquidLack': False}, 'enumEventType': 'spray_over', 'userId': '100657138', 'subContent': []}, {'deviceId': 400003401, 'eventType': 5, 'timestamp': 1702362026, 'content': {'startTime': 1702361591, 'startReason': 0, 'litterPercent': 0, 'box': 0, 'result': 0, 'boxFull': False}, 'enumEventType': 'clean_over', 'userId': '100657138', 'subContent': []}], 'avatar': 'http://img5-us.petkit.cn/uavatar/2023/11/20/655a691aeb4f8d000b6c1d51IPRMLhiKV', 'petName': 'Rufa'}], statistics={'statisticTime': '20231212', 'totalTime': 389, 'times': 6, 'avgTime': 64, 'statisticInfo': [{'statisticDate': '20231212', 'petTimes': 1, 'petTotalTime': 58, 'petWeight': 4661, 'petId': '0', 'petName': '', 'xTime': 13340}, {'statisticDate': '20231212', 'petTimes': 1, 'petTotalTime': 58, 'petWeight': 4622, 'petId': '100900992', 'petName': 'Rufa', 'xTime': 23954}, {'statisticDate': '20231212', 'petTimes': 1, 'petTotalTime': 27, 'petWeight': 4844, 'petId': '100900989', 'petName': 'Simba', 'xTime': 24046}, {'statisticDate': '20231212', 'petTimes': 1, 'petTotalTime': 55, 'petWeight': 4423, 'petId': '100900992', 'petName': 'Rufa', 'xTime': 24131}, {'statisticDate': '20231212', 'petTimes': 1, 'petTotalTime': 74, 'petWeight': 4699, 'petId': '100900989', 'petName': 'Simba', 'xTime': 24291}, {'statisticDate': '20231212', 'petTimes': 1, 'petTotalTime': 117, 'petWeight': 4624, 'petId': '100900992', 'petName': 'Rufa', 'xTime': 24373}], 'petIds': [{'id': '100900992', 'name': 'Rufa'}, {'id': '100900989', 'name': 'Simba'}, {'id': '0', 'name': ''}]}, type='t4', manually_paused=False, manual_pause_end=None)}, water_fountains={}, pets={100900989: Pet(id='100900989', data={'activeDegree': 0, 'avatar': 'http://img5-us.petkit.cn/uavatar/2023/11/20/655a68c28cb7a2000c1e7779HwWvM4xj2', 'birth': '2022-06-24', 'category': {'avatar': 'http://img5-us.petkit.cn/dogavatar/2017/8/10/598c150b98953a0fc0b2ad7eDHh42Ty1z', 'id': 10063, 'name': 'European Shorthair'}, 'createdAt': '2023-11-19T19:58:43.000Z', 'deviceCount': 0, 'emotion': 0, 'familyId': 300111542, 'femaleState': 0, 'gender': 1, 'id': '100900989', 'isRoyalCaninPet': 0, 'maleState': 1, 'name': 'Simba', 'owner': {'deviceCount': 0, 'id': '100657138', 'petCount': 0, 'userCount': 0}, 'size': {'id': 1, 'name': 'Standard'}, 'states': [], 'type': {'id': 2, 'name': 'Cat'}, 'updatedAt': '2023-11-20T04:39:45.000Z', 'weight': 4.918, 'weightControl': 3, 'weightControlTips': {}, 'weightLabel': 'Normal'}, type='Cat'), 100900992: Pet(id='100900992', data={'activeDegree': 0, 'avatar': 'http://img5-us.petkit.cn/uavatar/2023/11/20/655a691aeb4f8d000b6c1d51IPRMLhiKV', 'birth': '2022-04-24', 'category': {'avatar': 'http://img5-us.petkit.cn/dogavatar/2017/8/10/598c150b98953a0fc0b2ad7eDHh42Ty1z', 'id': 10063, 'name': 'European Shorthair'}, 'createdAt': '2023-11-19T19:59:49.000Z', 'deviceCount': 0, 'emotion': 0, 'familyId': 300111542, 'femaleState': 1, 'gender': 2, 'id': '100900992', 'isRoyalCaninPet': 0, 'maleState': 0, 'name': 'Rufa', 'owner': {'deviceCount': 0, 'id': '100657138', 'petCount': 0, 'userCount': 0}, 'size': {'id': 1, 'name': 'Standard'}, 'states': [], 'type': {'id': 2, 'name': 'Cat'}, 'updatedAt': '2023-11-24T11:07:21.000Z', 'weight': 4.424, 'weightControl': 3, 'weightControlTips': {}, 'weightLabel': 'Normal'}, type='Cat')}, purifiers={})
2023-12-12 07:21:26.798 DEBUG (MainThread) [custom_components.petkit] Finished fetching petkit data in 0.478 seconds (success: True)
2023-12-12 07:23:26.790 DEBUG (MainThread) [custom_components.petkit] Found the following PetKit devices/pets: PetKitData(user_id='100657138', feeders={}, litter_boxes={400003401: LitterBox(id=400003401, device_detail={'id': 400003401, 'mac': 'b8d61a75b3d8', 'sn': '20230603L22203', 'secret': '20837b82cb22184f', 'createdAt': '2023-09-06T14:43:57.937+0000', 'name': 'Kackiklo', 'hardware': 1, 'firmware': '1.456', 'firmwareDetails': [{'module': 'userbin', 'version': 2310010}, {'module': 'pics', 'version': 2220001}, {'module': 'lans', 'version': 2245001}], 'timezone': 1.0, 'signupAt': '2023-12-12T05:46:23.874+0000', 'locale': 'Europe/Berlin', 'user': {'id': '100657138', 'nick': 'SebastianMAIN', 'gender': 3, 'avatar': 'http://sandbox.img5.petkit.cn/banner/2022/10/13/6347d75a44ad08000b011e7dDzwc693i5', 'point': {'honour': 'LV0', 'rank': 0, 'growth': 15, 'icon': 'http://img5-us.petkit.cn/misc/point/n0', 'icon2': 'http://img5-us.petkit.cn/misc/point/l0', 'startGrowth': 0, 'endGrowth': 50}}, 'shareOpen': 1, 'autoUpgrade': 1, 'relation': {'userId': '100657138'}, 'withK3': 1, 'k3Id': 400002990, 'btMac': 'b8d61a75b3da', 'settings': {'litterFullNotify': 1, 'lackSandNotify': 1, 'workNotify': 1, 'petInNotify': 0, 'lackLiquidNotify': 1, 'deodorantNotify': 1, 'sandType': 1, 'manualLock': 0, 'lightMode': 1, 'lightRange': [0, 1440], 'autoWork': 1, 'fixedTimeClear': 0, 'fixedTimeRefresh': 0, 'downpos': 1, 'deepRefresh': 0, 'weightPopup': 1, 'autoIntervalMin': 0, 'stillTime': 1500, 'unit': 0, 'language': 'de_DE', 'languageFollow': 0, 'softMode': 0, 'avoidRepeat': 1, 'underweight': 0, 'kitten': 0, 'kittenTipsTime': 0, 'stopTime': 600, 'languages': ['zh_CN', 'zh_TW', 'en_US', 'es_ES', 'ko_KR', 'it_IT', 'ja_JP', 'pt_PT', 'de_DE', 'fr_FR', 'ru_RU'], 'kittenPercent': 0.8, 'dumpSwitch': 1, 'autoRefresh': 1, 'disturbMode': 0, 'disturbRange': [1425, 465], 'relateK3Switch': 1, 'lightest': 3539, 'deepClean': 0, 'lightConfig': 1, 'bury': 1, 'lightMultiRange': [], 'disturbConfig': 2, 'distrubMultiRange': [[1425, 465]], 'controlSettings': 0}, 'k3Device': {'id': 400002990, 'mac': 'a4c138590d66', 'sn': '01230510M10822', 'secret': '86e940a0f45a', 'createdAt': '2023-09-06T14:48:52.000+0000', 'updateAt': '2023-12-12T06:23:04.000+0000', 'userId': '100657138', 'name': 'AIR SMART SPRAY', 'hardware': 1, 'firmware': 39, 'settings': {'liquidLackSwitch': 1, 'fixedTimeRefresh': 0}, 'timezone': 1.0, 'relation': {'userId': '100657138'}, 'relateT4': 400003401, 'battery': 94, 'liquid': 100, 'refreshing': 0, 'lighting': 0, 'voltage': 5910, 'liquidLack': 3}, 'petOutTip': 1, 'multiConfig': True, 'state': {'wifi': {'ssid': 'BuDu', 'bssid': '3ca62fa9a94d', 'rsq': -70}, 'pim': 1, 'ota': 0, 'overall': 1, 'workState': {'workMode': 9, 'workReason': 3, 'workProcess': 11, 'stopTime': 600}, 'sandCorrect': 0, 'liquidReset': 0, 'sandWeight': 0, 'sandPercent': 0, 'usedTimes': 0, 'sandType': 1, 'sandStatus': 1, 'box': 0, 'liquid': 100, 'battery': 94, 'petInTime': 0, 'power': 1, 'petError': False, 'deodorantLeftDays': 19, 'liquidLack': False, 'boxFull': False, 'liquidEmpty': False, 'sandLack': False, 'lowPower': False}, 'lastOutTime': 117, 'petOutRecords': [[13340, 58], [23954, 58], [24046, 27], [24131, 55], [24291, 74], [24373, 117]], 'inTimes': 6, 'totalTime': 4076, 'specialLitterAd': {'adDetailUrl': 'http://m.petkit.com/app/cat_litter.html', 'adSwitch': 0, 'adLinkUrl': 'https://m.tb.cn/h.f8XZ8IM?sm=846b3a', 'label': '跨年', 'labelUrl': 'http://sandbox.img5.petkit.cn/post/2021/12/7/61af3624a8c9cc16b23736e8ywX6LUO8P', 'labelName': '专用猫砂'}, 'maintenanceTime': 1702362184, 'petInTipLimit': 15}, device_record=[{'deviceId': 400003401, 'eventType': 10, 'timestamp': 1702348998, 'content': {'timeIn': 1702348940, 'timeOut': 1702348998, 'autoClear': 1, 'interval': 25, 'petWeight': 4661}, 'enumEventType': 'pet_out', 'userId': '100657138', 'petId': '-2', 'subContent': [{'deviceId': 400003401, 'eventType': 8, 'timestamp': 1702349039, 'content': {'startTime': 1702349013, 'startReason': 0, 'liquid': 99, 'result': 0, 'fromClear': 1, 'liquidLack': False}, 'enumEventType': 'spray_over', 'userId': '100657138', 'subContent': []}, {'deviceId': 400003401, 'eventType': 5, 'timestamp': 1702350736, 'content': {'startTime': 1702350499, 'startReason': 0, 'litterPercent': 0, 'box': 0, 'result': 0, 'boxFull': False}, 'enumEventType': 'clean_over', 'userId': '100657138', 'subContent': []}]}, {'deviceId': 400003401, 'eventType': 10, 'timestamp': 1702359612, 'content': {'timeIn': 1702359554, 'timeOut': 1702359612, 'autoClear': 1, 'interval': 25, 'petWeight': 4622}, 'enumEventType': 'pet_out', 'userId': '100657138', 'petId': '100900992', 'subContent': [{'deviceId': 400003401, 'eventType': 8, 'timestamp': 1702359712, 'content': {'startTime': 1702359687, 'startReason': 0, 'liquid': 100, 'result': 0, 'fromClear': 1, 'liquidLack': False}, 'enumEventType': 'spray_over', 'userId': '100657138', 'subContent': []}], 'avatar': 'http://img5-us.petkit.cn/uavatar/2023/11/20/655a691aeb4f8d000b6c1d51IPRMLhiKV', 'petName': 'Rufa'}, {'deviceId': 400003401, 'eventType': 10, 'timestamp': 1702359673, 'content': {'timeIn': 1702359646, 'timeOut': 1702359673, 'autoClear': 1, 'interval': 25, 'petWeight': 4844}, 'enumEventType': 'pet_out', 'userId': '100657138', 'petId': '100900989', 'subContent': [{'deviceId': 400003401, 'eventType': 8, 'timestamp': 1702359712, 'content': {'startTime': 1702359687, 'startReason': 0, 'liquid': 100, 'result': 0, 'fromClear': 1, 'liquidLack': False}, 'enumEventType': 'spray_over', 'userId': '100657138', 'subContent': []}], 'avatar': 'http://img5-us.petkit.cn/uavatar/2023/11/20/655a68c28cb7a2000c1e7779HwWvM4xj2', 'petName': 'Simba'}, {'deviceId': 400003401, 'eventType': 10, 'timestamp': 1702359786, 'content': {'timeIn': 1702359731, 'timeOut': 1702359786, 'autoClear': 1, 'interval': 25, 'petWeight': 4423}, 'enumEventType': 'pet_out', 'userId': '100657138', 'petId': '100900992', 'subContent': [{'deviceId': 400003401, 'eventType': 8, 'timestamp': 1702359824, 'content': {'startTime': 1702359799, 'startReason': 0, 'liquid': 100, 'result': 0, 'fromClear': 1, 'liquidLack': False}, 'enumEventType': 'spray_over', 'userId': '100657138', 'subContent': []}], 'avatar': 'http://img5-us.petkit.cn/uavatar/2023/11/20/655a691aeb4f8d000b6c1d51IPRMLhiKV', 'petName': 'Rufa'}, {'deviceId': 400003401, 'eventType': 10, 'timestamp': 1702359965, 'content': {'timeIn': 1702359891, 'timeOut': 1702359965, 'autoClear': 1, 'interval': 25, 'petWeight': 4699}, 'enumEventType': 'pet_out', 'userId': '100657138', 'petId': '100900989', 'subContent': [], 'avatar': 'http://img5-us.petkit.cn/uavatar/2023/11/20/655a68c28cb7a2000c1e7779HwWvM4xj2', 'petName': 'Simba'}, {'deviceId': 400003401, 'eventType': 10, 'timestamp': 1702360090, 'content': {'timeIn': 1702359973, 'timeOut': 1702360090, 'autoClear': 1, 'interval': 25, 'petWeight': 4624}, 'enumEventType': 'pet_out', 'userId': '100657138', 'petId': '100900992', 'subContent': [{'deviceId': 400003401, 'eventType': 8, 'timestamp': 1702360128, 'content': {'startTime': 1702360096, 'startReason': 0, 'liquid': 100, 'result': 6, 'fromClear': 1, 'liquidLack': False}, 'enumEventType': 'spray_over', 'userId': '100657138', 'subContent': []}, {'deviceId': 400003401, 'eventType': 5, 'timestamp': 1702362026, 'content': {'startTime': 1702361591, 'startReason': 0, 'litterPercent': 0, 'box': 0, 'result': 0, 'boxFull': False}, 'enumEventType': 'clean_over', 'userId': '100657138', 'subContent': []}], 'avatar': 'http://img5-us.petkit.cn/uavatar/2023/11/20/655a691aeb4f8d000b6c1d51IPRMLhiKV', 'petName': 'Rufa'}], statistics={'statisticTime': '20231212', 'totalTime': 389, 'times': 6, 'avgTime': 64, 'statisticInfo': [{'statisticDate': '20231212', 'petTimes': 1, 'petTotalTime': 58, 'petWeight': 4661, 'petId': '0', 'petName': '', 'xTime': 13340}, {'statisticDate': '20231212', 'petTimes': 1, 'petTotalTime': 58, 'petWeight': 4622, 'petId': '100900992', 'petName': 'Rufa', 'xTime': 23954}, {'statisticDate': '20231212', 'petTimes': 1, 'petTotalTime': 27, 'petWeight': 4844, 'petId': '100900989', 'petName': 'Simba', 'xTime': 24046}, {'statisticDate': '20231212', 'petTimes': 1, 'petTotalTime': 55, 'petWeight': 4423, 'petId': '100900992', 'petName': 'Rufa', 'xTime': 24131}, {'statisticDate': '20231212', 'petTimes': 1, 'petTotalTime': 74, 'petWeight': 4699, 'petId': '100900989', 'petName': 'Simba', 'xTime': 24291}, {'statisticDate': '20231212', 'petTimes': 1, 'petTotalTime': 117, 'petWeight': 4624, 'petId': '100900992', 'petName': 'Rufa', 'xTime': 24373}], 'petIds': [{'id': '100900992', 'name': 'Rufa'}, {'id': '100900989', 'name': 'Simba'}, {'id': '0', 'name': ''}]}, type='t4', manually_paused=False, manual_pause_end=None)}, water_fountains={}, pets={100900989: Pet(id='100900989', data={'activeDegree': 0, 'avatar': 'http://img5-us.petkit.cn/uavatar/2023/11/20/655a68c28cb7a2000c1e7779HwWvM4xj2', 'birth': '2022-06-24', 'category': {'avatar': 'http://img5-us.petkit.cn/dogavatar/2017/8/10/598c150b98953a0fc0b2ad7eDHh42Ty1z', 'id': 10063, 'name': 'European Shorthair'}, 'createdAt': '2023-11-19T19:58:43.000Z', 'deviceCount': 0, 'emotion': 0, 'familyId': 300111542, 'femaleState': 0, 'gender': 1, 'id': '100900989', 'isRoyalCaninPet': 0, 'maleState': 1, 'name': 'Simba', 'owner': {'deviceCount': 0, 'id': '100657138', 'petCount': 0, 'userCount': 0}, 'size': {'id': 1, 'name': 'Standard'}, 'states': [], 'type': {'id': 2, 'name': 'Cat'}, 'updatedAt': '2023-11-20T04:39:45.000Z', 'weight': 4.918, 'weightControl': 3, 'weightControlTips': {}, 'weightLabel': 'Normal'}, type='Cat'), 100900992: Pet(id='100900992', data={'activeDegree': 0, 'avatar': 'http://img5-us.petkit.cn/uavatar/2023/11/20/655a691aeb4f8d000b6c1d51IPRMLhiKV', 'birth': '2022-04-24', 'category': {'avatar': 'http://img5-us.petkit.cn/dogavatar/2017/8/10/598c150b98953a0fc0b2ad7eDHh42Ty1z', 'id': 10063, 'name': 'European Shorthair'}, 'createdAt': '2023-11-19T19:59:49.000Z', 'deviceCount': 0, 'emotion': 0, 'familyId': 300111542, 'femaleState': 1, 'gender': 2, 'id': '100900992', 'isRoyalCaninPet': 0, 'maleState': 0, 'name': 'Rufa', 'owner': {'deviceCount': 0, 'id': '100657138', 'petCount': 0, 'userCount': 0}, 'size': {'id': 1, 'name': 'Standard'}, 'states': [], 'type': {'id': 2, 'name': 'Cat'}, 'updatedAt': '2023-11-24T11:07:21.000Z', 'weight': 4.424, 'weightControl': 3, 'weightControlTips': {}, 'weightLabel': 'Normal'}, type='Cat')}, purifiers={})
2023-12-12 07:23:26.791 DEBUG (MainThread) [custom_components.petkit] Finished fetching petkit data in 0.470 seconds (success: True)
2023-12-12 07:25:14.883 DEBUG (MainThread) [custom_components.petkit] Found the following PetKit devices/pets: PetKitData(user_id='100657138', feeders={}, litter_boxes={400003401: LitterBox(id=400003401, device_detail={'id': 400003401, 'mac': 'b8d61a75b3d8', 'sn': '20230603L22203', 'secret': '20837b82cb22184f', 'createdAt': '2023-09-06T14:43:57.937+0000', 'name': 'Kackiklo', 'hardware': 1, 'firmware': '1.456', 'firmwareDetails': [{'module': 'userbin', 'version': 2310010}, {'module': 'pics', 'version': 2220001}, {'module': 'lans', 'version': 2245001}], 'timezone': 1.0, 'signupAt': '2023-12-12T05:46:23.874+0000', 'locale': 'Europe/Berlin', 'user': {'id': '100657138', 'nick': 'SebastianMAIN', 'gender': 3, 'avatar': 'http://sandbox.img5.petkit.cn/banner/2022/10/13/6347d75a44ad08000b011e7dDzwc693i5', 'point': {'honour': 'LV0', 'rank': 0, 'growth': 15, 'icon': 'http://img5-us.petkit.cn/misc/point/n0', 'icon2': 'http://img5-us.petkit.cn/misc/point/l0', 'startGrowth': 0, 'endGrowth': 50}}, 'shareOpen': 1, 'autoUpgrade': 1, 'relation': {'userId': '100657138'}, 'withK3': 1, 'k3Id': 400002990, 'btMac': 'b8d61a75b3da', 'settings': {'litterFullNotify': 1, 'lackSandNotify': 1, 'workNotify': 1, 'petInNotify': 0, 'lackLiquidNotify': 1, 'deodorantNotify': 1, 'sandType': 1, 'manualLock': 0, 'lightMode': 1, 'lightRange': [0, 1440], 'autoWork': 1, 'fixedTimeClear': 0, 'fixedTimeRefresh': 0, 'downpos': 1, 'deepRefresh': 0, 'weightPopup': 1, 'autoIntervalMin': 0, 'stillTime': 1500, 'unit': 0, 'language': 'de_DE', 'languageFollow': 0, 'softMode': 0, 'avoidRepeat': 1, 'underweight': 0, 'kitten': 0, 'kittenTipsTime': 0, 'stopTime': 600, 'languages': ['zh_CN', 'zh_TW', 'en_US', 'es_ES', 'ko_KR', 'it_IT', 'ja_JP', 'pt_PT', 'de_DE', 'fr_FR', 'ru_RU'], 'kittenPercent': 0.8, 'dumpSwitch': 1, 'autoRefresh': 1, 'disturbMode': 0, 'disturbRange': [1425, 465], 'relateK3Switch': 1, 'lightest': 3539, 'deepClean': 0, 'lightConfig': 1, 'bury': 1, 'lightMultiRange': [], 'disturbConfig': 2, 'distrubMultiRange': [[1425, 465]], 'controlSettings': 0}, 'k3Device': {'id': 400002990, 'mac': 'a4c138590d66', 'sn': '01230510M10822', 'secret': '86e940a0f45a', 'createdAt': '2023-09-06T14:48:52.000+0000', 'updateAt': '2023-12-12T06:24:09.000+0000', 'userId': '100657138', 'name': 'AIR SMART SPRAY', 'hardware': 1, 'firmware': 39, 'settings': {'liquidLackSwitch': 1, 'fixedTimeRefresh': 0}, 'timezone': 1.0, 'relation': {'userId': '100657138'}, 'relateT4': 400003401, 'battery': 94, 'liquid': 100, 'refreshing': 0, 'lighting': 0, 'voltage': 5910, 'liquidLack': 3}, 'petOutTip': 1, 'multiConfig': True, 'state': {'wifi': {'ssid': 'BuDu', 'bssid': '3ca62fa9a94d', 'rsq': -70}, 'pim': 1, 'ota': 0, 'overall': 1, 'sandCorrect': 0, 'liquidReset': 0, 'sandWeight': 1848, 'sandPercent': 0, 'usedTimes': 0, 'sandType': 1, 'sandStatus': 1, 'box': 0, 'liquid': 100, 'battery': 94, 'petInTime': 0, 'power': 1, 'petError': False, 'deodorantLeftDays': 19, 'liquidLack': False, 'boxFull': False, 'liquidEmpty': False, 'sandLack': False, 'lowPower': False}, 'lastOutTime': 117, 'petOutRecords': [[13340, 58], [23954, 58], [24046, 27], [24131, 55], [24291, 74], [24373, 117]], 'inTimes': 6, 'totalTime': 4076, 'specialLitterAd': {'adDetailUrl': 'http://m.petkit.com/app/cat_litter.html', 'adSwitch': 0, 'adLinkUrl': 'https://m.tb.cn/h.f8XZ8IM?sm=846b3a', 'label': '跨年', 'labelUrl': 'http://sandbox.img5.petkit.cn/post/2021/12/7/61af3624a8c9cc16b23736e8ywX6LUO8P', 'labelName': '专用猫砂'}, 'maintenanceTime': 0, 'petInTipLimit': 15}, device_record=[{'deviceId': 400003401, 'eventType': 10, 'timestamp': 1702348998, 'content': {'timeIn': 1702348940, 'timeOut': 1702348998, 'autoClear': 1, 'interval': 25, 'petWeight': 4661}, 'enumEventType': 'pet_out', 'userId': '100657138', 'petId': '-2', 'subContent': [{'deviceId': 400003401, 'eventType': 8, 'timestamp': 1702349039, 'content': {'startTime': 1702349013, 'startReason': 0, 'liquid': 99, 'result': 0, 'fromClear': 1, 'liquidLack': False}, 'enumEventType': 'spray_over', 'userId': '100657138', 'subContent': []}, {'deviceId': 400003401, 'eventType': 5, 'timestamp': 1702350736, 'content': {'startTime': 1702350499, 'startReason': 0, 'litterPercent': 0, 'box': 0, 'result': 0, 'boxFull': False}, 'enumEventType': 'clean_over', 'userId': '100657138', 'subContent': []}]}, {'deviceId': 400003401, 'eventType': 10, 'timestamp': 1702359612, 'content': {'timeIn': 1702359554, 'timeOut': 1702359612, 'autoClear': 1, 'interval': 25, 'petWeight': 4622}, 'enumEventType': 'pet_out', 'userId': '100657138', 'petId': '100900992', 'subContent': [{'deviceId': 400003401, 'eventType': 8, 'timestamp': 1702359712, 'content': {'startTime': 1702359687, 'startReason': 0, 'liquid': 100, 'result': 0, 'fromClear': 1, 'liquidLack': False}, 'enumEventType': 'spray_over', 'userId': '100657138', 'subContent': []}], 'avatar': 'http://img5-us.petkit.cn/uavatar/2023/11/20/655a691aeb4f8d000b6c1d51IPRMLhiKV', 'petName': 'Rufa'}, {'deviceId': 400003401, 'eventType': 10, 'timestamp': 1702359673, 'content': {'timeIn': 1702359646, 'timeOut': 1702359673, 'autoClear': 1, 'interval': 25, 'petWeight': 4844}, 'enumEventType': 'pet_out', 'userId': '100657138', 'petId': '100900989', 'subContent': [{'deviceId': 400003401, 'eventType': 8, 'timestamp': 1702359712, 'content': {'startTime': 1702359687, 'startReason': 0, 'liquid': 100, 'result': 0, 'fromClear': 1, 'liquidLack': False}, 'enumEventType': 'spray_over', 'userId': '100657138', 'subContent': []}], 'avatar': 'http://img5-us.petkit.cn/uavatar/2023/11/20/655a68c28cb7a2000c1e7779HwWvM4xj2', 'petName': 'Simba'}, {'deviceId': 400003401, 'eventType': 10, 'timestamp': 1702359786, 'content': {'timeIn': 1702359731, 'timeOut': 1702359786, 'autoClear': 1, 'interval': 25, 'petWeight': 4423}, 'enumEventType': 'pet_out', 'userId': '100657138', 'petId': '100900992', 'subContent': [{'deviceId': 400003401, 'eventType': 8, 'timestamp': 1702359824, 'content': {'startTime': 1702359799, 'startReason': 0, 'liquid': 100, 'result': 0, 'fromClear': 1, 'liquidLack': False}, 'enumEventType': 'spray_over', 'userId': '100657138', 'subContent': []}], 'avatar': 'http://img5-us.petkit.cn/uavatar/2023/11/20/655a691aeb4f8d000b6c1d51IPRMLhiKV', 'petName': 'Rufa'}, {'deviceId': 400003401, 'eventType': 10, 'timestamp': 1702359965, 'content': {'timeIn': 1702359891, 'timeOut': 1702359965, 'autoClear': 1, 'interval': 25, 'petWeight': 4699}, 'enumEventType': 'pet_out', 'userId': '100657138', 'petId': '100900989', 'subContent': [], 'avatar': 'http://img5-us.petkit.cn/uavatar/2023/11/20/655a68c28cb7a2000c1e7779HwWvM4xj2', 'petName': 'Simba'}, {'deviceId': 400003401, 'eventType': 10, 'timestamp': 1702360090, 'content': {'timeIn': 1702359973, 'timeOut': 1702360090, 'autoClear': 1, 'interval': 25, 'petWeight': 4624}, 'enumEventType': 'pet_out', 'userId': '100657138', 'petId': '100900992', 'subContent': [{'deviceId': 400003401, 'eventType': 8, 'timestamp': 1702360128, 'content': {'startTime': 1702360096, 'startReason': 0, 'liquid': 100, 'result': 6, 'fromClear': 1, 'liquidLack': False}, 'enumEventType': 'spray_over', 'userId': '100657138', 'subContent': []}, {'deviceId': 400003401, 'eventType': 5, 'timestamp': 1702362026, 'content': {'startTime': 1702361591, 'startReason': 0, 'litterPercent': 0, 'box': 0, 'result': 0, 'boxFull': False}, 'enumEventType': 'clean_over', 'userId': '100657138', 'subContent': []}], 'avatar': 'http://img5-us.petkit.cn/uavatar/2023/11/20/655a691aeb4f8d000b6c1d51IPRMLhiKV', 'petName': 'Rufa'}, {'deviceId': 400003401, 'eventType': 7, 'timestamp': 1702362249, 'content': {'result': 5, 'modeTime': 65}, 'enumEventType': 'reset_over', 'userId': '100657138', 'subContent': []}], statistics={'statisticTime': '20231212', 'totalTime': 389, 'times': 6, 'avgTime': 64, 'statisticInfo': [{'statisticDate': '20231212', 'petTimes': 1, 'petTotalTime': 58, 'petWeight': 4661, 'petId': '0', 'petName': '', 'xTime': 13340}, {'statisticDate': '20231212', 'petTimes': 1, 'petTotalTime': 58, 'petWeight': 4622, 'petId': '100900992', 'petName': 'Rufa', 'xTime': 23954}, {'statisticDate': '20231212', 'petTimes': 1, 'petTotalTime': 27, 'petWeight': 4844, 'petId': '100900989', 'petName': 'Simba', 'xTime': 24046}, {'statisticDate': '20231212', 'petTimes': 1, 'petTotalTime': 55, 'petWeight': 4423, 'petId': '100900992', 'petName': 'Rufa', 'xTime': 24131}, {'statisticDate': '20231212', 'petTimes': 1, 'petTotalTime': 74, 'petWeight': 4699, 'petId': '100900989', 'petName': 'Simba', 'xTime': 24291}, {'statisticDate': '20231212', 'petTimes': 1, 'petTotalTime': 117, 'petWeight': 4624, 'petId': '100900992', 'petName': 'Rufa', 'xTime': 24373}], 'petIds': [{'id': '100900992', 'name': 'Rufa'}, {'id': '100900989', 'name': 'Simba'}, {'id': '0', 'name': ''}]}, type='t4', manually_paused=False, manual_pause_end=None)}, water_fountains={}, pets={100900989: Pet(id='100900989', data={'activeDegree': 0, 'avatar': 'http://img5-us.petkit.cn/uavatar/2023/11/20/655a68c28cb7a2000c1e7779HwWvM4xj2', 'birth': '2022-06-24', 'category': {'avatar': 'http://img5-us.petkit.cn/dogavatar/2017/8/10/598c150b98953a0fc0b2ad7eDHh42Ty1z', 'id': 10063, 'name': 'European Shorthair'}, 'createdAt': '2023-11-19T19:58:43.000Z', 'deviceCount': 0, 'emotion': 0, 'familyId': 300111542, 'femaleState': 0, 'gender': 1, 'id': '100900989', 'isRoyalCaninPet': 0, 'maleState': 1, 'name': 'Simba', 'owner': {'deviceCount': 0, 'id': '100657138', 'petCount': 0, 'userCount': 0}, 'size': {'id': 1, 'name': 'Standard'}, 'states': [], 'type': {'id': 2, 'name': 'Cat'}, 'updatedAt': '2023-11-20T04:39:45.000Z', 'weight': 4.918, 'weightControl': 3, 'weightControlTips': {}, 'weightLabel': 'Normal'}, type='Cat'), 100900992: Pet(id='100900992', data={'activeDegree': 0, 'avatar': 'http://img5-us.petkit.cn/uavatar/2023/11/20/655a691aeb4f8d000b6c1d51IPRMLhiKV', 'birth': '2022-04-24', 'category': {'avatar': 'http://img5-us.petkit.cn/dogavatar/2017/8/10/598c150b98953a0fc0b2ad7eDHh42Ty1z', 'id': 10063, 'name': 'European Shorthair'}, 'createdAt': '2023-11-19T19:59:49.000Z', 'deviceCount': 0, 'emotion': 0, 'familyId': 300111542, 'femaleState': 1, 'gender': 2, 'id': '100900992', 'isRoyalCaninPet': 0, 'maleState': 0, 'name': 'Rufa', 'owner': {'deviceCount': 0, 'id': '100657138', 'petCount': 0, 'userCount': 0}, 'size': {'id': 1, 'name': 'Standard'}, 'states': [], 'type': {'id': 2, 'name': 'Cat'}, 'updatedAt': '2023-11-24T11:07:21.000Z', 'weight': 4.424, 'weightControl': 3, 'weightControlTips': {}, 'weightLabel': 'Normal'}, type='Cat')}, purifiers={})
2023-12-12 07:25:14.883 DEBUG (MainThread) [custom_components.petkit] Finished fetching petkit data in 1.098 seconds (success: True)
RobertD502 commented 11 months ago

Based on your log the PETKIT API is returning a sandWeight, sandPercent, and petInTime of 0. You'll need to use the PETKIT app to figure out what is going on - might need to factory reset the litter box since the API is even stating that you have 0% litter in the litter box at the moment. The petInTime resets at midnight, so this value should change when a cat has used the litter box during the current day. If after the litter box has been used the API is still returning 0, then you know something is going on with your litter box. As I mentioned before, the easiest way to troubleshoot would be to factory reset the litter box, delete it in the app, and then re-add it to see if it starts reporting correct values. However, there may also be a calibration step that I'm not aware of (I don't own any PETKIT litter boxes) - a quick glance at the manual states to press the maintenance mode button, adding fresh litter, and then selecting the level litter option (perhaps it is during this time that the litter box calibrates itself and determines the current litter weight and the associated percentage left).

As it stands, the integration is working correctly and reporting what the API is giving it. The only way around this is figuring out why your litter box is wrongfully reporting a value of 0 for those.

RobertD502 commented 11 months ago

Regarding the KeyError, that is something I'll need to fix within the integration- your log helped me identify the correct dictionary to pull the petInTime from. I'll be sure to get that error fixed in the next release, but that won't fix why the PETKIT API is reporting your litter box as having a sand weight and sand percentage of 0.

panteLx commented 11 months ago

Thank you!

Its strange because the Integration (and litter level sensor) worked in the past. As you can see here: ubi6LLo

The air liquid sensor isnt working as well. It jumps from 80% to 100% without filling up. syEn0DM

RobertD502 commented 11 months ago

If that's the case, then it may be worthwhile jumping to the factory resetting option to see if that resolves the issues.

stale[bot] commented 11 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.