jubepue / homebridge-petkit-pet-feeder

MIT License
6 stars 1 forks source link

Feed daily plan bug in some devices #5

Closed nicoodeimos closed 2 years ago

nicoodeimos commented 2 years ago

Describe the bug I encounter the following errors this morning, after installing the plugin:

[10/1/2022, 11:34:46 AM] [petkit_pet_feeder] [ERROR] http request failed: http request failed: AxiosError: Request failed with status code 400
[10/1/2022, 11:34:46 AM] [petkit_pet_feeder] [WARN] feed daily list with a unrecognizable reply.
CleanShot 2022-10-01 at 11 37 48@2x

Detail Information

  1. NodeJS version: v16.17.1
  2. Homebridge version: v1.5.0
  3. Plugin version: v3.2.1
  4. Logs
[10/1/2022, 11:38:51 AM] [homebridge-petkit-pet-feeder] This plugin generated a warning from the characteristic 'On': characteristic value expected boolean and received undefined. See https://homebridge.io/w/JtMGR for more info.
[10/1/2022, 11:38:51 AM] [homebridge-petkit-pet-feeder] Error: 
    at On.Characteristic.characteristicWarning (/var/lib/homebridge/node_modules/hap-nodejs/src/lib/Characteristic.ts:2138:105)
    at On.Characteristic.validateUserInput (/var/lib/homebridge/node_modules/hap-nodejs/src/lib/Characteristic.ts:2014:12)
    at On.Characteristic.updateValue (/var/lib/homebridge/node_modules/hap-nodejs/src/lib/Characteristic.ts:1457:20)
    at petkit_pet_feeder_plugin.uploadStatusToHomebridge (/var/lib/homebridge/node_modules/homebridge-petkit-pet-feeder/index.js:553:54)
    at /var/lib/homebridge/node_modules/homebridge-petkit-pet-feeder/index.js:535:30
    at /var/lib/homebridge/node_modules/homebridge-petkit-pet-feeder/index.js:457:27
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
jubepue commented 2 years ago

Hi, Please change your config to DEBUG mode and send me the results (remove sensitive info)

Tku jubepue

nicoodeimos commented 2 years ago

Here is what the plugin returned 👍

...
[10/1/2022, 12:59:37 PM] [petkit_pet_feeder] [DEBUG] {"result":{"id":XXXXXXXXX,"mac":"XXXXXXXX","sn":"XXXXXXXXX","secret":"XXXXXXXX","createdAt":"2022-05-11T18:48:28.655Z","name":"Fresh Element Mini","hardware":1,"firmware":"1.394","firmwareDetails":[{"module":"userbin","version":2003001}],"timezone":2,"signupAt":"2022-10-01T18:25:54.860Z","locale":"Europe/Paris","user":{"id":"XXXXX","nick":"XXXXXX","gender":1,"point":{"honour":"LV0","rank":0,"growth":18,"icon":"http://img5-us.petkit.cn/misc/point/n0","icon2":"http://img5-us.petkit.cn/misc/point/l0","startGrowth":0,"endGrowth":50}},"shareOpen":0,"relation":{"userId":"XXXXXX"},"settings":{"feedNotify":1,"foodNotify":1,"reBatteryNotify":1,"desiccantNotify":0,"manualLock":0,"lightMode":0,"lightRange":[480,1320]},"feed":{"deviceId":XXXXXX,"userId":"XXXXXXX","repeats":"1,2,3,4,5,6,7","items":[],"suspended":1,"isExecuted":1,"isLock":0},"state":{"wifi":{"ssid":"XXXXXXX","bssid":"XXXXXX","rsq":-52},"pim":1,"ota":0,"overall":1,"errorPriority":0,"desiccantLeftDays":0,"feeding":0,"food":1,"batteryStatus":0,"runtime":60,"batteryPower":4,"desiccantTime":0},"type":0,"userId":"XXXXXXXX"}}
[10/1/2022, 12:59:37 PM] [petkit_pet_feeder] [INFO] initialize Petkit Feeder device(Fresh Element Mini) success.
[10/1/2022, 12:59:37 PM] [petkit_pet_feeder] [DEBUG] http://api.petkt.com/latest/feedermini/save_feed?deviceId=100121415&feedDailyList=[{"items":[],"repeats":1,"suspended":1},{"items":[],"repeats":2,"suspended":1},{"items":[],"repeats":3,"suspended":1},{"items":[],"repeats":4,"suspended":1},{"items":[],"repeats":5,"suspended":1},{"items":[],"repeats":6,"suspended":1},{"items":[],"repeats":7,"suspended":1}]
...

Does that help ?

jubepue commented 2 years ago

Hi, Please send me ALL the logs for see the error an try to reproduce it

jubepue

nicoodeimos commented 2 years ago

Sorry about this. Please find all the logs generated:

