shauntarves/wyze-sdk

No support for S-series scale

Closed this issue · 3 comments

New scale device communicates with a different service back-end.

See #111

Hi @shauntarves , I am having an issue with this. Using newest version of your library (fantastic work btw) and while I can succesfully get some info from the scale, the key one I really want (latest_records) returns an empty list. How can I help? Happy to open a new issue if you want

Hey @aaronsmith1234, the scale is really finicky to work with, especially since I don't have one nearby or in my own account. This would actually be awesome if we can work together to nail down the behavior. Here's the long story, so you have some background info:

When developing/debugging the scale functionality, I've relied on the kindness of other folks to "share" their device with me via the app. The problem with this is that my user account is not able to create any weight records (due to not being physically near the scale to perform a measurement!) And, since it doesn't appear that non-owners (or maybe any user?) can see the scale records of other people, figuring out the scale records is a bit of a whack-a-mole.

Now, that said, I've determined that the Wyze App seems to default to 5 days as its idea of "latest records" when working with the scale series S or X. So that's the functionality I [tried to] replicate in the library here. If you are using the S/X series scale AND have records from within the last 5 days AND are STILL not seeing latest_records being populated when using client.scales.info(), let's work to debug why.

Out of curiosity, are you able to retrieve your own records using the client.scales.get_records() function? I use something like this in my own testing, which gets me [my manually entered] records from the last 6 months:

did = 'WL_SC2_XXXXXX'
model = 'WL_SC2'

scale = client.scales.info(device_mac=did)
if scale is not None:
  print(f"latest records: {scale.latest_records}")   <<------ this is empty when there aren't records in the past 5 days


start_time = datetime.now() - timedelta(days=180)
end_time = start_time + timedelta(days=180)

records = client.scales.get_records(device_model=model, start_time=start_time, end_time=end_time)    <<------ this should NOT be empty
if records is None or len(records) == 0:
    print("Records: (None)")
else:
    print("Records:")
    for record in records:
        print(f"\t{record.to_dict()}")

Yep, that does return records, which have timestamps within the past few days. Let me know what you need from me!