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

Support for Petkit Fresh Element 3/Fresh Element Infinity #25

Open d4ni37 opened 3 years ago

d4ni37 commented 3 years ago

I'd like to be able to use this with my Petkit Fresh Element 3/Fresh Element Infinity (https://www.petkit.com/product-page/fresh-element-3). Would it be possible to update to include this I can support as required to get details etc.

I tried using the plugin however get the following so I am assuming it is not currently supported by the "Feeder" setup: Petkit Feeder Mini Bridgepetkit_feeder_miniERROR[ERROR] sorry that this plugin only works with these device type:["Feeder","FeederMini"]. Petkit Feeder Mini Bridgepetkit_feeder_miniERROR[ERROR] initialize Petkit Feeder failed: could not find supported device.

elfive commented 3 years ago

Since I did not owning a Petkit Fresh Infinity device, so some help is needed, you can follow the instructions here(#15 ) to help me.

d4ni37 commented 3 years ago

Is this what you were after? "devices": [{ "data": { "name": "Smart Pet Feeder", "createdAt": "YYYY-MM-DDTXX:XX:XX.XXXZ", "id": XXXXXXXX, "state": 1, "relation": { "petIds": ["XXXXXXXXX"], "userId": "XXXXXXXXX" }, "status": { "batteryPower": 4, "batteryStatus": 0, "block": 0, "broadcast": { "duration": 0, "start_time": 0 }, "charge": 0, "desiccantLeftDays": 24, "door": 0, "eating": 0, "feeding": 0, "food": 2, "ota": 0, "overall": 1, "pim": 1, "runtime": 0, "weight": 0, "wifi": { "bssid": "XXX", "rsq": -18, "ssid": "XXX" } }, "desc": "Next feeding time: HH:MM" }, "type": "D3" }],

elfive commented 3 years ago

it seems not the data I need:

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" }], ... } }

d4ni37 commented 3 years ago

{ "result": { "p3": { "enable": 0 }, "devices": [{ "data": { "name": "Smart Pet Feeder", "createdAt": YYYY-MM-DDTXX:XX:XX.XXXZ", "id": XXXXXXXX, "state": 1, "relation": { "petIds": ["XXXXXXXXX"], "userId": "XXXXXXXXX" }, "status": { "batteryPower": 4, "batteryStatus": 0, "block": 0, "broadcast": { "duration": 0, "start_time": 0 }, "charge": 0, "desiccantLeftDays": 24, "door": 0, "eating": 0, "feeding": 0, "food": 2, "ota": 0, "overall": 1, "pim": 1, "runtime": 0, "weight": 0, "wifi": { "bssid": "XXXXXXXXXXXX", "rsq": -XX, "ssid": "XXXXXXX" } }, "desc": "Next feeding time: 21:00" }, "type": "D3" }], "cozy": { "gearsTotal": 6.0, "enable": 1, "tempunit": 0, "sTempMin": 10, "isShowDeviceSafetyClause": 0, "gearsOffset": 3.0, "sTempMax": 42 }, "feeder": { "isShowDeviceSafetyClause": 0 }, "k2": { "enable": 1 }, "go": { "hasMarks": 0, "maxMarksPerRoute": 30, "markEnabled": 1 }, "h2": { "enable": 0 }, "tools": [{ "type": "walkpet", "data": {} }, { "type": "weight" }, { "type": "remind", "data": {} }], "d3": {}, "d4": { "enable": 1 }, "feedermini": { "isShowDeviceSafetyClause": 0 }, "w5": { "enable": 1 }, "t3": { "enable": 1 } } }