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

Battery Status & Meal amount? #24

Closed philmue1988 closed 3 years ago

philmue1988 commented 3 years ago

First of all thanks for your work!

Im facing 2 problem with the plugin. First is that im always see the warning of low battery in home, but the Feeder is always connect to the power. Is it possible to deactivate the battery status? Second thing is that the meal amount is not updating. In the app I have 30% left and the amount in home (with the fan) is 20%? is der something I can do?

Last thing is just for information. What is the difference between these log status? I don't get actually ;D

philmue1988 commented 3 years ago

if it helps, config is looking like this :

{ "log_level": 2, "devices": [ { "headers": [ { "key": "X-Session", "value": "xxxxxx" } ], "location": "asia", "model": "Feeder", "enable_http_retry": true, "http_retry_count": 3, "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": false, "alert_desiccant_threshold": 7, "enable_autoreset_desiccant": false, "reset_desiccant_threshold": 5, "enable_manualLock": false, "enable_lightMode": false, "reverse_foodStorage_indicator": true, "fast_response": false } ], "platform": "petkit_feeder_mini" }

elfive commented 3 years ago

im always see the warning of low battery in home, but the Feeder is always connect to the power. Is it possible to deactivate the battery status?

This may caused by some other reason, you can simply launch Petkit App, goto this device page, see if there is a low battery warning icon shows. I certainly can add a option to turn off battery feature, but it's better and more helpful you provide some log under debug log level, and we together fix this bug.

the meal amount is not updating. In the app I have 30% left and the amount in home (with the fan) is 20%? is der something I can do?

MealAmount in homekit is not the meal left in Petkit Feeder, more specific, MealAmount(in this plugin) means everytime you commit a drop meal action(DropMeal switch in homekit) that how many meal(s) the Petkit Feeder should drop to the bowl. And MealAmount only used in Homekit, it's separate from the meal(s) you set in Petkit App.

philmue1988 commented 3 years ago

I don't have any warning in the Petit App about low Battery. Is it possible to see the remaining amount of meal in % in the home app? that would be helpful, to activate a light or something if a specific amount is reached.

Apr 08 11:01:37 raspberrypi homebridge[16692]: [4/8/2021, 11:01:37] [petkit_feeder_mini] [INFO] polling start... Apr 08 11:01:38 raspberrypi homebridge[16692]: [4/8/2021, 11:01:38] [petkit_feeder_mini] [INFO] battery level is 0%. Apr 08 11:01:38 raspberrypi homebridge[16692]: [4/8/2021, 11:01:38] [petkit_feeder_mini] [INFO] battery is not charging. Apr 08 11:01:38 raspberrypi homebridge[16692]: [4/8/2021, 11:01:38] [petkit_feeder_mini] [INFO] battery level status is low Apr 08 11:01:38 raspberrypi homebridge[16692]: [4/8/2021, 11:01:38] [petkit_feeder_mini] [INFO] manualLock function is disabled. Apr 08 11:01:38 raspberrypi homebridge[16692]: [4/8/2021, 11:01:38] [petkit_feeder_mini] [INFO] lightMode function is disabled. Apr 08 11:01:38 raspberrypi homebridge[16692]: [4/8/2021, 11:01:38] [petkit_feeder_mini] [WARN] there is not enough food left !!! Apr 08 11:01:38 raspberrypi homebridge[16692]: [4/8/2021, 11:01:38] [petkit_feeder_mini] [INFO] desiccant service is disabled Apr 08 11:01:38 raspberrypi homebridge[16692]: [4/8/2021, 11:01:38] [petkit_feeder_mini] [INFO] polling end...

do you need more infos?

philmue1988 commented 3 years ago

is it also possible to select which one of the function I want to use and which one not? I my case, I actually just need the alert of empty storage

elfive commented 3 years ago

Please set log level to debug, and then update the log. image

Apr 08 11:01:38 raspberrypi homebridge[16692]: [4/8/2021, 11:01:38] [petkit_feeder_mini] [WARN] there is not enough food left !!!

This log line means that the plugin is monitoring the food storage of your feeder device:

For Petkit Feeder Mini, the on board alerm light for food storage looks like this(Only one light): image

For Petkit Feeder Element, the on board alerm light for food storage looks like this: image

philmue1988 commented 3 years ago

Here the debug log

