Withings Scale integration not working

Hi,

I am trying to get my Withings scale integration working but having trouble. I followed the instructions on the integration page (Withings - Home Assistant) but to no avail.

I am using duckdns for my external domain link rather than nabucasa and I haver set my external domain to the duckdns address (in the UI config rather than on the YAML file)

Here is what I have set up in my yaml file:

# Withings
withings:
    client_id: MYCLIENTID
    client_secret: MYSECRET
    use_webhook: true

logger:
  default: warning
  logs:
    homeassistant.components.withings: debug

When I look at the logs here is the error messages:

2022-01-12 22:41:41 DEBUG (MainThread) [homeassistant.components.withings] Configuring withings webhook

2022-01-12 22:41:41 DEBUG (MainThread) [homeassistant.components.withings] Subscribing https://myexternaldomain.duckdns.org:8123/api/webhook/25f2a98f6ba4197cd15a418173b017900d14b7e7ca8c380bb006a8b4 for NotifyAppli.WEIGHT in 5.0 seconds

2022-01-12 22:41:45 ERROR (MainThread) [homeassistant.components.withings] Unexpected error fetching subscription_update_coordinator data: Error code 293

Traceback (most recent call last):

File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 187, in _async_refresh

self.data = await self._async_update_data()

File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 147, in _async_update_data

return await self.update_method()

File "/usr/src/homeassistant/homeassistant/components/withings/common.py", line 660, in async_subscribe_webhook

return await self._do_retry(self._async_subscribe_webhook)

File "/usr/src/homeassistant/homeassistant/components/withings/common.py", line 656, in _do_retry

raise exception

File "/usr/src/homeassistant/homeassistant/components/withings/common.py", line 649, in _do_retry

return await func()

File "/usr/src/homeassistant/homeassistant/components/withings/common.py", line 702, in _async_subscribe_webhook

await self._hass.async_add_executor_job(

File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 52, in run

result = self.fn(*self.args, **self.kwargs)

File "/usr/local/lib/python3.9/site-packages/withings_api/__init__.py", line 311, in notify_subscribe

self.request(path=self.PATH_NOTIFY, params=params)

File "/usr/local/lib/python3.9/site-packages/withings_api/__init__.py", line 78, in request

return response_body_or_raise(

File "/usr/local/lib/python3.9/site-packages/withings_api/common.py", line 825, in response_body_or_raise

raise InvalidParamsException(status=status)

withings_api.common.InvalidParamsException: Error code 293

2022-01-12 22:41:45 DEBUG (MainThread) [homeassistant.components.withings] Finished fetching subscription_update_coordinator data in 19.522 seconds (success: False)

2022-01-12 22:41:47 ERROR (MainThread) [homeassistant.components.withings] Unexpected error fetching subscription_update_coordinator data: Error code 293

It seems to be showing an error code 293 which other people have encountered but I their issues seem to be a bit different to mine.

I did some other research which seemed to indicate that the redirect uri on the withings side will only accept port 443 or 80 whereas home assistant is operating on port 8123. On the error logs it is showing that the webhook API isusing port 8123 but I have gone back and checked that the uri on my withing developer app does not have the port number included.

Any assistance would be appreciated.

Gavin

The webhhok url is generated from your HA “external url” configuration setting.
I guess you have 8123 there.

Unfortunately not, I have removed the port number when specifying my external URL…although when I look in the logs it appears that the port number is included…see below:

22-01-12 22:41:41 DEBUG (MainThread) [homeassistant.components.withings] Subscribing [u]https://myexternaldomain.duckdns.org:8123/[/u]api/webhook/25f2a98f6ba4197cd15a418173b017900d14b7e7ca8c380bb006a8b4 for NotifyAppli.WEIGHT in 5.0 seconds

so I dont know where it is getting the information which has the port number

Withings wants you to use https
Go into home assistant system and network and change it to

https://myexternaldomain.duckdns.org

Now you need letsecrypt to get a free SSL certificate
Also your going to need to port forward 443 to homeassistant.local:8123
You will probably has to use HA actual IP address.

Now back to your withings account.

callback url
https://myexternaldomain.duckdns.org/auth/external/callback

Save that change.

Try the integration again report the results.

Hi all,
I’m new in this community.
If I well understood is not possible to change the port used by the Withings service to notify the data because their service only use port 80 or 443.
In my scenario I have exposed another port on the router that forward to my local HA instance so no option.
Is it correct?

Many Thanks,
Francesco