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

Withings integration in HA broke #68

Open
Bluhme1 opened this issue Apr 13, 2021 · 9 comments
Open

Withings integration in HA broke #68

Bluhme1 opened this issue Apr 13, 2021 · 9 comments

Comments

@Bluhme1
Copy link

Bluhme1 commented Apr 13, 2021

Hi Robert
Are you still developing this Integration.
Since 2021.3.0 we (approximately 300 users) have had issues. We now get sleep data in nicely thanks to @ronaldheft . But no data from scale, blood pressure and others.

@myplatox
Copy link

Same here, i can query my devices (scale) but no measures/weight data.

@Sebwap
Copy link

Sebwap commented Aug 19, 2021

Hello,

Same here.
Any request to measure_get_meas return an empty result.
Oauth is ok since my device is visible.

Please help :(

@Sebwap
Copy link

Sebwap commented Aug 21, 2021

Finally got a workaround by myself:
problem is located in withings_api_init_.py file:
in measure_get_meas function, line 152, a default value is added for parameter "lastupdate" and is set to now. As you can't have a measure after this date, it's impossible to obtain a return. I just comment out theses lignes

#update_params( # params, "lastupdate", lastupdate, lambda val: arrow.get(val).int_timestamp #)

and everything work !

@myplatox
Copy link

Thanks for your help @Sebwap it really work out that way. but i have to use the start/enddate with smth like this
meas_result = api.measure_get_meas(startdate=arrow.utcnow().shift(days=-21), enddate=arrow.utcnow())

But anyway...!

@Sebwap
Copy link

Sebwap commented Aug 23, 2021

Yes it's mandatory to use either start/enddate either lastupdate.
You can't simply obtain last value with no parameter.

@ArjanM83
Copy link

ArjanM83 commented Feb 4, 2022

Thank you @Sebwap for pointing out this issue. I have resolved this in my code without commenting out the line, but instead now I also provide a value for the lastupdate:

measure_get_meas(startdate=datetime.datetime.utcnow().date(), lastupdate=None)

@jwstc99
Copy link

jwstc99 commented Mar 29, 2022

@ArjanM83 THANK U <<<333

@Xlinx64
Copy link

Xlinx64 commented Mar 29, 2022

Is this a permanent fix? Can we do a PR on this and bump the version of the api in home assistant?

@jwstc99
Copy link

jwstc99 commented Mar 29, 2022

@Xlinx64 I cant confirm this is a permanent fix, but it worked for me. Looks like what they said above is true, startdate and enddate are mutually exclusive with lastupdate. However they all are given default value, so if you use startdate and enddate, you must set lastupdate to None, and vice versa, if you use lastupdate, then you must set startdate and enddate to None. Hope this helps you!

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

No branches or pull requests

6 participants