jubepue / homebridge-petkit-platform

MIT License
14 stars 6 forks source link

404 HTTP response when trying to dispense food #4

Open nicoodeimos opened 1 year ago

nicoodeimos commented 1 year ago

I have a Petkit Fresh Element Mini Pro and tried this plugin. The fan accessory appears, but when I try to enable the internal switch service (which I guess is the "dispense food" action), the plugin throws a 401 error:

PetkitOpenAPI request: method = post, endpoint = http://api.petkt.com/latest, path = /feedermini/saveDailyFeed, params = null, body = {"amount":15,"day":"20230306","deviceId":"XXX","time":-1}, headers = {"X-Client":"ios(15.5;iPhone12,3)","Accept":"*/*","X-Timezone":"2.0","Accept-Language":"es-ES;q=1","Accept-Encoding":"gzip, deflate","X-Api-Version":"8.17.1","Content-Type":"application/x-www-form-urlencoded","User-Agent":"PETKIT/8.17.1 (iPhone; iOS 15.5; Scale/3.00)","X-TimezoneId":"Europe/Madrid","X-Locale":"es_ES","X-Session":"XXX"}
[SET][Fresh Element Mini] Characteristic Error: Error: Request failed with status code 404
    at createError (/volume2/homebridge/node_modules/homebridge-petkit-platform/node_modules/axios/lib/core/createError.js:16:15)
    at settle (/volume2/homebridge/node_modules/homebridge-petkit-platform/node_modules/axios/lib/core/settle.js:17:12)
    at IncomingMessage.handleStreamEnd (/volume2/homebridge/node_modules/homebridge-petkit-platform/node_modules/axios/lib/adapters/http.js:269:11)
    at IncomingMessage.emit (node:events:539:35)
    at endReadableNT (node:internal/streams/readable:1345:12)
    at processTicksAndRejections (node:internal/process/task_queues:83:21) {
  config: [Object],
  request: [ClientRequest],
  response: [Object],
  isAxiosError: true,
  toJSON: [Function: toJSON]
}
nicoodeimos commented 1 year ago

Any news on this? Thanks šŸ™šŸ»

jlhunter2008 commented 1 year ago

I am getting this same error message. Any help would be greatly appreciated.

nicoodeimos commented 1 year ago

@jubepue is the plugin still in development? :(

monkeycatdog commented 1 year ago

@nicoodeimos @jlhunter2008 hey guys, I just fixed that issue in my own fork. While my pull request pending, you can use this. Just find it by name in the plugins, remove old one, leave the previous config. After restart it should work.