Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can Filter and Brush Life be retrieved with SDK? #64

Closed
iceman73 opened this issue Feb 1, 2022 · 8 comments · Fixed by #77
Closed

Can Filter and Brush Life be retrieved with SDK? #64

iceman73 opened this issue Feb 1, 2022 · 8 comments · Fixed by #77
Assignees

Comments

@iceman73
Copy link

iceman73 commented Feb 1, 2022

Like the title states, can this be retrieved from the API?

@romedtino
Copy link

romedtino commented Mar 30, 2022

I poked around a little for this and found this endpoint

https://wyze-venus-service-vn.wyzecam.com/plugin/venus/get_iot_prop?keys=main_brush%2Cside_brush%2Cfilter%2Cdishcloth&did=VAC_DID_NUMBER&nonce=1648664542813

which returns

{
  "code": 1,
  "current": 1,
  "data": {
    "did": "VAC_DID_NUMBER",
    "is_online_send": false,
    "is_sub_device": false,
    "is_update_shadow": false,
    "model": "JA_RO2",
    "parent_did": null,
    "parent_model": null,
    "props": {
      "filter": 178,
      "dishcloth": 0,
      "side_brush": 178,
      "main_brush": 178
    }
  },
  "hash": "1",
  "instance_id": "abcdefghijklmnopqrstuv",
  "message": "Success",
  "total": 1,
  "version": 1
}

But the values for filter, side_brush and main_brush don't correlate to what I see in the app: -28hrs, 22hr and 122hrs 🤔🤷‍♀️

(Also, please don't judge my current filter hours lol I clearly haven't looked at my filters in quite a bit...)

@romedtino
Copy link

Ohh, the value returned is the hours used for each component and they just subtract it from their "recommended" max hours of usage

main brush: 300 hrs
side brush: 200 hrs
HEPA filter: 150 hrs

@romedtino
Copy link

I was able to add some semblance of this feature in my fork - See commit here - romedtino@a21c22d

If you're interested shaun, I can do a PR of this let me know

@iceman73
Copy link
Author

iceman73 commented Apr 5, 2022

This worked, Thankyou

@shauntarves
Copy link
Owner

I'm working on this now...should have a new version released in a day or so with these changes. @iceman73 @romedtino my plan was something like vacuum.supplies.filter returns a simple object/dictionary for each component that contains the a) number of "used" hours, b) recommended life, c) calculated number of hours remaining. Does that sound reasonable?

@romedtino
Copy link

Works for me 👍.

@shauntarves
Copy link
Owner

@romedtino can you check out the branch and see if it suits your needs? After calling vacuum.info(..., you should now have access to the supplies like:

print(f"supplies:")
print(f"  filter usage: {vacuum.supplies.filter.usage} hours  remaining: {vacuum.supplies.filter.remaining} hours")
print(f"  main brush usage: {vacuum.supplies.main_brush.usage} hours  remaining: {vacuum.supplies.main_brush.remaining} hours")
print(f"  side brush usage: {vacuum.supplies.side_brush.usage} hours  remaining: {vacuum.supplies.side_brush.remaining} hours")

@shauntarves shauntarves self-assigned this May 5, 2022
@shauntarves shauntarves linked a pull request May 5, 2022 that will close this issue
@romedtino
Copy link

Yep! Just tried and it looks good to me

supplies:
  filter usage: 16 hours  remaining: 134 hours
  main brush usage: 199 hours  remaining: 101 hours
  side brush usage: 199 hours  remaining: 1 hours

I'll change my side brush soon I promise 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants