-
Notifications
You must be signed in to change notification settings - Fork 94
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
Add support for Smart Scale #56
Comments
If you send the complete packet capture data, I will work on adding this |
POST /cloud/v1/deviceManaged/fatScale/getWeighData HTTP/1.1 {"traceId":"1600269682529","method":"getWeighData","token":"XrXv****N6d1QllmAm4g==","accountID":"13","timeZone":"America/New_York","acceptLanguage":"en","appVersion":"3.0.20","phoneBrand":"SM-G973U1","phoneOS":"Android 10","startTime":0,"endTime":1600269683,"configModule":"WiFiBT_Scale_FatScalePlus_US","cid":"0LWOQMU8kZT-0fGZMCwA1","pageSize":100,"order":"desc","index":0,"flag":1}HTTP/1.1 200 OK 384 |
Funny enough, I just started working on this a few minutes ago for my scale (ESF14) and have a (very rough) PoC going now, @jlboygenius.
Was going to work a bit more on it and then throw a PR in as there's likely some TLC it will need, but the codebase was rather friendly so I tried to keep most things normalized to existing integrations best I could. |
Here's a branch on my fork that has the above functionality working for my specific scale model. I decided not to do a PR because there's some fragility here for sure. https://github.com/mstanislav/pyvesync/tree/esf14 The scale weight comes from a pagination in an array of results. I don't have a wild amount of weigh-ins, but the default API call has a Of note, my device does not seem to provide a CID, so I had to patch core files related to that. I also had an issue with a key trying to display that was type None, so added a patch for that as well. Happy to provide more data/time on this if it's worthwhile @webdjoe. |
Thank you both for contributing. @jlboygenius can you please send packets from the device list screen, just as a double check? @mstanislav can you send me all of your captures for the scale, including the device list, scale screen and another other associated screens? I'm really curious to see how the calls are handled without a CID. The briefly looked at your code and it's a great start so just submit a PR and we will take it from there You can email me directly if it is easier at webdjoe gmail.com One of my To-Do's is to figure out a way to handle adding devices more gracefully in the core. It's too haphazard for my liking. It looks like moving away from using the CID is going to be on the list as well. I also noticed there are 9 different etekcity scales on their website. What model are each of you using? It looks like @jlboygenius your packet captures are streaming data from the vesync server, which I assume means you are standing on the scale in the app? Are there any packet captures that contain the history? It would be easier to just download the history than to continuously poll an endpoint and filter out the 0 weights, especially in HA. |
These seem to be the important API calls related to the device usage/statistics/configuration. I've redacted my accountID, token, and macID/UUID, but the rest is unchanged. The first two use v2 API endpoints, but the last uses the v1 API still as one minor note. I think that's all the useful data I see myself interacting with the app, but ping me if you want to know anything else @webdjoe! ESF14 is the model https://static.etekcity.com/files/manual/ESF14_WEB_manual_US_en.pdf
|
Here's the device info for the scale. from /cloud/v2/deviceManaged/devices { |
Thank you both for that information. I believe @mstanislav your device does not have a cid because it is not wifi enabled, it only communicates with the app, which then uploads it. There is a button in pictures of the app that says 'view data graph', does this show historical data? These api's are much more different from each other than I expected. Each one would require it's own object. @jlboygenius if you upgrade the app, is there any change? @mstanislav I see @jlboygenius There is a |
Yes, the start dates are from when I logged the data, back in September. I'm using the packet capture app on my phone. I don't think vesync likes it, because the app doesn't work right when it's capturing packets. I'm unable to capture packets showing the historical data. |
One thing I noticed about the I edited a request to change this date and it returned records after my earlier date as expected. If there's a way to cache that value (last timestamp) you could then call a request with that to find newer entries!
When you load the graph display is where the
It turns out there is! I added a second user and did a weigh-in, here are those request captures. Interestingly enough, there's a CID (which is the MAC address in my case) populated with the second user's data upload, but I don't see it used in other queries. Here are the queries related to creating a new user, adding a weight reading, retrieving data, and switching users.
|
That helps a lot. I will post when I have made some more progress |
@mstanislav I have a rough draft of the class to control your scale. @jlboygenius I haven't forgotten about you, I'll have something in a couple of days. @mstanislav check out the fork here https://github.com/webdjoe-bot/pyvesync Two options to return data - json data for subuser in kg or lbs by |
Hey @webdjoe just wanted to add a +1 for smart scale support! I have a Etekcity ESF24. I'll be taking a look at your code the next couple of days to see how you communicate with the API and such. |
interested as well! |
Any luck with this? I have a different model, but same brand. |
+1 For smart scale support. Thanks! |
+1 for Etekcity ESF-551 support. Thanks. |
I really appreciate the work done here. I've been using this for a long time to pull data into influxdb/grafana. Recently, I've decided to move over to using Home Assistant.
I keep getting this log warning: Unknown device ESF00+
Logger: pyvesync.vesync
Source: /usr/local/lib/python3.8/site-packages/pyvesync/vesync.py:174
Any way to add in this device (it's a scale)?
I have packet captures of the app calling the "/cloud/v1/deviceManaged/fatScale/getWeighData" if needed.
The text was updated successfully, but these errors were encountered: