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

Add support for other version of Petkit feeder [Help Needed!] #15

Closed elfive closed 3 years ago

elfive commented 3 years ago

Some of you may not have a Petkit Feeder mini, and still wants to use this plugin. So I decide to add this feature and hope it will go public ASAP, but I may need some help since I personally just ownd a Petkit Feeder mini.

If you wanna help me, you can do some thing for me:

  1. Your device exact model, like Petkit feeder mini or so. If possible, a link to Petkit store of your device is very very helpful.

  2. If you know how to capture iOS app http netflow, post the url you captured, which may like one below:(“xxxxxx” is your device Id, please hide it before post it to the public.)

  3. Send a HTTP request to "http://api.petkit.cn/6/discovery/device_roster" with all the headers you captured above, and you will receive a response like below:

    {
    "result": {
    "devices": [{
      "data": {
        "name": "your device name in Petkit app",
        ...
      },
      "type": "FeederMini"
    }],
    ...
    }
    }

    comment with the result.devices[].type string. The example above show as "FeederMini"

elfive at 2020.12.08 Thank you

elfive commented 3 years ago

If you wanna test the plugin, you can follow this guide: install the demo version:

git clone -b develop_new_device https://github.com/elfive/homebridge-petkit-feeder-mini.git
cd homebridge-petkit-feeder-mini
npm link

configure the plugin:

I add a configure to specify the device model: model. Other settings are just like the README.md said.

remove this plugin: goto plugin folder. (where you perform the git clone command)

cd homebridge-petkit-feeder-mini
npm unlink
cd .. && rm -rf homebridge-petkit-feeder-mini

change model string:

# goto plugin folder. (where you perform the git clone command)
cd homebridge-petkit-feeder-mini

# modify index.js, use vim or whatever editer you like:
vim index.js

# then locate to line 548, which says:
if (item.type == 'Feeder' && item.data) {```

# change the string Feeder to whatever you find out previosly through http request. save and restart homebridge.
service homebridge restart   // or restart homebridge through Homebridge UI.

Looking forward to your feedback.

elfive commented 3 years ago

Petkit version 2.0.0 is released, which support Petkit Feeder Element, you can upgrade to v2.0.0 and have a look.