jjjonesjr33 / petlibro

Petlibro | Home Assistant integration
https://community.home-assistant.io/t/petlibro-cloud-integration-non-tuya-wip/759978
GNU General Public License v3.0
15 stars 5 forks source link

[Feature Request]: OneRFIDSmartFeeder only reports feeding quantity in cups. even if device is set to a different unit. #8

Open C4-Dimitri opened 4 weeks ago

C4-Dimitri commented 4 weeks ago

i believe you are already capturing the correct unit being used, can we please ensure the selected unit is reported instead?

jjjonesjr33 commented 4 weeks ago

@C4-Dimitri at some point I would like to figure out how to actually switch that setting via home assistant and whatever is selected it would report it that way.

C4-Dimitri commented 5 days ago

@jjjonesjr33 this might require more digging - as the devicesn isnt included in the below request - so i am guessing it figures out what device to send the change to with some of the earlier requests? right before requesting the below it makes some posts to these endpoints too: https://api.us.petlibro.com/device/setting/getAttributeSetting

{
  "id": "AF0601314D89978A9"
}

response data:

{
  "code": 0,
  "msg": null,
  "data": {
    "deviceSn": "AF0601314D89978A9",
    "lightSwitch": true,
    "lightAgingType": 1,
    "lightingStartTime": null,
    "lightingEndTime": null,
    "soundSwitch": true,
    "soundAgingType": 1,
    "soundStartTime": null,
    "soundEndTime": null,
    "volume": 50,
    "powerMode": 1,
    "autoChangeType": 1,
    "autoThreshold": 60,
    "enableAutoUpgrade": true,
    "enableBatteryPercent": false,
    "cameraSwitch": null,
    "cameraAgingType": null,
    "cameraStartTime": null,
    "cameraEndTime": null,
    "resolution": null,
    "nightVision": null,
    "videoRecordSwitch": null,
    "videoRecordMode": null,
    "videoRecordAgingType": null,
    "videoRecordStartTime": null,
    "videoRecordEndTime": null,
    "feedingVideoSwitch": null,
    "enableVideoStartFeedingPlan": null,
    "enableVideoAfterManualFeeding": null,
    "beforeFeedingPlanTime": null,
    "automaticRecording": null,
    "afterManualFeedingTime": null,
    "videoWatermarkSwitch": null,
    "motionDetectionSwitch": null,
    "motionDetectionAgingType": null,
    "motionDetectionStartTime": null,
    "motionDetectionEndTime": null,
    "motionDetectionSensitivity": null,
    "motionDetectionRange": null,
    "soundDetectionSwitch": null,
    "soundDetectionAgingType": null,
    "soundDetectionStartTime": null,
    "soundDetectionEndTime": null,
    "soundDetectionSensitivity": null,
    "enableSleepMode": null,
    "enableSleepSound": null,
    "enableSleepLight": null,
    "enableSleepAutoVacuum": null,
    "sleepStartTime": null,
    "sleepEndTime": null,
    "enableDeviceShare": true,
    "coverOpenMode": "CUSTOM",
    "coverClosePosition": 4,
    "coverCloseSpeed": "FAST",
    "enableScreenDisplay": "true",
    "screenDisplaySwitch": true,
    "screenDisplayAgingType": 1,
    "screenDisplayStartTime": null,
    "screenDisplayEndTime": null,
    "screenDisplayInterval": 2,
    "childLockSwitch": true,
    "childLockLockDuration": 30,
    "childLockUnlockDuration": 3,
    "closeDoorTime": null,
    "closeDoorTimeSec": 1,
    "errorState": false,
    "doorErrorState": "NORMAL",
    "bowlMode": null,
    "whetherInSleepMode": false,
    "ringerMode": null,
    "ringerInterval": null,
    "ringerDuration": null
  }
}

https://api.us.petlibro.com/data/data/realInfo (we already know the response layout for this, so wont post it again for the sake of brevity).

the API endpoint for changing the reporting for the onerfidfeeder:

https://api.us.petlibro.com/member/member/updateSetting post data:

{
  "feedUnitType": 1
}

unit type id corresponds to these:

1 = cup(US legal cup) 2 = oz (ounce) 3 = g (gram) 4 = ml (milliliter)

response data:

{
  "code": 0,
  "msg": null,
  "data": null
}