Apr 08 14:23:00 raspberrypi homebridge[19918]: [4/8/2021, 14:23:00] [petkit_feeder_mini] [DEBUG] missing header: X-Client, using 'ios(14.0;iPhone12,3)' instead. Apr 08 14:23:00 raspberrypi homebridge[19918]: [4/8/2021, 14:23:00] [petkit_feeder_mini] [DEBUG] missing header: Accept, using '/' instead. Apr 08 14:23:00 raspberrypi homebridge[19918]: [4/8/2021, 14:23:00] [petkit_feeder_mini] [DEBUG] missing header: X-Timezone, using '0.0' instead. Apr 08 14:23:00 raspberrypi homebridge[19918]: [4/8/2021, 14:23:00] [petkit_feeder_mini] [DEBUG] missing header: Accept-Language, using 'en-US;q=1, zh-Hans-US;q=0.9' instead. Apr 08 14:23:00 raspberrypi homebridge[19918]: [4/8/2021, 14:23:00] [petkit_feeder_mini] [DEBUG] missing header: Accept-Encoding, using 'gzip, deflate' instead. Apr 08 14:23:00 raspberrypi homebridge[19918]: [4/8/2021, 14:23:00] [petkit_feeder_mini] [DEBUG] missing header: X-Api-Version, using '7.18.1' instead. Apr 08 14:23:00 raspberrypi homebridge[19918]: [4/8/2021, 14:23:00] [petkit_feeder_mini] [DEBUG] missing header: Content-Type, using 'application/x-www-form-urlencoded' instead. Apr 08 14:23:00 raspberrypi homebridge[19918]: [4/8/2021, 14:23:00] [petkit_feeder_mini] [DEBUG] missing header: User-Agent, using 'PETKIT/7.18.1 (iPhone; iOS 14.0; Scale/3.00)' instead. Apr 08 14:23:00 raspberrypi homebridge[19918]: [4/8/2021, 14:23:00] [petkit_feeder_mini] [DEBUG] missing header: X-TimezoneId, using 'Asia/Shanghai' instead. Apr 08 14:23:00 raspberrypi homebridge[19918]: [4/8/2021, 14:23:00] [petkit_feeder_mini] [DEBUG] missing header: X-Locale, using 'en_US' instead. Apr 08 14:23:00 raspberrypi homebridge[19918]: [4/8/2021, 14:23:00] [petkit_feeder_mini] [INFO] initializing Petkit Feeder device. Apr 08 14:23:00 raspberrypi homebridge[19918]: [4/8/2021, 14:23:00] [petkit_feeder_mini] [DEBUG] request device info from Petkit server.

Apr 08 14:23:02 raspberrypi homebridge[19918]: [4/8/2021, 14:23:02] [petkit_feeder_mini] [DEBUG] http request success Apr 08 14:23:02 raspberrypi homebridge[19918]: [4/8/2021, 14:23:02] [petkit_feeder_mini] [DEBUG] {"result":{"d4":{"enable":0},"devices":[{"type":"Feeder","data":{"name":"Futterautomat","createdAt":"2019-03-26T17:09:09.729Z","id":xxxxxx,"state":1,"status":{"desiccantLeftDays":23,"errorPriority":0,"feeding":0,"food":677,"ota":0,"overall":1,"percent":27,"pim":1,"wifi":{"bssid":"705425556741","rsq":-60,"ssid":"Test"}},"relation":{"petIds":["100060579"],"userId":"100044589"},"desc":"Next feeding time:18:00"}}],"cozy":{"gearsTotal":6,"enable":1,"tempunit":0,"sTempMin":10,"isShowDeviceSafetyClause":0,"gearsOffset":3,"sTempMax":42},"feeder":{"isShowDeviceSafetyClause":0},"k2":{"enable":1},"go":{"hasMarks":0,"maxMarksPerRoute":30,"markEnabled":1},"feedermini":{"isShowDeviceSafetyClause":0},"tools":[{"type":"walkpet","data":{"goal":60}},{"type":"weight"},{"type":"remind","data":{}}],"t3":{"enable":1},"d3":{}}} Apr 08 14:23:02 raspberrypi homebridge[19918]: [4/8/2021, 14:23:02] [petkit_feeder_mini] [INFO] found you ownd one Feeder with deviceId: xxxxxx. Apr 08 14:23:02 raspberrypi homebridge[19918]: [4/8/2021, 14:23:02] [petkit_feeder_mini] [DEBUG] request initial device status from Petkit server.

