Withings Scales

It is not merged yet so it won’t be on the website, but you can see the docs in raw format on Github here.

Extremely excited for this integration!

Good news it has been merged.

Can’t wait! Perhaps a 0.98.2 release? :stuck_out_tongue:
Hopefully it will make it into 0.99 anyway.

New features don’t get added to service releases. If it gets merged within the next two weeks it will be a part of 0.99

2 Likes

Hi,

I just installed 0.99 and saw that the Withings integration was released but I get some errors while I am trying to set it up, during the OAuth2 process.

During the process I am redirected to the Withings website, I approve the prompt and at the end, there is a call to my Home Assistant server (available on the Internet) that ends with an error 500 Internal Server Error.
The url looks like this:
https://<home_assistant_url>/api/withings/authorize?flow_id=xxxxx64eccc7cfd&profile=BP&code=xxxxxfc7f5b204fdb040ce19c58e930ed175&state=xxxxxOdE5TmoNgFWrO1Ckbh7S8k

and the error in the logs is the following

2019-09-19 17:56:48 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/aiohttp/web_protocol.py", line 418, in start
    resp = await task
  File "/usr/local/lib/python3.7/site-packages/aiohttp/web_app.py", line 458, in _handle
    resp = await handler(request)
  File "/usr/local/lib/python3.7/site-packages/aiohttp/web_middlewares.py", line 119, in impl
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/real_ip.py", line 40, in real_ip_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 73, in ban_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 231, in auth_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 128, in handle
    result = await result
  File "/usr/src/homeassistant/homeassistant/components/withings/config_flow.py", line 182, in get
    flow_id, {const.PROFILE: profile, const.CODE: code}
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 89, in async_configure
    result = await self._async_handle_step(flow, cur_step["step_id"], user_input)
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 132, in _async_handle_step
    result: Dict = await getattr(flow, method)(user_input)
  File "/usr/src/homeassistant/homeassistant/components/withings/config_flow.py", line 132, in async_step_finish
    return await self._async_create_session(profile, code)
  File "/usr/src/homeassistant/homeassistant/components/withings/config_flow.py", line 139, in _async_create_session
    credentials = auth_client.get_credentials(code)
  File "/usr/local/lib/python3.7/site-packages/nokia/__init__.py", line 86, in get_credentials
    client_secret=self.consumer_secret)
  File "/usr/local/lib/python3.7/site-packages/requests_oauthlib/oauth2_session.py", line 307, in fetch_token
    self._client.parse_request_body_response(r.text, scope=self.scope)
  File "/usr/local/lib/python3.7/site-packages/oauthlib/oauth2/rfc6749/clients/base.py", line 421, in parse_request_body_response
    self.token = parse_token_response(body, scope=scope)
  File "/usr/local/lib/python3.7/site-packages/oauthlib/oauth2/rfc6749/parameters.py", line 431, in parse_token_response
    validate_token_parameters(params)
  File "/usr/local/lib/python3.7/site-packages/oauthlib/oauth2/rfc6749/parameters.py", line 441, in validate_token_parameters
    raise MissingTokenError(description="Missing access token parameter.")
oauthlib.oauth2.rfc6749.errors.MissingTokenError: (missing_token) Missing access token parameter.

I am running the 0.99 version on RPi3 using the latest stable docker image.

Any idea how I could fix that?
Thanks

Ben

I couldn’t get this to work in 0.99b

https://github.com/home-assistant/home-assistant/issues/26613

My self and others can’t get it working in 0.99 either

https://github.com/home-assistant/home-assistant/issues/26716

@difeta / Vangorra did mention possibly having to wait for a new nokia 1.2.1 release. But then the ticket got closed / resolved. So we will have to wait and see?

Trying to configure but after selecting profile on Withiongs web page a receive error:

{"errors":[{"message":"redirect_uri_mismatch: The redirect URI provided is missing or does not match partner callback url"}]}

Any idea what is wrong?

My URI in Withings is my HomeAssistant web port available from outside on port 80.

The integration isn’t working.

Have a read on the second link to GitHub I posted on the previous post, there is also mention about the error you are getting and how to resolve it.

1 Like

There is information on getting Withings working with a temporary work around, using the Custom deps deployment.

I have linked to the exact comment.

2 Likes

Thank you!

hey,
i followed the steps in teh workaround, however im still getting the error:

{“errors”:[{“message”:“redirect_uri_mismatch: The redirect URI provided is missing or does not match partner callback url”}]}

when i use the URL in my withings dev app - does my nabu casa URL work?

eg, using this:
https://xxxfake.ui.nabu.casa/

If that’s your externap address then yes.

You may also need the following in your configuration.yaml

http:
  base_url: https://xxxfake.ui.nabu.casa
2 Likes

thanks! that did the trick :smile:

Does anyone know which sensors on the hassio side are the sleep mat occupancy sensors? Looking at the data, nothing looks like a binary on/off?

I guess that this is not yet available from the Withings API, but it might be implemented soon: 👋 Welcome | Withings " [Soon] Notify : subscribing to sleep events is now possible. Sleep events are triggered when users get in or get out of the bed. To get more information, please go to Notify - Subscribe"

1 Like

Is anybody else getting errors like this? 160,000 times over the last few days…

Have no clue what “measure groups” means or why it is causing so many non-stop errors. I own the Withings WS-50 scale and the Withings sleep tracking pad.

No measure groups found, setting state to None
2:04 AM components/withings/sensor.py (WARNING) - message first occured at September 22, 2019, 10:03 PM and shows up 160014 times

No sleep data, setting state to None
2:04 AM components/withings/sensor.py (WARNING) - message first occured at September 28, 2019, 6:13 PM and shows up 2591 times

I am. I ended up turning off the integration. I had posted somewhere else asking and had not seen any replies so I thought maybe there just were not a lot of people using this yet. I only have two sleep pads

Yup, got massive amount of them in the log to!

Updated to 0.100.2 with the fix from Vangorra. Integration and authorisation work fine but I also get a huge number of errors in the log. But I get the data into HA as I want to.
When I used the files as custom_components I did’t get the errors but on the other hand I was told constantly that I had a new integration ready for configuring (even though it was configured all ready)
Did anyone find a solution for the error messages

@SeanM. Did you find an explanation / fix for all the error messages? Is it at HA end or at the API end?

Hi @Bluhme
can you summarize how you get it workinkg?
thanks