[10/1/2022, 8:44:29 PM] [petkit_pet_feeder] Initializing petkit_pet_feeder platform...
[10/1/2022, 8:44:29 PM] [petkit_pet_feeder] [INFO] Begin to initialize Petkit feeder platform.
[10/1/2022, 8:44:29 PM] [petkit_pet_feeder] [INFO] Petkit feeder platform loaded.
[10/1/2022, 8:44:29 PM] [petkit_pet_feeder] [DEBUG] {"headers":{"X-Session":"XXXX","X-Api-Version":"8.10.4","X-Timezone":"2.0","X-Client":"ios(15.4.1;iPhone14,5)","X-TimezoneId":"Europe/Paris","X-Locale":"en_US","Accept":"*/*","Accept-Language":"en-FR;q=1, fr-FR;q=0.9","Accept-Encoding":"gzip, deflate","Content-Type":"application/x-www-form-urlencoded","User-Agent":"PETKIT/8.10.4 (iPhone; iOS 15.4.1; Scale/3.00)"},"location":"international","model":"FeederMini","deviceId":"XXXX","enable_http_retry":false,"http_retry_count":3,"DropMeal_name":"Distribuer","MealAmount_name":"Quantité","FeedDaily_name":"Suivre le plan de nourriture","FoodStorage_name":"Pénurie de nourriture","DesiccantLevel_name":"Niveau de déshydratant","ManualLock_name":"Verrouillage manuel","LightMode_name":"Lumière activée","Battery_name":"Batterie","BlockDoor_name":"Porte bloquée","enable_polling":true,"polling_interval":60,"enable_desiccant":false,"alert_desiccant_threshold":7,"enable_autoreset_desiccant":true,"reset_desiccant_threshold":5,"enable_manualLock":false,"enable_lightMode":false,"reverse_foodStorage_indicator":true,"ignore_battery_when_charging":true,"fast_response":false,"meal_amount":3,"enabled_daily_feeds":0,"overwrite_daily_feeds":false,"feed_daily_list":[{"name":1,"amount":5,"time":1,"id":1}],"host":"http://api.petkt.com/latest","urls":{"owndevices":"/discovery/device_roster","deviceState":"/devicestate?id={}","deviceDetailInfo":"/device_detail?id={}","saveDailyFeed":"/save_dailyfeed?deviceId={}&day={}&time={}&amount={}","removeDailyFeed":"/remove_dailyfeed?deviceId={}&day={}&id=d{}","saveFeed":"/save_feed?deviceId={}&feedDailyList={}","dailyFeeds":"/dailyfeeds?deviceId={}&days={}","restoreDailyFeeds":"/restore_dailyfeed?deviceId={}&day={}&id=s{}","disableDailyFeeds":"/remove_dailyfeed?deviceId={}&day={}&id=s{}","resetDesiccant":"/desiccant_reset?deviceId={}","updateSettings":"/update?id={}&kv={}"},"http_options":{"method":"POST","timeout":5000,"responseType":"json","retry":{"enabled":false,"max_retry":3}},"settings":{"manualLock":"settings.manualLock","lightMode":"settings.lightMode","lightRange":"settings.lightRange","foodWarn":"settings.foodWarn","foodWarnRange":"settings.foodWarnRange"},"manufacturer":"Petkit"}
[10/1/2022, 8:44:29 PM] [petkit_pet_feeder] [INFO] initializing Petkit Feeder device.
[10/1/2022, 8:44:29 PM] [petkit_pet_feeder] [DEBUG] request device info from Petkit server.
[10/1/2022, 8:44:29 PM] [petkit_pet_feeder] [DEBUG] http://api.petkt.com/latest/discovery/device_roster
[10/1/2022, 8:44:30 PM] [petkit_pet_feeder] [DEBUG] http request success
[10/1/2022, 8:44:30 PM] [petkit_pet_feeder] [DEBUG] {"result":{"p3d":{"enable":1},"t4":{"enable":1},"r2":{"enable":1},"p3c":{"enable":1},"aqr":{"enable":1},"p3":{"enable":1},"w5c":{"enable":1},"cozy":{"gearsTotal":6,"enable":1,"tempunit":0,"sTempMin":10,"isShowDeviceSafetyClause":0,"gearsOffset":3,"sTempMax":42},"feeder":{"isShowDeviceSafetyClause":0},"h2":{"enable":0},"tools":[{"type":"walkpet","data":{}},{"type":"weight"},{"type":"remind","data":{}}],"d3":{"enable":1},"d4":{"enable":1},"w5n":{"enable":1},"aqh1":{"enable":0},"cat":{"days":30},"w5":{"enable":1},"devices":[{"data":{"createdAt":"2022-05-11T18:48:28.655Z","dailyFeed":{"items":[],"day":20221001,"amount":0,"realAmount":60,"deviceId":0},"name":"Fresh Element Mini","id":XXXX,"state":1,"relation":{"userId":"XXXX"},"status":{"wifi":{"ssid":"XXXX","bssid":"XXXX","rsq":-54},"pim":1,"ota":0,"overall":1,"errorPriority":0,"desiccantLeftDays":0,"feeding":0,"food":1,"batteryStatus":0,"runtime":4302,"batteryPower":4,"desiccantTime":0},"desc":"No feeding plan."},"type":"FeederMini"}],"k2":{"enable":1},"go":{"hasMarks":0,"maxMarksPerRoute":30,"markEnabled":1},"k3":{"enable":1},"aq":{"enable":1},"hasRelay":false,"feedermini":{"isShowDeviceSafetyClause":0},"w4x":{"enable":1},"appbanner":[],"t3":{"enable":1},"aq1s":{"enable":1}}}
[10/1/2022, 8:44:30 PM] [petkit_pet_feeder] [INFO] found you ownd one FeederMini with deviceId: XXXX.
[10/1/2022, 8:44:30 PM] [petkit_pet_feeder] [DEBUG] request initial device status from Petkit server.
[10/1/2022, 8:44:30 PM] [petkit_pet_feeder] [DEBUG] http://api.petkt.com/latest/feedermini/device_detail?id=XXXX
[10/1/2022, 8:44:30 PM] [petkit_pet_feeder] [DEBUG] http request success
[10/1/2022, 8:44:30 PM] [petkit_pet_feeder] [DEBUG] {"result":{"id":XXXX,"mac":"XXXX","sn":"XXXX","secret":"XXXX","createdAt":"2022-05-11T18:48:28.655Z","name":"Fresh Element Mini","hardware":1,"firmware":"1.394","firmwareDetails":[{"module":"userbin","version":2003001}],"timezone":2,"signupAt":"2022-10-02T01:15:27.728Z","locale":"Europe/Paris","user":{"id":"XXXX","nick":"XXXX","gender":1,"point":{"honour":"LV0","rank":0,"growth":18,"icon":"http://img5-us.petkit.cn/misc/point/n0","icon2":"http://img5-us.petkit.cn/misc/point/l0","startGrowth":0,"endGrowth":50}},"shareOpen":0,"relation":{"userId":"XXXX"},"settings":{"feedNotify":1,"foodNotify":1,"reBatteryNotify":1,"desiccantNotify":0,"manualLock":0,"lightMode":0,"lightRange":[480,1320]},"feed":{"deviceId":XXXX,"userId":"XXXX","repeats":"1,2,3,4,5,6,7","items":[],"suspended":1,"isExecuted":1,"isLock":0},"state":{"wifi":{"ssid":"XXXX","bssid":"XXXX","rsq":-54},"pim":1,"ota":0,"overall":1,"errorPriority":0,"desiccantLeftDays":0,"feeding":0,"food":1,"batteryStatus":0,"runtime":4302,"batteryPower":4,"desiccantTime":0},"type":0,"userId":"XXXX"}}
[10/1/2022, 8:44:30 PM] [petkit_pet_feeder] [INFO] initialize Petkit Feeder device(Fresh Element Mini) success.
[10/1/2022, 8:44:30 PM] [petkit_pet_feeder] [DEBUG] http://api.petkt.com/latest/feedermini/save_feed?deviceId=100121415&feedDailyList=[{"items":[],"repeats":1,"suspended":1},{"items":[],"repeats":2,"suspended":1},{"items":[],"repeats":3,"suspended":1},{"items":[],"repeats":4,"suspended":1},{"items":[],"repeats":5,"suspended":1},{"items":[],"repeats":6,"suspended":1},{"items":[],"repeats":7,"suspended":1}]
[10/1/2022, 8:44:31 PM] [petkit_pet_feeder] [ERROR] http request failed: http request failed: AxiosError: Request failed with status code 400
[10/1/2022, 8:44:31 PM] [petkit_pet_feeder] [WARN] feed daily list with a unrecognizable reply.
[10/1/2022, 8:44:32 PM] [petkit_pet_feeder] [DEBUG] http://api.petkt.com/latest/feedermini/device_detail?id=XXXX
[10/1/2022, 8:44:32 PM] [petkit_pet_feeder] [DEBUG] http request success
[10/1/2022, 8:44:32 PM] [petkit_pet_feeder] [DEBUG] {"result":{"id":XXXX,"mac":"XXXX","sn":"XXXX","secret":"XXXX","createdAt":"2022-05-11T18:48:28.655Z","name":"Fresh Element Mini","hardware":1,"firmware":"1.394","firmwareDetails":[{"module":"userbin","version":2003001}],"timezone":2,"signupAt":"2022-10-02T01:15:27.728Z","locale":"Europe/Paris","user":{"id":"XXXX","nick":"XXXX","gender":1,"point":{"honour":"LV0","rank":0,"growth":18,"icon":"http://img5-us.petkit.cn/misc/point/n0","icon2":"http://img5-us.petkit.cn/misc/point/l0","startGrowth":0,"endGrowth":50}},"shareOpen":0,"relation":{"userId":"XXXX"},"settings":{"feedNotify":1,"foodNotify":1,"reBatteryNotify":1,"desiccantNotify":0,"manualLock":0,"lightMode":0,"lightRange":[480,1320]},"feed":{"deviceId":XXXX,"userId":"XXXX","repeats":"1,2,3,4,5,6,7","items":[],"suspended":1,"isExecuted":1,"isLock":0},"state":{"wifi":{"ssid":"XXXX","bssid":"XXXX","rsq":-54},"pim":1,"ota":0,"overall":1,"errorPriority":0,"desiccantLeftDays":0,"feeding":0,"food":1,"batteryStatus":0,"runtime":4302,"batteryPower":4,"desiccantTime":0},"type":0,"userId":"XXXX"}}
[10/1/2022, 8:44:32 PM] [petkit_pet_feeder] [DEBUG] {"food":1,"batteryPower":4,"batteryStatus":0,"desiccantLeftDays":0,"manualLock":0,"lightMode":0,"lastUpdate":1664649872}
[10/1/2022, 8:44:32 PM] [homebridge-petkit-pet-feeder] This plugin generated a warning from the characteristic 'On': characteristic value expected boolean and received undefined. See https://homebridge.io/w/JtMGR for more info.
[10/1/2022, 8:44:32 PM] [homebridge-petkit-pet-feeder] Error: 
    at On.Characteristic.characteristicWarning (/var/lib/homebridge/node_modules/hap-nodejs/src/lib/Characteristic.ts:2138:105)
    at On.Characteristic.validateUserInput (/var/lib/homebridge/node_modules/hap-nodejs/src/lib/Characteristic.ts:2014:12)
    at On.Characteristic.updateValue (/var/lib/homebridge/node_modules/hap-nodejs/src/lib/Characteristic.ts:1457:20)
    at petkit_pet_feeder_plugin.uploadStatusToHomebridge (/var/lib/homebridge/node_modules/homebridge-petkit-pet-feeder/index.js:553:54)
    at /var/lib/homebridge/node_modules/homebridge-petkit-pet-feeder/index.js:535:30
    at /var/lib/homebridge/node_modules/homebridge-petkit-pet-feeder/index.js:457:27
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
[10/1/2022, 8:44:32 PM] [petkit_pet_feeder] [INFO] battery level is 100%.
[10/1/2022, 8:44:32 PM] [petkit_pet_feeder] [INFO] battery is charging.
[10/1/2022, 8:44:32 PM] [petkit_pet_feeder] [INFO] battery level status is normal.
[10/1/2022, 8:44:32 PM] [petkit_pet_feeder] [INFO] manualLock function is disabled.
[10/1/2022, 8:44:32 PM] [petkit_pet_feeder] [INFO] lightMode function is disabled.
[10/1/2022, 8:44:32 PM] [petkit_pet_feeder] [INFO] there is enough food left.
[10/1/2022, 8:44:32 PM] [petkit_pet_feeder] [INFO] desiccant service is disabled
jubepue commented 2 years ago