is it also possible to select which one of the function I want to use and which one not? I my case, I actually just need the alert of empty storage and don't need the drop meal function etc

philmue1988 commented 3 years ago

and at what point the motion sensor of low level will be triggered? I have 2 light still on of the food level and the motion sensor says that there is not enough food left?

philmue1988 commented 3 years ago

now I also get this message?

Apr 08 14:47:02 raspberrypi homebridge[21367]: [4/8/2021, 14:47:02] [homebridge-petkit-feeder-mini] This plugin generated a warning from the characteristic 'Occupancy Detected': characteristic was supplied illegal value: number 677 exceeded maximum of 1. See https://git.io/JtMGR for more info.

philmue1988 commented 3 years ago

okay I saw the thing, that I don't have any batteries in it. But could it be possible somehow to ignore that if its connected with electrical power?

also I filled the storage with food completely/ reversed the sensor/ calibrate the food storage new and still get the message that there is not enough foot left.

Sorry 4 spamming :)

elfive commented 3 years ago

But could it be possible somehow to ignore that if its connected with electrical power?

yes, I'll try to fix this problem.

also I filled the storage with food completely/ reversed the sensor/ calibrate the food storage new and still get the message that there is not enough foot left.

I'll need sometime to dig into this problem, and may need your help solving this.

elfive commented 3 years ago

new version 2.1.1 should work for you:

  1. new config option add: ignore_battery_when_charging;
  2. food storage status still need further test, look forward to your reply.
philmue1988 commented 3 years ago

Hi, thank you! the issue with the battery is solved. How can I help and support you with the food storage issue?

Here is my current debug log :

Apr 09 07:19:13 raspberrypi homebridge[7548]: [4/9/2021, 07:19:13] [petkit_feeder_mini] [DEBUG] missing header: Accept, using '*/*' instead.
Apr 09 07:19:13 raspberrypi homebridge[7548]: [4/9/2021, 07:19:13] [petkit_feeder_mini] [DEBUG] missing header: X-Timezone, using '0.0' instead.
Apr 09 07:19:13 raspberrypi homebridge[7548]: [4/9/2021, 07:19:13] [petkit_feeder_mini] [DEBUG] missing header: Accept-Language, using 'en-US;q=1, zh-Hans-US;q=0.9' instead.
Apr 09 07:19:13 raspberrypi homebridge[7548]: [4/9/2021, 07:19:13] [petkit_feeder_mini] [DEBUG] missing header: Accept-Encoding, using 'gzip, deflate' instead.
Apr 09 07:19:13 raspberrypi homebridge[7548]: [4/9/2021, 07:19:13] [petkit_feeder_mini] [DEBUG] missing header: X-Api-Version, using '7.18.1' instead.
Apr 09 07:19:13 raspberrypi homebridge[7548]: [4/9/2021, 07:19:13] [petkit_feeder_mini] [DEBUG] missing header: Content-Type, using 'application/x-www-form-urlencoded' instead.
Apr 09 07:19:13 raspberrypi homebridge[7548]: [4/9/2021, 07:19:13] [petkit_feeder_mini] [DEBUG] missing header: User-Agent, using 'PETKIT/7.18.1 (iPhone; iOS 14.0; Scale/3.00)' instead.
Apr 09 07:19:13 raspberrypi homebridge[7548]: [4/9/2021, 07:19:13] [petkit_feeder_mini] [DEBUG] missing header: X-TimezoneId, using 'Asia/Shanghai' instead.
Apr 09 07:19:13 raspberrypi homebridge[7548]: [4/9/2021, 07:19:13] [petkit_feeder_mini] [DEBUG] missing header: X-Locale, using 'en_US' instead.
Apr 09 07:19:13 raspberrypi homebridge[7548]: [4/9/2021, 07:19:13] [petkit_feeder_mini] [DEBUG] {"headers":{"X-Session":"***","X-Client":"ios(14.0;iPhone12,3)","Accept":"*/*","X-Timezone":"0.0","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"},"location":"asia","model":"Feeder","enable_http_retry":true,"http_retry_count":3,"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":false,"alert_desiccant_threshold":7,"enable_autoreset_desiccant":false,"reset_desiccant_threshold":5,"enable_manualLock":false,"enable_lightMode":true,"reverse_foodStorage_indicator":true,"ignore_battery_when_charging":true,"fast_response":false,"urls":{"owndevices":"http://api.petktasia.com/latest/discovery/device_roster","deviceState":"http://api.petktasia.com/latest/feeder/devicestate?id={}","deviceDetailInfo":"http://api.petktasia.com/latest/feeder/device_detail?id={}","saveDailyFeed":"http://api.petktasia.com/latest/feeder/save_dailyfeed?deviceId={}&day={}&time={}&amount={}","removeDailyFeed":"http://api.petktasia.com/latest/feeder/remove_dailyfeed?deviceId={}&day={}&id=d{}","dailyfeeds":"http://api.petktasia.com/latest/feeder/dailyfeeds?deviceId={}&days={}","restoreDailyFeeds":"http://api.petktasia.com/latest/feeder/restore_dailyfeed?deviceId={}&day={}&id=s{}","disableDailyFeeds":"http://api.petktasia.com/latest/feeder/remove_dailyfeed?deviceId={}&day={}&id=s{}","resetDesiccant":"http://api.petktasia.com/latest/feeder/desiccant_reset?deviceId={}","updateSettings":"http://api.petktasia.com/latest/feeder/update?id={}&kv={}"},"manufacturer":"Petkit"}
Apr 09 07:19:13 raspberrypi homebridge[7548]: [4/9/2021, 07:19:13] [petkit_feeder_mini] [INFO] initializing Petkit Feeder device.
Apr 09 07:19:13 raspberrypi homebridge[7548]: [4/9/2021, 07:19:13] [petkit_feeder_mini] [DEBUG] request device info from Petkit server.
Apr 09 07:19:15 raspberrypi homebridge[7548]: [4/9/2021, 07:19:15] [petkit_feeder_mini] [DEBUG] http request success
Apr 09 07:19:15 raspberrypi homebridge[7548]: [4/9/2021, 07:19:15] [petkit_feeder_mini] [DEBUG] {"result":{"d4":{"enable":0},"devices":[{"type":"Feeder","data":{"name":"Futterautomat","createdAt":"2019-03-26T17:09:09.729Z","id":******,"state":2,"status":{"desiccantLeftDays":23,"errorPriority":0,"feeding":0,"food":1966,"ota":0,"overall":2,"percent":78,"pim":0,"wifi":{"bssid":"705425556741","rsq":-59,"ssid":"Test"}},"relation":{"petIds":["100060579"],"userId":"100044589"},"desc":"Next feeding time:18:00"}}],"cozy":{"gearsTotal":6,"enable":1,"tempunit":0,"sTempMin":10,"isShowDeviceSafetyClause":0,"gearsOffset":3,"sTempMax":42},"feeder":{"isShowDeviceSafetyClause":0},"k2":{"enable":1},"go":{"hasMarks":0,"maxMarksPerRoute":30,"markEnabled":1},"feedermini":{"isShowDeviceSafetyClause":0},"tools":[{"type":"walkpet","data":{"goal":60}},{"type":"weight"},{"type":"remind","data":{}}],"t3":{"enable":1},"d3":{}}}
Apr 09 07:19:15 raspberrypi homebridge[7548]: [4/9/2021, 07:19:15] [petkit_feeder_mini] [INFO] found you ownd one Feeder with deviceId: xxxxxx.
Apr 09 07:19:15 raspberrypi homebridge[7548]: [4/9/2021, 07:19:15] [petkit_feeder_mini] [DEBUG] request initial device status from Petkit server.
Apr 09 07:20:18 raspberrypi homebridge[7548]: [4/9/2021, 07:20:18] [petkit_feeder_mini] [DEBUG] http request success
Apr 09 07:20:18 raspberrypi homebridge[7548]: [4/9/2021, 07:20:18] [petkit_feeder_mini] [DEBUG] {"result":{"createdAt":"2019-03-26T17:09:09.729Z","feed":{"deviceId":xxxxxx,"isLock":1,"items":[{"amount":120,"id":"64800","name":"Abendessen","petAmount":[{"amount":120,"petId":"100060579"}],"time":64800}],"repeats":"1,2,3,4,5,6,7","suspended":0,"userId":"100044589"},"firmware":"1.733","firmwareDetails":[{"module":"userbin","version":1942006}],"hardware":1,"id":******,"locale":"Europe/Berlin","mac":"86f3eba10e00","name":"Futterautomat","owner":{"petId":"100060579","userId":"100044589"},"relation":{"petIds":["100060579"],"userId":"100044589"},"secret":"854cc7efee9b4453","settings":{"desiccantNotify":1,"feedNotify":1,"foodNotify":1,"lightMode":1,"lightRange":[450,1320],"manualLock":0},"shareOpen":0,"signupAt":"2021-04-09T04:03:28.564Z","sn":"66180916P30062","state":{"desiccantLeftDays":23,"errorPriority":0,"feeding":0,"food":1966,"ota":0,"overall":2,"percent":78,"pim":0,"wifi":{"bssid":"705425556741","rsq":-59,"ssid":"Test"}},"timezone":2,"type":0}}
Apr 09 07:20:18 raspberrypi homebridge[7548]: [4/9/2021, 07:20:18] [petkit_feeder_mini] [DEBUG] {"lastUpdate":1617945618,"food":1966,"batteryPower":0,"batteryStatus":1,"desiccantLeftDays":23,"manualLock":0,"lightMode":1,"meals":{}}
Apr 09 07:20:18 raspberrypi homebridge[7548]: [4/9/2021, 07:20:18] [petkit_feeder_mini] [INFO] battery level is 0%.
Apr 09 07:20:18 raspberrypi homebridge[7548]: [4/9/2021, 07:20:18] [petkit_feeder_mini] [INFO] battery is not charging.
Apr 09 07:20:18 raspberrypi homebridge[7548]: [4/9/2021, 07:20:18] [petkit_feeder_mini] [INFO] battery level status is normal
Apr 09 07:20:18 raspberrypi homebridge[7548]: [4/9/2021, 07:20:18] [petkit_feeder_mini] [INFO] manualLock function is disabled.
Apr 09 07:20:18 raspberrypi homebridge[7548]: [4/9/2021, 07:20:18] [petkit_feeder_mini] [INFO] lightMode status is on.
Apr 09 07:20:18 raspberrypi homebridge[7548]: [4/9/2021, 07:20:18] [petkit_feeder_mini] [WARN] there is not enough food left !!!
Apr 09 07:20:18 raspberrypi homebridge[7548]: [4/9/2021, 07:20:18] [petkit_feeder_mini] [INFO] desiccant service is disabled
Apr 09 07:20:18 raspberrypi homebridge[7548]: [4/9/2021, 07:20:18] [petkit_feeder_mini] [INFO] polling end...
philmue1988 commented 3 years ago

I faced an issue with the battery. It is working but when the polling starts again, the Homeapp shows me that the battery level is low. When polling is ended that its jumping back. So every few minutes its showing low battery even when the log shows battery level normal

elfive commented 3 years ago

For battery status issue: From your log, it seems that the server didn't reply with the battery status of your device, so I'll complete disable the battery function for Petkit Feeder Element device in the next update and it should not bother you any more.

As for food storage status: Because Petkit server stores and replies different format of food storage value, so I don't know different food value meaning. Here is how you can help me find out:

  1. Empty your food storage in Petkit Feeder deivce.
  2. Goto This online post test website, fill the device ID and Session ID with your own, and click send, save the server reply data.
  3. Fill the Petkit Feeder device with pet food(as much as possible)
  4. repeat step 2.
  5. submit the server reply content to this issue in step 2 and step 4.

here is a screen shot how to get the server reply: image

philmue1988 commented 3 years ago

Okay i will do. Sorry 4 asking so stupidly but what exactly is mean with device id ? where can I get it?

elfive commented 3 years ago

It's my pleasure to help you, with your help so I can make this plugin more reliable.

You can find you device id in the log like here:

Apr 09 07:19:15 raspberrypi homebridge[7548]: [4/9/2021, 07:19:15] [petkit_feeder_mini] [INFO] found you ownd one Feeder with deviceId: xxxxxx.
philmue1988 commented 3 years ago

So with the empty storage is this one :

{
    "result": {
        "createdAt": "2019-03-26T17:09:09.729Z",
        "feed": {
            "deviceId": xxxxxx,
            "isLock": 1,
            "items": [{
                "amount": 120,
                "id": "64800",
                "name": "Abendessen",
                "petAmount": [{
                    "amount": 120,
                    "petId": "100060579"
                }],
                "time": 64800
            }],
            "repeats": "1,2,3,4,5,6,7",
            "suspended": 0,
            "userId": "100044589"
        },
        "firmware": "1.733",
        "firmwareDetails": [{
            "module": "userbin",
            "version": 1942006
        }],
        "hardware": 1,
        "id": xxxxxx,
        "locale": "Europe\/Berlin",
        "mac": "86f3eba10e00",
        "name": "Futterautomat",
        "owner": {
            "petId": "100060579",
            "userId": "100044589"
        },
        "relation": {
            "petIds": ["100060579"],
            "userId": "100044589"
        },
        "secret": "854cc7efee9b4453",
        "settings": {
            "desiccantNotify": 1,
            "feedNotify": 1,
            "foodNotify": 1,
            "lightMode": 1,
            "lightRange": [450, 1320],
            "manualLock": 0
        },
        "shareOpen": 0,
        "signupAt": "2021-04-09T06:17:15.156Z",
        "sn": "xxx",
        "state": {
            "desiccantLeftDays": 23,
            "errorPriority": 0,
            "feeding": 0,
            "food": 0,
            "ota": 0,
            "overall": 1,
            "percent": 0,
            "pim": 1,
            "wifi": {
                "bssid": "00ab48101b05",
                "rsq": -47,
                "ssid": "BurgGuiollett"
            }
        },
        "timezone": 2.0,
        "type": 0
    }
}

with the filled storage is this one:

{
    "result": {
        "createdAt": "2019-03-26T17:09:09.729Z",
        "feed": {
            "deviceId": xxxxxx,
            "isLock": 1,
            "items": [{
                "amount": 120,
                "id": "64800",
                "name": "Abendessen",
                "petAmount": [{
                    "amount": 120,
                    "petId": "100060579"
                }],
                "time": 64800
            }],
            "repeats": "1,2,3,4,5,6,7",
            "suspended": 0,
            "userId": "100044589"
        },
        "firmware": "1.733",
        "firmwareDetails": [{
            "module": "userbin",
            "version": 1942006
        }],
        "hardware": 1,
        "id": xxxxxx,
        "locale": "Europe\/Berlin",
        "mac": "86f3eba10e00",
        "name": "Futterautomat",
        "owner": {
            "petId": "100060579",
            "userId": "100044589"
        },
        "relation": {
            "petIds": ["100060579"],
            "userId": "100044589"
        },
        "secret": "854cc7efee9b4453",
        "settings": {
            "desiccantNotify": 1,
            "feedNotify": 1,
            "foodNotify": 1,
            "lightMode": 1,
            "lightRange": [450, 1320],
            "manualLock": 0
        },
        "shareOpen": 0,
        "signupAt": "2021-04-09T06:17:15.156Z",
        "sn": "xxxxxx",
        "state": {
            "desiccantLeftDays": 23,
            "errorPriority": 0,
            "feeding": 0,
            "food": 2798,
            "ota": 0,
            "overall": 1,
            "percent": 100,
            "pim": 1,
            "wifi": {
                "bssid": "00ab48101b05",
                "rsq": -57,
                "ssid": "BurgGuiollett"
            }
        },
        "timezone": 2.0,
        "type": 0
    }
}
elfive commented 3 years ago

with version 2.1.3, you should all set.

philmue1988 commented 3 years ago

thank you. I'm testing and see:

here is the debug log

