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
6 stars 5 forks source link

[Device]: Support for PLAF203 GRANARY Smart Camera Feeder - Camera Monitoring 5L #4

Open matthewlehew opened 1 week ago

matthewlehew commented 1 week ago

Device model name

GRANARY Smart Camera Feeder - Camera Monitoring 5L

Device model number

PLAF203

Device type

Feeder

What state, statistic or control do you want to be reported in the integration ?

Highest priority: the same feeding, food level, desiccant status as available in the PLAF103 Secondary priority: camera feeds, motion and sound detection alerts

Can provide any needed info as necessary, manual available here: https://cdn.shopify.com/s/files/1/0252/5197/1119/files/PETLIBRO_Granary_Camera_Dual_Food_Tray_Feeder_PLAF203_V2_USER_MANUAL_2.pdf?v=1698059425

Available to help integrate the new device

jjjonesjr33 commented 1 week ago

Hey @matthewlehew would you be able to provide information on what the api pulls or give temporary shared access to this device via my support account?

trentsmart commented 1 week ago

Sorry @jjjonesjr33 this is the exact model I have, I'm just now seeing this. Sorry for the mixup.

jjjonesjr33 commented 1 week ago

All good @trentsmart , same comment goes tho for you as well 😄 the easiest way I can see what I am working with is via temporary shared access. If you okay with that, I have a test account setup via support@jonesinc.dev that you can give access to via the Petlibro app on your phone.

If I can see the data with my own eyes I can build it.

matthewlehew commented 1 week ago

Access link is sent @jjjonesjr33, but app warns it's only valid for 30 mins. Let me know if I need to send another.

jjjonesjr33 commented 1 week ago

Thanks @matthewlehew I see it now on my side now. I'll take a look at it shortly and see what I can get going.

jjjonesjr33 commented 6 days ago

@matthewlehew, @trentsmart here is what I was able to pull and put together. Tell me what you guys think. Is there anything we need to add from the API in logs below that you would like info for in your dashboard? I went ahead an added the info for the Video camera, however I am not sure where/how we can pull the video in yet. I wonder if there is a different API call that I don't know about for live video feeds.

A couple of things we will need to test @matthewlehew is the battery. Looks like you just have it plugged into the wall without a backup battery installed. We would just need to know if it reports a correct value for the device.

I did test the enable, disable, and feed buttons so if your kitty got an extra helping earlier that was me 😄 Besides that I know once I get the switches in order for the RFID feeder I'll add that functionality to all devices since it's across the board.

From baseInfo