Hi, What is your Feeder model? Feeder Element mini?

nicoodeimos commented 2 years ago

It is yes, this model : Feeder Element mini pro

jubepue commented 2 years ago

Hi, Now it is not supported Fresh Element mini PRO, only Element mini. But we can work it together. Please send the screenshot of charles app when upload the feed daily list.

4CC738B4-3EC2-4E72-A562-01695C8B6CEC (This is an example when update light settings)

jubepue

nicoodeimos commented 2 years ago

Sure happy to help. Plugin works by the way, just seeing the errors mentioned above. Which header values are you looking for? Pretty sure I already extracted those in the past.

jubepue commented 2 years ago

Hi, I need the first line "post" and the last line "id=“. If you can send me too the Charles results when you update the manual lock settings , light settings, and when you manually dispense food, i will have all the urls needed to update the plugin for this new device (same “post” line and “id=…….”)

nicoodeimos commented 2 years ago

Here is what I found. Let me know if this helps or if you need anything else:

Enabling chil lock:

http://api.petkt.com/latest/feedermini/update
id=XXXXXX&kv=%7B%22settings.manualLock%22%3A1%7D

Enabling light mode:

http://api.petkt.com/latest/feedermini/update
id=XXXXXX&kv=%7B%22settings.lightMode%22%3A1%7D

