WIthings config

Hi I was able to get parameter code and parameter state from the auth. (using an external url for base_url config ).
But the homeassistant still asks to configure it…

What shall I do?

I’m using the version: 0.100.0b3

While it may not address the problem, please upgrade to a full release and try again.

Same with 0.100.1

Same, but maybe better that I explain how I proceed, as I have similar problem with fitbit.

Distribution: hassio
Setup: on Synology virtual machine

Now the big question is if this is correct, I placed on the configuration

Blockquote
withings:
client_id: …
client_secret: …
profiles:
- …
base_url: myaddress.com/...oauth2callback/index.php

But the myaddress.com is somewhere else and not where the hassio is installed (I did the same for nibeuplink).
When I proceedon the integration menu of HA is it going to withings and goes until the authorization and I get:

Blockquote
myaddress.com/...oauth2callback/index.phpOAuth2 Callback Script
Parameter ‘code’ found, value is: …
Parameter ‘state’ found, value is: …

At this stage I think that HA does not get this info.

I have to admit that I do not know the principle of this kind of authentication,
but I would see 2 possible approaches…

  1. the possibility to add somewhere on the configuration the received code and state.
  2. add ssl on HA setup, assign the address of my dyndns, make port forwarding and setup http server…
    I would really prefer the ooption 1) if possible…

I hope that my explanation is not to messy …
Thanks

Unfortunately you didn’t format your code, as explained in this sticky post. Please take a moment to read all of that, and then edit your post accordingly.

It might be though that the problem is you forgot to specify https:// in your base_url.

Regarding your response:
When I replaced the dummy address I also removed the info about https.

Maybe you are right to point me to the sticky post… Is it regarding the info missing?
Maybe we could have a template for the basic info, like “distribution” version…

I would like to be able to setup the withings health integration.
I have a virtual image on synology of hassio, now version 0.101.0 (but same with previous versions)

My problem is when I want to proceed with the url verification.

Let’s reformulate it, is this correct:

  1. configuration.yaml under “withings:” the “base url: https://blablabla.bla:8123
  2. Withings application configuration for the “url callback” I placed “https://blablabla.bla/
  3. I made a redirect on my router of port 8123 to my internal IP address of hassio setup

Question1: Is the approach just described correct?
Question2: Is the data placed on the steps 1) , 2) and 3) correct from the format and port info correct?
Question3: For step 1) is it ok even if I do not have ssl installed on my hassio setup?

Thanks

I also have a question about setting up my withings w/ HA.
The instruction page asks me to create a development account … this requires a ’ Callback Url’ ( https://your-domain-name/auth/external/callback)

Could someone advise how to generate a callback Url? is this my HA address w/ duck DNS, etc?

Yes it is  

Do I need to setup something up special on my HA box?

All you have to do is set up the integration as explained in the docs.

I set it up but get an error when I try to login in through Withings to finalize “ Missing client_id or scope in the request parameters”

Any ideas?
Thanks!

I was able to get the Withings integration up and running without any issues. The only things I noticed that I can’t seem to find is a way to change the weight from kg to lb and the height in m to ft?

Thanks,

Hi @Jtmoore81,

At the bottom of the Withings integration docs, it shows examples on how to create template sensors to convert kg to lb.

I just did it and it’s working great. Cheers.

Thanks. Not sure how I missed that.

Did you ever end up figuring this out? I cannot for the life of me get this working and I’ve done exactly what the instructions say to do. I can get to the authorization on the withings site but once I hit accept it just errors out with

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

I’ve tried replacing as base url as the withings home assistant page says but all I can ever get is a 404 error. I’ve tried every modifications to the callback URL that I can think of and none of them work. I’m using the nabu casa url for this.

yes, I had to have https running on my ha box to get this to work

Well that explains it. I should probably set that up anyways. Thanks for the tip.

Dear all,

I’m a new user to Home Assistant so hoping this is the right place for this… I’m trying to get the Withings integration to work with my Home Assistant. I followed the steps as described perfectly and everything seems to work smoothly. So I’ve set up the dev account with Withings, linked it to my Home Assistant (which is running on a https link with a valid Lets Encrypt SSL certificate). Everything else works perfectly.

Now when I add the Withings Integration, it connects and pulls a whole load of sensors into Home Assistant. However, it only seems to pull the sensors from my Steel HR watch, not from the scales, the blood pressure monitor or the thermometer. Particularly the scales (which also measure temperature & CO2 levels in the bedroom) are interesting for me to monitor in HA.

Checking the log I get the following error message:

ValueError: 123 is not a valid MeasureType

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/withings/common.py", line 219, in call
    result = await self._hass.async_add_executor_job(function)
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/withings/common.py", line 254, in function
    return self._api.measure_get_meas()
  File "/usr/local/lib/python3.7/site-packages/withings_api/__init__.py", line 159, in measure_get_meas
    self.request(path=self.PATH_MEASURE, params=params)
  File "/usr/local/lib/python3.7/site-packages/withings_api/common.py", line 649, in new_measure_get_meas_response
    for group in data.get("measuregrps", ())
  File "/usr/local/lib/python3.7/site-packages/withings_api/common.py", line 649, in <genexpr>
    for group in data.get("measuregrps", ())
  File "/usr/local/lib/python3.7/site-packages/withings_api/common.py", line 637, in new_measure_get_meas_group
    for measure in data.get("measures", ())
  File "/usr/local/lib/python3.7/site-packages/withings_api/common.py", line 637, in <genexpr>
    for measure in data.get("measures", ())
  File "/usr/local/lib/python3.7/site-packages/withings_api/common.py", line 621, in new_measure_get_meas_measure
    type=new_measure_type(data.get("type")),
  File "/usr/local/lib/python3.7/site-packages/withings_api/common.py", line 117, in new_measure_type
    return cast(MeasureType, enum_or_raise(value, MeasureType))
  File "/usr/local/lib/python3.7/site-packages/withings_api/common.py", line 403, in enum_or_raise
    return enum(value)
  File "/usr/local/lib/python3.7/enum.py", line 310, in __call__
    return cls.__new__(cls, value)
  File "/usr/local/lib/python3.7/enum.py", line 564, in __new__
    raise exc
  File "/usr/local/lib/python3.7/enum.py", line 548, in __new__
    result = cls._missing_(value)
  File "/usr/local/lib/python3.7/enum.py", line 577, in _missing_
    raise ValueError("%r is not a valid %s" % (value, cls.__name__))
ValueError: 123 is not a valid MeasureType

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 312, in _async_add_entity
    await entity.async_device_update(warning=False)
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 474, in async_device_update
    await self.async_update()
  File "/usr/src/homeassistant/homeassistant/components/withings/sensor.py", line 358, in async_update
    await self._data_manager.update_measures()
  File "/usr/src/homeassistant/homeassistant/components/withings/common.py", line 256, in update_measures
    self._measures = await self.call(function, throttle_domain="update_measures")
  File "/usr/src/homeassistant/homeassistant/components/withings/common.py", line 240, in call
    raise PlatformNotReady(ex)
homeassistant.exceptions.PlatformNotReady: 123 is not a valid MeasureType

Anyone have any idea what’s going on here?

Hi OrangeTang. I get the same error as you. I’m using the nabu casa url for this . Have you found a way to fix it? thank you very much

Krock. I had the same error. Can you guide me a little more? thank you very much