elfive / homebridge-petkit-feeder-mini

control your petkit feeder mini from homekit, get full use of iOS automation
Apache License 2.0
31 stars 10 forks source link

X session #29

Open killi23 opened 2 years ago

killi23 commented 2 years ago

Hi . I have been trying to add this plugin to Homebridge like the other 20 plugins I have running already on it but I get this error if you can please help. " [petkit_feeder_mini] [ERROR] missing header in your headers: X-Session(note: case sensitive)." All headers are in place . Can you please advise ?

elfive commented 2 years ago

https://github.com/elfive/homebridge-petkit-feeder-mini/wiki#how-to-capture-http-netflow

killi23 commented 2 years ago

Hi yes I have no problem getting the above net flow from Charles or Quantum. Still getting errors .I noticed in your plugin under the headers drop down menu you mention F-Session but there is no menu for F-Session. Also my device ID is longer than 6 digits. I would appreciate it if you would have a look at below and advise please.

X-Client: ios(14.0;iPhone12,3) Accept: / X-Timezone: 8.0 F-Session: -----SAME AS X-Session----- Accept-Language: en-US;q=1, zh-Hans-US;q=0.9 Accept-Encoding: gzip, deflate X-Api-Version: 7.18.1 Content-Type: application/x-www-form-urlencoded User-Agent: PETKIT/7.18.1 (iPhone; iOS 14.0; Scale/3.00) X-TimezoneId: Asia/Shanghai X-Locale: en_US

I have submitted the bug report if you can look at it please below.

[21/10/2021, 09:31:25] [petkit_feeder_mini] [DEBUG] {"headers":{"X-Session":"64f9e7b3591d4bd0b86136555a610632EMyOJa2ceMs5ih3Oz8C0","X-Api-Version":"7.28.2","X-Timezone":"1","X-Client":"ios(15.0.2;iPhone13,4)","X-TimezoneId":"Europe/Dublin","X-Locale":"en_US","Accept":"/","Accept-Language":"en-IE;q=1","Accept-Encoding":"gzip, deflate","Content-Type":"application/x-www-form-urlencoded","User-Agent":"PETKIT/7.28.2 (iPhone; iOS 15.0.2; Scale/3.00)"},"location":"north_america","model":"Feeder","deviceId":"100019225","enable_http_retry":true,"http_retry_count":2,"DropMeal_name":"DropMeal","MealAmount_name":"MealAmount","FoodStorage_name":"FoodStorage","DesiccantLevel_name":"DesiccantLevel","ManualLock_name":"ManualLock","LightMode_name":"LightMode","Battery_name":"Battery","enable_polling":true,"polling_interval":60,"enable_desiccant":true,"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":false,"fast_response":false,"urls":{"owndevices":"http://api.petkt.com/latest/discovery/device_roster","deviceState":"http://api.petkt.com/latest/feeder/devicestate?id={}","deviceDetail":"http://api.petkt.com/latest/feeder/device_detail?id={}","saveDailyFeed":"http://api.petkt.com/latest/feeder/save_dailyfeed?deviceId={}&day={}&time={}&amount={}","removeDailyFeed":"http://api.petkt.com/latest/feeder/remove_dailyfeed?deviceId={}&day={}&id=d{}","dailyfeeds":"http://api.petkt.com/latest/feeder/dailyfeeds?deviceId={}&days={}","restoreDailyFeeds":"http://api.petkt.com/latest/feeder/restore_dailyfeed?deviceId={}&day={}&id=s{}","disableDailyFeeds":"http://api.petkt.com/latest/feeder/remove_dailyfeed?deviceId={}&day={}&id=s{}","resetDesiccant":"http://api.petkt.com/latest/feeder/desiccant_reset?deviceId={}","updateSettings":"http://api.petkt.com/latest/feeder/update?id={}&kv={}"},"manufacturer":"Petkit"} [21/10/2021, 09:31:25] [petkit_feeder_mini] [INFO] initializing Petkit Feeder device. [21/10/2021, 09:31:25] [petkit_feeder_mini] [DEBUG] request device info from Petkit server.

The error I keep getting is this .

" [21/10/2021, 09:31:26] [petkit_feeder_mini] [INFO] found you ownd one Feeder with deviceId: 100019225. [21/10/2021, 09:31:26] [petkit_feeder_mini] [DEBUG] request initial device status from Petkit server. [21/10/2021, 09:31:26] [petkit_feeder_mini] [ERROR] unable to get device(100019225) status: TypeError: Cannot read property 'replace' of undefined [21/10/2021, 09:31:26] [petkit_feeder_mini] [WARN] bypass initialize Petkit Feeder device(Feeder)."

I would appreciate your help with this or if I can help in any way.

killi23 commented 2 years ago

Any update please ?

philmue1988 commented 2 years ago

i also have the problem. the Plugin worked perfectly but now I get this message

ERROR] server reply an error: {"error":{"code":8,"msg":"Login session expired. Please log in again."}} [17/01/2022, 21:41:15] [petkit_feeder_mini] [ERROR] you may need to check your X-Session and other header configure [17/01/2022, 21:41:15] [petkit_feeder_mini] [ERROR] TypeError: owned_devices.find is not a function at /usr/local/lib/node_modules/homebridge-petkit-feeder-mini-battery/index.js:601:58 at processTicksAndRejections (internal/process/task_queues.js:93:5) [17/01/2022, 21:41:15] [petkit_feeder_mini] [ERROR] initialize Petkit Feeder failed: could not find supported device.

elfive commented 2 years ago
ERROR] server reply an error: {"error":{"code":8,"msg":"Login session expired. Please log in again."}}

please update your session id.

philmue1988 commented 2 years ago

Hi, thank you. How Can I update the Session ID? I tried to log out in the app