Apr 09 09:48:35 raspberrypi homebridge[12318]: [4/9/2021, 09:48:35] [petkit_feeder_mini] [DEBUG] missing header: X-Client, using 'ios(14.0;iPhone12,3)' instead.
Apr 09 09:48:35 raspberrypi homebridge[12318]: [4/9/2021, 09:48:35] [petkit_feeder_mini] [DEBUG] missing header: Accept, using '*/*' instead.
Apr 09 09:48:35 raspberrypi homebridge[12318]: [4/9/2021, 09:48:35] [petkit_feeder_mini] [DEBUG] missing header: X-Timezone, using '0.0' instead.
Apr 09 09:48:35 raspberrypi homebridge[12318]: [4/9/2021, 09:48:35] [petkit_feeder_mini] [DEBUG] missing header: Accept-Language, using 'en-US;q=1, zh-Hans-US;q=0.9' instead.
Apr 09 09:48:35 raspberrypi homebridge[12318]: [4/9/2021, 09:48:35] [petkit_feeder_mini] [DEBUG] missing header: Accept-Encoding, using 'gzip, deflate' instead.
Apr 09 09:48:35 raspberrypi homebridge[12318]: [4/9/2021, 09:48:35] [petkit_feeder_mini] [DEBUG] missing header: X-Api-Version, using '7.18.1' instead.
Apr 09 09:48:35 raspberrypi homebridge[12318]: [4/9/2021, 09:48:35] [petkit_feeder_mini] [DEBUG] missing header: Content-Type, using 'application/x-www-form-urlencoded' instead.
Apr 09 09:48:35 raspberrypi homebridge[12318]: [4/9/2021, 09:48:35] [petkit_feeder_mini] [DEBUG] missing header: User-Agent, using 'PETKIT/7.18.1 (iPhone; iOS 14.0; Scale/3.00)' instead.
Apr 09 09:48:35 raspberrypi homebridge[12318]: [4/9/2021, 09:48:35] [petkit_feeder_mini] [DEBUG] missing header: X-TimezoneId, using 'Asia/Shanghai' instead.
Apr 09 09:48:35 raspberrypi homebridge[12318]: [4/9/2021, 09:48:35] [petkit_feeder_mini] [DEBUG] missing header: X-Locale, using 'en_US' instead.
Apr 09 09:48:35 raspberrypi homebridge[12318]: [4/9/2021, 09:48:35] [petkit_feeder_mini] [DEBUG] {"headers":{"X-Session":"7a017f399fdb4308bf67352678731ebatqQIMQxdq5P7eyDqkYhz","X-Client":"ios(14.0;iPhone12,3)","Accept":"*/*","X-Timezone":"0.0","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"},"location":"asia","model":"Feeder","enable_http_retry":true,"http_retry_count":3,"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":false,"alert_desiccant_threshold":7,"enable_autoreset_desiccant":false,"reset_desiccant_threshold":5,"enable_manualLock":false,"enable_lightMode":true,"reverse_foodStorage_indicator":false,"ignore_battery_when_charging":true,"fast_response":false,"urls":{"owndevices":"http://api.petktasia.com/latest/discovery/device_roster","deviceState":"http://api.petktasia.com/latest/feeder/devicestate?id={}","deviceDetailInfo":"http://api.petktasia.com/latest/feeder/device_detail?id={}","saveDailyFeed":"http://api.petktasia.com/latest/feeder/save_dailyfeed?deviceId={}&day={}&time={}&amount={}","removeDailyFeed":"http://api.petktasia.com/latest/feeder/remove_dailyfeed?deviceId={}&day={}&id=d{}","dailyfeeds":"http://api.petktasia.com/latest/feeder/dailyfeeds?deviceId={}&days={}","restoreDailyFeeds":"http://api.petktasia.com/latest/feeder/restore_dailyfeed?deviceId={}&day={}&id=s{}","disableDailyFeeds":"http://api.petktasia.com/latest/feeder/remove_dailyfeed?deviceId={}&day={}&id=s{}","resetDesiccant":"http://api.petktasia.com/latest/feeder/desiccant_reset?deviceId={}","updateSettings":"http://api.petktasia.com/latest/feeder/update?id={}&kv={}"},"manufacturer":"Petkit"}
elfive commented 3 years ago

sorry, there is a mistake in my code. version 2.1.4 is released, and fix that problem.

philmue1988 commented 3 years ago

i tested it and with the reverse option it is working. The trigger is now always on with low amount of food. The only issue I still facing is with the battery. In Home there still showing the alert of low battery

elfive commented 3 years ago

try to remove accessory cache using the homebridge-config-ui-x plugin: image image

philmue1988 commented 3 years ago

i don't use this.... maybe do you have the terminal command for me? :)Will it deleted all my connected devices?

elfive commented 3 years ago

it won't delete all your accesssories.

  1. goto your homebridge folder
  2. delete these two folders: accessories and persist
  3. restart homebridge.

image

philmue1988 commented 3 years ago

I saw that I have the UI thing but I don't have the option to delete things. Do you know what I can do? New version is installed Bildschirmfoto 2021-04-09 um 10 49 14

elfive commented 3 years ago

you can also launch a terminal through this config ui: image