Suspend feed plan:

http://api.petkt.com/latest/feedermini/suspend_feed
deviceId=XXXXXX

Restore feed plan:

http://api.petkt.com/latest/feedermini/restore_feed
deviceId=XXXXXX

Feed the cat

http://api.petkt.com/latest/feedermini/save_dailyfeed
amount=5&day=20221003&deviceId=XXXXXX&time=-1
jubepue commented 2 years ago

Hi, Please send me too when upload the feed daily list.

nicoodeimos commented 2 years ago

Hi, Please send me too when upload the feed daily list.

What do you mean?

jubepue commented 2 years ago

I need the results obtained in the Charles app (“post” line and the last line,same above)when you save the weekly plan in the Petkit app 0CB3504A-D52C-44F5-956A-6E70B73E8B76

jubepue commented 2 years ago

Another question, when you change the feed daily status over homekit, do you see the same errors?

nicoodeimos commented 2 years ago

Another question, when you change the feed daily status over homekit, do you see the same errors?

Yes, seems to fail with :

[10/4/2022, 9:22:04 AM] [petkit_pet_feeder] [DEBUG] http://api.petkt.com/latest/feedermini/save_feed?deviceId=XXXX&feedDailyList=[{"items":[],"repeats":1,"suspended":0},{"items":[],"repeats":2,"suspended":0},{"items":[],"repeats":3,"suspended":0},{"items":[],"repeats":4,"suspended":0},{"items":[],"repeats":5,"suspended":0},{"items":[],"repeats":6,"suspended":0},{"items":[],"repeats":7,"suspended":0}]
[10/4/2022, 9:22:05 AM] [petkit_pet_feeder] [ERROR] http request failed: http request failed: AxiosError: Request failed with status code 400
[10/4/2022, 9:22:05 AM] [petkit_pet_feeder] [WARN] feed daily list with a unrecognizable reply.
nicoodeimos commented 2 years ago

Here is for save weekly plan :

Save weekly plan

http://api.petkt.com/latest/feedermini/save_feed
deviceId=XXXX&items=%5B%7B%22id%22%3A%2233960%22%2C%22amount%22%3A5%2C%22name%22%3A%22Breakfast%22%2C%22time%22%3A33960%7D%5D&repeats=1%2C2%2C3%2C4%2C5%2C6%2C7&suspended=0
nicoodeimos commented 2 years ago

I opened #6, don't know if this is linked or not, just in case. Many thanks @jubepue !

jubepue commented 2 years ago

Hi, It seems that in this model the data that is sent to petkit is different or the api has been modified, I have to do some tests, I hope to upload a beta soon so that you can test it.

jubepue

nicoodeimos commented 2 years ago

Sure, let me know if I can help. Happy to assist. Thanks !

nicoodeimos commented 2 years ago

Hey @jubepue, checking if you have any news on this? Let me know if I can provide further information to help you! Thanks !

jubepue commented 2 years ago

Hi, Please check the new beta release and tell me back. Please change your model device config

jubepue

nicoodeimos commented 2 years ago

Hi @jubepue, updated and encountered the following issues:

[10/27/2022, 11:57:05 AM] [petkit_pet_feeder] [DEBUG] {"headers":{"X-Session":"XXXXX","X-Api-Version":"8.10.4","X-Timezone":"2.0","X-Client":"ios(15.4.1;iPhone14,5)","X-TimezoneId":"Europe/Paris","X-Locale":"en_US","Accept":"*/*","Accept-Language":"en-FR;q=1, fr-FR;q=0.9","Accept-Encoding":"gzip, deflate","Content-Type":"application/x-www-form-urlencoded","User-Agent":"PETKIT/8.10.4 (iPhone; iOS 15.4.1; Scale/3.00)"},"location":"international","model":"FeederMiniPro","deviceId":"XXXXXX","enable_http_retry":false,"http_retry_count":3,"DropMeal_name":"Distribuer","MealAmount_name":"Quantité","FeedDaily_name":"Suivre le plan de nourriture","FoodStorage_name":"Pénurie de nourriture","DesiccantLevel_name":"Niveau de déshydratant","ManualLock_name":"Verrouillage manuel","LightMode_name":"Lumière activée","Battery_name":"Batterie","BlockDoor_name":"Porte bloquée","enable_polling":true,"polling_interval":60,"enable_desiccant":false,"alert_desiccant_threshold":7,"enable_autoreset_desiccant":true,"reset_desiccant_threshold":5,"enable_manualLock":false,"enable_lightMode":false,"reverse_foodStorage_indicator":true,"ignore_battery_when_charging":true,"fast_response":false,"meal_amount":4,"enabled_daily_feeds":0,"overwrite_daily_feeds":false,"feed_daily_list":[{"name":1,"amount":5,"time":1,"id":1}],"modelname":"feedermini","host":"http://api.petkt.com/latest","urls":{"owndevices":"/discovery/device_roster","deviceState":"/devicestate?id={}","deviceDetailInfo":"/device_detail?id={}","saveDailyFeed":"/save_dailyfeed?deviceId={}&day={}&time={}&amount={}","removeDailyFeed":"/remove_dailyfeed?deviceId={}&day={}&id=d{}","saveFeed":"/save_feed?deviceId={}?items={}?repeats=1,2,3,4,5,6,7?suspended={}","dailyFeeds":"/dailyfeeds?deviceId={}&days={}","restoreDailyFeeds":"/restore_dailyfeed?deviceId={}&day={}&id=s{}","disableDailyFeeds":"/remove_dailyfeed?deviceId={}&day={}&id=s{}","resetDesiccant":"/desiccant_reset?deviceId={}","updateSettings":"/update?id={}&kv={}"},"http_options":{"method":"POST","timeout":5000,"responseType":"json","retry":{"enabled":false,"max_retry":3}},"settings":{"manualLock":"manualLock","lightMode":"lightMode","lightRange":"lightRange","foodWarn":"foodWarn","foodWarnRange":"foodWarnRange"},"manufacturer":"Petkit"}
[10/27/2022, 11:57:05 AM] [petkit_pet_feeder] [INFO] initializing Petkit Feeder device.
[10/27/2022, 11:57:05 AM] [petkit_pet_feeder] [DEBUG] request device info from Petkit server.
[10/27/2022, 11:57:05 AM] [petkit_pet_feeder] [DEBUG] http://api.petkt.com/latest/discovery/device_roster
[10/27/2022, 11:57:06 AM] [petkit_pet_feeder] [DEBUG] http request success
[10/27/2022, 11:57:06 AM] [petkit_pet_feeder] [DEBUG] {"result":{"p3d":{"enable":1},"t4":{"enable":1},"r2":{"enable":1},"p3c":{"enable":1},"aqr":{"enable":1},"p3":{"enable":1},"w5c":{"enable":1},"cozy":{"gearsTotal":6,"enable":1,"tempunit":0,"sTempMin":10,"isShowDeviceSafetyClause":0,"gearsOffset":3,"sTempMax":42},"feeder":{"isShowDeviceSafetyClause":0},"h2":{"enable":0},"tools":[{"type":"walkpet","data":{}},{"type":"weight"},{"type":"remind","data":{}}],"d3":{"enable":1},"d4":{"enable":1},"w5n":{"enable":1},"aqh1":{"enable":0},"cat":{"days":30},"w5":{"enable":1},"devices":[{"data":{"createdAt":"2022-05-11T18:48:28.655Z","dailyFeed":{"items":[],"day":20221027,"amount":80,"realAmount":20,"deviceId":0},"name":"Fresh Element Mini","id":XXXXX,"state":1,"relation":{"userId":"XXXXX"},"status":{"wifi":{"ssid":"nicodeimos","bssid":"XXXXX","rsq":-51},"pim":1,"ota":0,"overall":1,"errorPriority":0,"desiccantLeftDays":0,"feeding":0,"food":1,"batteryStatus":0,"runtime":42970,"batteryPower":4,"desiccantTime":0},"desc":"Next feeding time: 12:00"},"type":"FeederMini"}],"k2":{"enable":1},"go":{"hasMarks":0,"maxMarksPerRoute":30,"markEnabled":1},"k3":{"enable":1},"aq":{"enable":1},"hasRelay":false,"feedermini":{"isShowDeviceSafetyClause":0},"w4x":{"enable":1},"appbanner":[],"t3":{"enable":1},"aq1s":{"enable":1}}}
[10/27/2022, 11:57:06 AM] [petkit_pet_feeder] [WARN] found you just ownd one FeederMini with deviceId: ABCDEF
[10/27/2022, 11:57:06 AM] [petkit_pet_feeder] [WARN] which is not the same with the deviceId you set: ABCDEF
[10/27/2022, 11:57:06 AM] [petkit_pet_feeder] [WARN] will use ABCDEF instead
[10/27/2022, 11:57:06 AM] [petkit_pet_feeder] [DEBUG] request initial device status from Petkit server.
[10/27/2022, 11:57:06 AM] [petkit_pet_feeder] [DEBUG] http://api.petkt.com/latest/feedermini/device_detail?id=XXXXX
[10/27/2022, 11:57:06 AM] [petkit_pet_feeder] [DEBUG] http request success
[10/27/2022, 11:57:06 AM] [petkit_pet_feeder] [DEBUG] {"result":{"id":XXXXX,"mac":"XXXXX","sn":"XXXXX","secret":"XXXXX","createdAt":"2022-05-11T18:48:28.655Z","name":"Fresh Element Mini","hardware":1,"firmware":"1.394","firmwareDetails":[{"module":"userbin","version":2003001}],"timezone":2,"signupAt":"2022-10-27T05:38:57.057Z","locale":"Europe/Paris","user":{"id":"XXXXX","nick":"XXXXX","gender":1,"point":{"honour":"LV0","rank":0,"growth":22,"icon":"http://img5-us.petkit.cn/misc/point/n0","icon2":"http://img5-us.petkit.cn/misc/point/l0","startGrowth":0,"endGrowth":50}},"shareOpen":0,"relation":{"userId":"100330124"},"settings":{"feedNotify":0,"foodNotify":1,"reBatteryNotify":1,"desiccantNotify":0,"manualLock":1,"lightMode":0,"lightRange":[480,1320]},"feed":{"deviceId":XXXXX,"userId":"XXXXX","repeats":"1,2,3,4,5,6,7","items":[{"id":"28800","time":28800,"amount":20,"name":"Breakfast"},{"id":"43200","time":43200,"amount":20,"name":"Lunch"},{"id":"57600","time":57600,"amount":20,"name":"Dessert"},{"id":"72000","time":72000,"amount":20,"name":"Dinner"}],"suspended":0,"isExecuted":1,"isLock":0},"state":{"wifi":{"ssid":"XXXXX","bssid":"XXXXX","rsq":-51},"pim":1,"ota":0,"overall":1,"errorPriority":0,"desiccantLeftDays":0,"feeding":0,"food":1,"batteryStatus":0,"runtime":42970,"batteryPower":4,"desiccantTime":0},"type":0,"userId":"XXXXX"}}
[10/27/2022, 11:57:06 AM] [petkit_pet_feeder] [INFO] initialize Petkit Feeder device(Fresh Element Mini) success.
[10/27/2022, 11:57:06 AM] [petkit_pet_feeder] [DEBUG] http://api.petkt.com/latest/feedermini/save_feed?deviceId=XXXXX?items=[{"items":[{"amount":20,"id":"28800","name":"Breakfast","time":28800},{"amount":20,"id":"43200","name":"Lunch","time":43200},{"amount":20,"id":"57600","name":"Dessert","time":57600},{"amount":20,"id":"72000","name":"Dinner","time":72000}],"repeats":1,"suspended":1},{"items":[{"amount":20,"id":"28800","name":"Breakfast","time":28800},{"amount":20,"id":"43200","name":"Lunch","time":43200},{"amount":20,"id":"57600","name":"Dessert","time":57600},{"amount":20,"id":"72000","name":"Dinner","time":72000}],"repeats":2,"suspended":1},{"items":[{"amount":20,"id":"28800","name":"Breakfast","time":28800},{"amount":20,"id":"43200","name":"Lunch","time":43200},{"amount":20,"id":"57600","name":"Dessert","time":57600},{"amount":20,"id":"72000","name":"Dinner","time":72000}],"repeats":3,"suspended":1},{"items":[{"amount":20,"id":"28800","name":"Breakfast","time":28800},{"amount":20,"id":"43200","name":"Lunch","time":43200},{"amount":20,"id":"57600","name":"Dessert","time":57600},{"amount":20,"id":"72000","name":"Dinner","time":72000}],"repeats":4,"suspended":1},{"items":[{"amount":20,"id":"28800","name":"Breakfast","time":28800},{"amount":20,"id":"43200","name":"Lunch","time":43200},{"amount":20,"id":"57600","name":"Dessert","time":57600},{"amount":20,"id":"72000","name":"Dinner","time":72000}],"repeats":5,"suspended":1},{"items":[{"amount":20,"id":"28800","name":"Breakfast","time":28800},{"amount":20,"id":"43200","name":"Lunch","time":43200},{"amount":20,"id":"57600","name":"Dessert","time":57600},{"amount":20,"id":"72000","name":"Dinner","time":72000}],"repeats":6,"suspended":1},{"items":[{"amount":20,"id":"28800","name":"Breakfast","time":28800},{"amount":20,"id":"43200","name":"Lunch","time":43200},{"amount":20,"id":"57600","name":"Dessert","time":57600},{"amount":20,"id":"72000","name":"Dinner","time":72000}],"repeats":7,"suspended":1}]?repeats=1,2,3,4,5,6,7?suspended=
[10/27/2022, 11:57:07 AM] [petkit_pet_feeder] [ERROR] http request failed: http request failed: AxiosError: Request failed with status code 400
[10/27/2022, 11:57:07 AM] [petkit_pet_feeder] [ERROR] set feed daily list failed: TypeError: Cannot read properties of undefined (reading 'error')
[10/27/2022, 11:57:08 AM] [petkit_pet_feeder] [DEBUG] http://api.petkt.com/latest/feedermini/device_detail?id=XXXXX
[10/27/2022, 11:57:08 AM] [petkit_pet_feeder] [DEBUG] http request success
[10/27/2022, 11:57:08 AM] [petkit_pet_feeder] [DEBUG] {"result":{"id":XXXXX,"mac":"XXXXX","sn":"XXXXX","secret":"XXXXX","createdAt":"2022-05-11T18:48:28.655Z","name":"Fresh Element Mini","hardware":1,"firmware":"1.394","firmwareDetails":[{"module":"userbin","version":2003001}],"timezone":2,"signupAt":"2022-10-27T05:38:57.057Z","locale":"Europe/Paris","user":{"id":"XXXXX","nick":"XXXXX","gender":1,"point":{"honour":"LV0","rank":0,"growth":22,"icon":"http://img5-us.petkit.cn/misc/point/n0","icon2":"http://img5-us.petkit.cn/misc/point/l0","startGrowth":0,"endGrowth":50}},"shareOpen":0,"relation":{"userId":"100330124"},"settings":{"feedNotify":0,"foodNotify":1,"reBatteryNotify":1,"desiccantNotify":0,"manualLock":1,"lightMode":0,"lightRange":[480,1320]},"feed":{"deviceId":XXXXX,"userId":"XXXXX","repeats":"1,2,3,4,5,6,7","items":[{"id":"28800","time":28800,"amount":20,"name":"Breakfast"},{"id":"43200","time":43200,"amount":20,"name":"Lunch"},{"id":"57600","time":57600,"amount":20,"name":"Dessert"},{"id":"72000","time":72000,"amount":20,"name":"Dinner"}],"suspended":0,"isExecuted":1,"isLock":0},"state":{"wifi":{"ssid":"XXXXX","bssid":"68d79a270f23","rsq":-51},"pim":1,"ota":0,"overall":1,"errorPriority":0,"desiccantLeftDays":0,"feeding":0,"food":1,"batteryStatus":0,"runtime":42970,"batteryPower":4,"desiccantTime":0},"type":0,"userId":"XXXXX"}}
[10/27/2022, 11:57:08 AM] [petkit_pet_feeder] [DEBUG] {"food":1,"batteryPower":4,"batteryStatus":0,"desiccantLeftDays":0,"manualLock":1,"lightMode":0,"lastUpdate":1666864628}
[10/27/2022, 11:57:08 AM] [homebridge-petkit-pet-feeder] This plugin generated a warning from the characteristic 'On': characteristic value expected boolean and received undefined. See https://homebridge.io/w/JtMGR for more info.
[10/27/2022, 11:57:08 AM] [homebridge-petkit-pet-feeder] Error: 
    at On.Characteristic.characteristicWarning (/var/lib/homebridge/node_modules/hap-nodejs/src/lib/Characteristic.ts:2138:105)
    at On.Characteristic.validateUserInput (/var/lib/homebridge/node_modules/hap-nodejs/src/lib/Characteristic.ts:2014:12)
    at On.Characteristic.updateValue (/var/lib/homebridge/node_modules/hap-nodejs/src/lib/Characteristic.ts:1457:20)
    at petkit_pet_feeder_plugin.uploadStatusToHomebridge (/var/lib/homebridge/node_modules/homebridge-petkit-pet-feeder/index.js:604:54)
    at /var/lib/homebridge/node_modules/homebridge-petkit-pet-feeder/index.js:586:30
    at /var/lib/homebridge/node_modules/homebridge-petkit-pet-feeder/index.js:490:27
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
[10/27/2022, 11:57:08 AM] [petkit_pet_feeder] [INFO] battery level is 100%.
[10/27/2022, 11:57:08 AM] [petkit_pet_feeder] [INFO] battery is charging.
[10/27/2022, 11:57:08 AM] [petkit_pet_feeder] [INFO] battery level status is normal.
[10/27/2022, 11:57:08 AM] [petkit_pet_feeder] [INFO] manualLock function is disabled.
[10/27/2022, 11:57:08 AM] [petkit_pet_feeder] [INFO] lightMode function is disabled.
[10/27/2022, 11:57:08 AM] [petkit_pet_feeder] [INFO] there is enough food left.
[10/27/2022, 11:57:08 AM] [petkit_pet_feeder] [INFO] desiccant service is disabled
jubepue commented 2 years ago