2024-10-18 17:06:03.862 DEBUG (MainThread) [custom_components.petlibro.api] Making POST request to [https://api.us.petlibro.com/device/device/baseInfo](https://api.us.petlibro.com/device/device/baseInfo%3C/span%3E)
2024-10-18 17:06:03.987 DEBUG (MainThread) [custom_components.petlibro.api] Response data: {'code': 0, 'msg': None, 'data': {'deviceSn': 'AF03013530C879617', 'thirdSn': None, 'mac': 'CC:64:1A:43:A6:56', 'batchId': 131, 'productId': 23, 'productName': 'Granary Smart Camera Feeder', 'productIdentifier': 'PLAF203', 'icon': 'https://oss.us.petlibro.com/dlcloud/platform/product_icon/product_icon_66b4a81de54e92de3584836f.png', 'name': 'Cat Feeder', 'firstCategoryId': 1, 'secondCategoryId': 2, 'memberId': 188861048, 'timezone': 'America/New_York', 'enableFeedingPlan': True, 'enableAutoUpgrade': True, 'enableNotice': True, 'noticeType': 1, 'noticeStartTime': '', 'noticeEndTime': '', 'enableFeedingPlanNotice': True, 'enableFeedingPlanAdvanceNotice': True, 'feedingPlanAdvanceNoticeTime': 5, 'enableSurplusGrainNotice': True, 'enableLowBatteryNotice': True, 'enablePowerChangeNotice': True, 'enableVacuumSuccessNotice': True, 'enableVacuumFailedNotice': True, 'enableOfflineNotice': True, 'offlineNoticeType': 1, 'enableGrainOutletBlockedNotice': True, 'enableNoGrainOutNotice': True, 'enableDrinkingWaterNotice': True, 'enableLowWaterNotice': True, 'enableFilterReplacementReminder': True, 'remainingReplacementDays': 3, 'enableMachineCleaningReminder': True, 'remainingCleaningDays': 3, 'enableTankOverturnedNotice': True, 'unitType': 1, 'batteryDisplayType': None, 'enableReGrainNotice': True, 'petCareKind': 'FREE', 'deviceOwner': False}}

From grainStatus

2024-10-18 16:55:03.033 DEBUG (MainThread) [custom_components.petlibro.api] Making POST request to [https://api.us.petlibro.com/device/data/grainStatus](https://api.us.petlibro.com/device/data/grainStatus%3C/span%3E)
2024-10-18 16:55:03.127 DEBUG (MainThread) [custom_components.petlibro.api] Response data: {'code': 0, 'msg': None, 'data': {'todayFeedingQuantities': [3, 3, 4, 3, 3], 'todayFeedingQuantity': 16, 'todayFeedingTimes': 5}}

And then from realInfo

2024-10-18 16:57:03.130 DEBUG (MainThread) [custom_components.petlibro.api] Making POST request to [https://api.us.petlibro.com/device/device/realInfo](https://api.us.petlibro.com/device/device/realInfo%3C/span%3E)
2024-10-18 16:56:03.183 DEBUG (MainThread) [custom_components.petlibro.api] Response data: {'code': 0, 'msg': None, 'data': {'deviceSn': 'AF03013530C879617', 'mac': 'CC:64:1A:43:A6:56', 'timezone': 'America/New_York', 'hardwareVersion': '1.0.7', 'softwareVersion': '3.0.33', 'online': True, 'onlineList': [{'online': True, 'ts': 1725217014012}], 'wifiSsid': 'Interwebz', 'wifiRssi': -55, 'wifiRssiLevel': 3, 'powerMode': 1, 'powerType': 1, 'electricQuantity': 0, 'batteryState': 'low', 'surplusGrain': True, 'vacuumState': True, 'pumpAirState': True, 'motorState': 2, 'grainOutletState': True, 'audioUrl': 'https://oss.us.petlibro.com/dlcloud/platform/audio/audio_66d4d547e54ed82c1d6a89f2.aac', 'volume': 100, 'enableLight': True, 'lightSwitch': True, 'lightAgingType': 1, 'enableSound': True, 'soundSwitch': True, 'soundAgingType': 1, 'remainingDesiccantDays': -33, 'changeDesiccantFrequency': 14, 'desiccantNextChangeTime': 1726426614012, 'weightPercent': 0, 'weightState': 'NORMAL', 'weight': 0.0, 'waterBoxStatus': -1, 'todayTotalMl': 0, 'calibration': True, 'vacuumMode': 'NORMAL', 'enableCamera': True, 'cameraSwitch': True, 'cameraAgingType': 1, 'resolution': 'P1080', 'nightVision': 'AUTOMATIC', 'enableVideoRecord': False, 'videoRecordSwitch': False, 'videoRecordMode': 'MOTION_DETECTION', 'videoRecordAgingType': 1, 'cloudVideoRecordSwitch': True, 'feedingVideoSwitch': True, 'enableVideoStartFeedingPlan': True, 'enableVideoAfterManualFeeding': True, 'beforeFeedingPlanTime': 1, 'automaticRecording': 20, 'afterManualFeedingTime': 10, 'videoWatermarkSwitch': False, 'enableMotionDetection': True, 'motionDetectionSwitch': True, 'motionDetectionAgingType': 1, 'motionDetectionSensitivity': 'MEDIUM', 'motionDetectionRange': 'LARGE', 'enableSoundDetection': True, 'soundDetectionSwitch': True, 'soundDetectionAgingType': 1, 'soundDetectionSensitivity': 'MEDIUM', 'snowflake': True, 'barnDoorError': False, 'errorState': False, 'runningState': 'IDLE', 'doorErrorState': 'NORMAL', 'bowlMode': 'DOUBLE_BOWL', 'whetherInSleepMode': False, 'ringerMode': 'NORMAL', 'ringerInterval': 2, 'ringerDuration': 10, 'cameraAuthInfo': '0B80Z80880480280L80EIup0'}}

image

jjjonesjr33 commented 6 days ago

This has been completed - https://github.com/jjjonesjr33/petlibro/releases/tag/v1.0.8

jjjonesjr33 commented 6 days ago

@matthewlehew I'm going to leave this open just until we can get the camera feed added, that would be my next push I would like to do for this device if we can figure out the access for the feed.

matthewlehew commented 6 days ago

This looks incredible! And the cats definitely appreciate the extra food haha.

trentsmart commented 4 days ago

Awesome. I have been waiting for this. I really appreciate the work you have done for this.