and you can directly delete these two folders: image

philmue1988 commented 3 years ago

okay thanks I´m such a noob :D and what's the command to uninstall?

elfive commented 3 years ago

okay thanks I´m such a noob :D and what's the command to uninstall?

uninstall plugin? then it's should be:

npm uninstall <plugin-name>

or if your plugin was installed as global plugin:

npm uninstall -g <plugin-name>
philmue1988 commented 3 years ago

no I mean to delete the accessories and persist folder

elfive commented 3 years ago

be careful when you use rm command

rm -rf accessories persist

image

philmue1988 commented 3 years ago

well now I have the problem, that the home bridge is not accessible anymore in the home app? :(

philmue1988 commented 3 years ago

Apr 09 11:07:09 raspberrypi homebridge[15583]: [4/9/2021, 11:07:09] Failed to save cached accessories to disk: ENOENT: no such file or directory, open '/var/homebridge/accessories/cachedAccessories.0E9F1AD151DC'

Apr 09 11:07:09 raspberrypi homebridge[15583]: [4/9/2021, 11:07:09] Failed to save cached accessories to disk: ENOENT: no such file or directory, open '/var/homebridge/accessories/cachedAccessories' Apr 09 11:07:09 raspberrypi homebridge[15583]: [4/9/2021, 11:07:09] Your accessories will not persist between restarts until this issue is resolved.

how can I create such a folder?

elfive commented 3 years ago

to create these folder, you can use the following command:

mkdir -p accessories && mkdir -p persist

but I was wondering:

  1. did you restart you homebridge instance?
  2. what's your homebridge version?

you can use the following command to check(currently v1.3.4 is the latest version):

homebridge --version

maybe you just need update your homebridge and it will be ok?

npm install -g --unsafe-perm homebridge
philmue1988 commented 3 years ago

no I don't restart the instance. I habe the newest version and over UI it is still available but not in the home app.

still get this message Apr 09 11:23:22 raspberrypi homebridge[17006]: [4/9/2021, 11:23:22] Failed to save cached accessories to disk: EISDIR: illegal operation on a directory, open '/var/homebridge/accessories/cachedAccessories.0E9F1AD151DC' Apr 09 11:23:22 raspberrypi homebridge[17006]: [4/9/2021, 11:23:22] Your accessories will not persist between restarts until this issue is resolved.

but when I try mkdir /var/homebridge/accessories/cachedAccessories.0E9F1AD151DC its not working

do you have an idea? I don't want to insert the whole bridge again in home :(

elfive commented 3 years ago

you're using the wrong command, '/var/homebridge/accessories/cachedAccessories.0E9F1AD151DC' is a file, you cannot use mkdir to create them.

mkdir -p /var/homebridge/accessories

When you restart homebridge, homebridge will check these folders, and try to create them.

check the accessories folder permission:

ls -al

make sure the folder owned by homebridge and by group homebridge: image

if not, use the following command to change it's owner and group:

chown -R homebridge:homebridge accessories

and remember to restart homebridge.

service homebridge restart
philmue1988 commented 3 years ago

okay I did and now still this here:

Bildschirmfoto 2021-04-09 um 11 36 55

and the overview locks like this:

Bildschirmfoto 2021-04-09 um 11 37 20

philmue1988 commented 3 years ago

how can I create the file cachedAccessories.0E9F1AD151DC ?

elfive commented 3 years ago

how can I create the file cachedAccessories.0E9F1AD151DC ?

touch /var/homebridge/accessories/cachedAccessories.0E9F1AD151DC

if it says that cachedAccessories.0E9F1AD151DC is a folder, then you should first delete them:

rm -rf /var/homebridge/accessories/cachedAccessories.0E9F1AD151DC
philmue1988 commented 3 years ago

okay that helps. The message is gone but still no availability of the devices in Home. Shows me that bridge is not responding. :/ Do you have any idea for this?

elfive commented 3 years ago

try unpair and repair the homebridge? Note that this action will reset your connected accessories automation in home app, you may need set your automation after doing so.

philmue1988 commented 3 years ago

Yes I know and that is what I want to avoid

elfive commented 3 years ago

Then I really have no idea how to avoid that, sorry. That's all I know...

philmue1988 commented 3 years ago

okay I reset it :/ but now it seems that everything is working correctly!!!! THANK YOU SO MUCH!