Hi, Please check it again and tell me back.

jubepue

nicoodeimos commented 2 years ago

So I have now the following error at the very beginning:

[10/27/2022, 6:28:15 PM] [petkit_pet_feeder] Initializing petkit_pet_feeder platform...
[10/27/2022, 6:28:15 PM] [petkit_pet_feeder] [INFO] Begin to initialize Petkit feeder platform.
[10/27/2022, 6:28:15 PM] [petkit_pet_feeder] [INFO] Petkit feeder platform loaded.
[10/27/2022, 6:28:15 PM] [petkit_pet_feeder] [ERROR] TypeError: Cannot read properties of undefined (reading 'forEach')

Not sure the rest of the plugin gets loaded, so can't say if the previous errors have been fixed.

jubepue commented 2 years ago

Can you send me all the logs?

nicoodeimos commented 2 years ago

I'm afraid that is all the logs I have, after I hit restart to reboot the server, the plugins are loaded, and it displays this. That is display even before the HomeKit code to pair is displayed in the console.

[10/27/2022, 9:03:59 PM] [HB Supervisor] Restarting Homebridge...
[10/27/2022, 9:03:59 PM] [HB Supervisor] Starting Homebridge with extra flags: -I -P /var/lib/homebridge/node_modules -D --strict-plugin-resolution
[10/27/2022, 9:04:00 PM] [HB Supervisor] Started Homebridge v1.5.1 with PID: 177973
[10/27/2022, 9:04:01 PM] Loaded config.json with 3 accessories and 5 platforms.
[10/27/2022, 9:04:01 PM] Loaded 5 cached accessories from cachedAccessories.
[10/27/2022, 9:04:01 PM] ---
[10/27/2022, 9:04:01 PM] Loaded plugin: homebridge-delay-switch@3.0.3
[10/27/2022, 9:04:01 PM] Registering accessory 'homebridge-delay-switch.DelaySwitch'
[10/27/2022, 9:04:01 PM] ---
[10/27/2022, 9:04:02 PM] Loaded plugin: homebridge-ewelink@10.2.0
[10/27/2022, 9:04:02 PM] Registering platform 'homebridge-ewelink.eWeLink'
[10/27/2022, 9:04:02 PM] ---
[10/27/2022, 9:04:02 PM] Loaded plugin: homebridge-miot@1.4.0
[10/27/2022, 9:04:02 PM] Registering platform 'homebridge-miot.miot'
[10/27/2022, 9:04:02 PM] ---
[10/27/2022, 9:04:02 PM] Loaded plugin: homebridge-petkit-pet-feeder@3.3.1-beta.1
[10/27/2022, 9:04:02 PM] Registering platform 'homebridge-petkit-pet-feeder.petkit_pet_feeder'
[10/27/2022, 9:04:02 PM] ---
[10/27/2022, 9:04:02 PM] Loaded plugin: homebridge-samsung-tizen@5.2.4
[10/27/2022, 9:04:02 PM] Registering platform 'homebridge-samsung-tizen.SamsungTizen'
[10/27/2022, 9:04:02 PM] ---
[10/27/2022, 9:04:03 PM] Loaded plugin: homebridge-xiaomi-roborock-vacuum@0.28.0
[10/27/2022, 9:04:03 PM] Registering accessory 'homebridge-xiaomi-roborock-vacuum.XiaomiRoborockVacuum'
[10/27/2022, 9:04:03 PM] ---
[10/27/2022, 9:04:03 PM] Loading 5 platforms...
[10/27/2022, 9:04:03 PM] [miot] Initializing miot platform...
[10/27/2022, 9:04:03 PM] [eWeLink] Initializing eWeLink platform...
[10/27/2022, 9:04:03 PM] [eWeLink] Initialising plugin v10.2.0 | System linux | Node v16.17.1 | HB v1.5.1 | HAPNodeJS v0.10.4...
[10/27/2022, 9:04:03 PM] [petkit_pet_feeder] Initializing petkit_pet_feeder platform...
[10/27/2022, 9:04:03 PM] [petkit_pet_feeder] [INFO] Begin to initialize Petkit feeder platform.
[10/27/2022, 9:04:03 PM] [petkit_pet_feeder] [INFO] Petkit feeder platform loaded.
[10/27/2022, 9:04:03 PM] [SamsungTizen] Initializing SamsungTizen platform...
[10/27/2022, 9:04:03 PM] Loading 3 accessories...
[10/27/2022, 9:04:03 PM] [Litière propre] Initializing DelaySwitch accessory...
[10/27/2022, 9:04:03 PM] [Litière propre] Starting the Timer
[10/27/2022, 9:04:03 PM] [Litière nettoyage en cours] Initializing DelaySwitch accessory...
[10/27/2022, 9:04:04 PM] [Roborock S7 MaxV] Initializing XiaomiRoborockVacuum accessory...
[10/27/2022, 9:04:04 PM] [Roborock S7 MaxV] [Model=unknown] DEB getDevice | Discovering vacuum cleaner
[10/27/2022, 9:04:04 PM] [Roborock S7 MaxV] [Model=unknown] INF createRoom | Room la cuisine (16)
[10/27/2022, 9:04:04 PM] [Roborock S7 MaxV] [Model=unknown] INF createRoom | Room la chambre (17)
[10/27/2022, 9:04:04 PM] [Roborock S7 MaxV] [Model=unknown] INF createRoom | Room l'entrée (20)
[10/27/2022, 9:04:04 PM] [Roborock S7 MaxV] [Model=unknown] INF createRoom | Room la salle de bain (18)
[10/27/2022, 9:04:04 PM] [Roborock S7 MaxV] [Model=unknown] INF createRoom | Room le salon (21)
[10/27/2022, 9:04:04 PM] [Roborock S7 MaxV] [Model=unknown] DEB getServices
[10/27/2022, 9:04:04 PM] [miot] Found cached accessory Purificateur d'air
[10/27/2022, 9:04:04 PM] [miot] Found cached accessory Purificateur d'air
[10/27/2022, 9:04:04 PM] [miot] Found cached accessory Friteuse à air
[10/27/2022, 9:04:04 PM] [miot] Initializing devices
[10/27/2022, 9:04:04 PM] [miot] [Purificateur d'air] Got device configuration, initializing device with name: Purificateur d'air
[10/27/2022, 9:04:04 PM] [miot] [Purificateur d'air] Got device configuration, initializing device with name: Purificateur d'air
[10/27/2022, 9:04:04 PM] [miot] [Friteuse à air] Got device configuration, initializing device with name: Friteuse à air
[10/27/2022, 9:04:04 PM] [miot] No accessories to remove!
[10/27/2022, 9:04:04 PM] [eWeLink] Plugin initialised. Setting up accessories....
[10/27/2022, 9:04:04 PM] [petkit_pet_feeder] [ERROR] TypeError: Cannot read properties of undefined (reading 'forEach')
[10/27/2022, 9:04:04 PM] Publishing bridge accessory (name: Homebridge, publishInfo: {
  username: 'XXXX',
  port: 51800,
  pincode: 'XXXXXXX',
  category: 2,
  bind: undefined,
  mdns: undefined,
  addIdentifyingMaterial: true,
  advertiser: 'ciao'
}).
Setup Payload:
X-HM://XXXXXXXXX
Enter this code with your HomeKit app on your iOS device to pair with Homebridge:

    ┌────────────┐     
    │ XXX-XX-XXX │     
    └────────────┘     

[10/27/2022, 9:04:04 PM] Homebridge v1.5.1 (HAP v0.10.4) (Homebridge) is running on port 51800.
jubepue commented 2 years ago

Please send me the plugin config

nicoodeimos commented 2 years ago

There you go:

        {
            "log_level": 1,
            "devices": [
                {
                    "headers": [
                        {
                            "key": "X-Session",
                            "value": "XXXXX"
                        },
                        {
                            "key": "X-Api-Version",
                            "value": "8.10.4"
                        },
                        {
                            "key": "X-Timezone",
                            "value": "2.0"
                        },
                        {
                            "key": "X-Client",
                            "value": "ios(15.4.1;iPhone14,5"
                        },
                        {
                            "key": "X-TimezoneId",
                            "value": "Europe/Paris"
                        },
                        {
                            "key": "X-Locale",
                            "value": "en_US"
                        },
                        {
                            "key": "Accept",
                            "value": "*/*"
                        },
                        {
                            "key": "Accept-Language",
                            "value": "en-FR;q=1, fr-FR;q=0.9"
                        },
                        {
                            "key": "Accept-Encoding",
                            "value": "gzip, deflate"
                        },
                        {
                            "key": "Content-Type",
                            "value": "application/x-www-form-urlencoded"
                        },
                        {
                            "key": "User-Agent",
                            "value": "PETKIT/8.10.4 (iPhone; iOS 15.4.1; Scale/3.00)"
                        }
                    ],
                    "location": "international",
                    "model": "FeederMiniPro",
                    "deviceId": "XXXXX",
                    "enable_http_retry": false,
                    "http_retry_count": 3,
                    "DropMeal_name": "Distribuer",
                    "MealAmount_name": "Quantité",
                    "FeedDaily_name": "Suivre le plan de nourriture",
                    "FoodStorage_name": "Pénurie de nourriture",
                    "DesiccantLevel_name": "Niveau de déshydratant",
                    "ManualLock_name": "Verrouillage manuel",
                    "LightMode_name": "Lumière activée",
                    "Battery_name": "Batterie",
                    "BlockDoor_name": "Porte bloquée",
                    "enable_polling": true,
                    "polling_interval": 60,
                    "enable_desiccant": false,
                    "alert_desiccant_threshold": 7,
                    "enable_autoreset_desiccant": true,
                    "reset_desiccant_threshold": 5,
                    "enable_manualLock": true,
                    "enable_lightMode": true,
                    "reverse_foodStorage_indicator": true,
                    "ignore_battery_when_charging": true,
                    "fast_response": false,
                    "meal_amount": 4,
                    "enabled_daily_feeds": false,
                    "overwrite_daily_feeds": false
                }
            ],
            "platform": "petkit_pet_feeder"
        }
jubepue commented 2 years ago

hello again and thank you, I just uploaded a release and everything seems correct, check it out and tell me back.

jubepue

nicoodeimos commented 2 years ago

Still got the same issue :(

jubepue commented 2 years ago

Is not possible, i am just test it with your x-session. If you look for in your app Petkit you will see the new feed daily plan ;) Please delete the plugin and reinstall it