core: Withings webhook not working

The problem

After installing Home Assistant Core 2022.6.0b1 I get the following error message

The integrations works well despite og the error message

What version of Home Assistant Core has the issue?

Home Assistant Core 2022.6.0b1

What was the last working version of Home Assistant Core?

Home Assistant Core 2022.5.*

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Withings

Link to integration documentation on our website

No response

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

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 191, in _async_refresh
    self.data = await self._async_update_data()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 150, in _async_update_data
    return await self.update_method()
  File "/usr/src/homeassistant/homeassistant/components/withings/common.py", line 663, in async_subscribe_webhook
    return await self._do_retry(self._async_subscribe_webhook)
  File "/usr/src/homeassistant/homeassistant/components/withings/common.py", line 659, in _do_retry
    raise exception
  File "/usr/src/homeassistant/homeassistant/components/withings/common.py", line 648, in _do_retry
    return await func()
  File "/usr/src/homeassistant/homeassistant/components/withings/common.py", line 705, in _async_subscribe_webhook
    await self._hass.async_add_executor_job(
  File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.9/site-packages/withings_api/__init__.py", line 348, in notify_subscribe
    self.request(path=self.PATH_NOTIFY, params=params)
  File "/usr/local/lib/python3.9/site-packages/withings_api/__init__.py", line 115, in request
    return response_body_or_raise(
  File "/usr/local/lib/python3.9/site-packages/withings_api/common.py", line 830, in response_body_or_raise
    raise InvalidParamsException(status=status)
withings_api.common.InvalidParamsException: Error code 293

Additional information

No response

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 1
  • Comments: 70 (9 by maintainers)

Most upvoted comments

In addition to the source change I needed to make over here: https://github.com/home-assistant/core/issues/68760#issuecomment-1246206834 and this amendment to the PR: https://github.com/home-assistant/core/pull/73228#pullrequestreview-1106606833

what I found I needed to do to get this integration working was:

  • Set up the Nabu Casa cloud
  • Configure hass to use Nabu Casa cloud access and enable it
  • Create a withings app and set to the callback URL to the Nabu Casa cloud URL with /auth/external/callback appended. eg: https://MAGIC.ui.nabu.casa/auth/external/callback
  • Add the withings integration and fill out the auth/secret info, then authorize the app
  • Go to cloud settings and enable the webhook callback for the withings integration
  • Copy the webhook URL
  • Go to https://developer.withings.com/dashboard/ and edit your app and add the webhook URL to the list of URLs allowed; be sure to preserve the original URL in case you decide to delete and re-add the app.
  • Click the test button on the withings portal to verify that the webhook is working: it should briefly outline the input box in green if it is good
  • Restart hass so that the webhook subscriptions are setup with the new callback URL

Update: I added that webhook that appears in the Cloud tab after enabling the integration + webhook: true config to my app and it works now:

image

Got it to work by using

Callback Uri: https://my.home-assistant.io/redirect/oauth

So all good from my side!

Workaround for now should be to configure explicitly the external URL in Settings→System→Home Assistant URL to use the cloud URL, then re-start Home Assistant. Use your NabuCasa or External URL where highlighted.

image

I have a possible fix in #73228 but I can’t test it as the one setup I have this on does not have Cloud setup for it.

If anyone can help testing that it would be very helpful.

I also cannot setup my Withings integration. The error message in the log:

2022-06-02 09:50:04 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Stefan R. for withings
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 339, in async_setup
    result = await component.async_setup_entry(hass, self)
  File "/usr/src/homeassistant/homeassistant/components/withings/__init__.py", line 119, in async_setup_entry
    const.CONF_USE_WEBHOOK: hass.data[DOMAIN][const.CONFIG][
KeyError: 'withings'

I’m not 100% sure if this is related to this issue though. Thx.