core: Withings Sleep Mat Sensor never available
The problem
After configuring my Withings Sleep mat within the Withings HealthMate app, creating a development account with Withings, adding a Personal App to Withings, getting my Client ID and Client Secret, and following the Withings integration setup instructions here –https://www.home-assistant.io/integrations/withings/ – some data for the Withings integration import, but the binary sensor associated with my Sleep mat never becomes available. I have gotten into and out of bed to attempt to force the binary sensor to become available since I had seen that others had also had that sensor become available after getting into and out of bed.
I know that Withings is registering the “in bed” and “out of bed” times because I set up IFTTT to write new lines to a Google Sheet on updates, and those Sheets record all of my into and out of bed times.
To troubleshoot: I have deleted and added the integration many times. I have deleted the integration, removed the Sleep mat from my Withings, hard reset the Sleep mat, added the Sleep mat back to Withings, added the integration back to HA. All without any change in the binary sensors status.
What version of Home Assistant Core has the issue?
core-2022.3.7
What was the last working version of Home Assistant Core?
No response
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
withings:
client_id: !secret withings_id
client_secret: !secret withings_secret
use_webhook: true
Anything in the logs that might be useful for us?
Logger: homeassistant.components.withings
Source: components/withings/common.py:702
Integration: Withings (documentation, issues)
First occurred: 4:44:13 PM (1 occurrences)
Last logged: 4:44:13 PM
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 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: 10
- Comments: 72 (1 by maintainers)
As mentioned here Integration does not work with nabu’s external cloud address and that’s why withings fails to register callback correctly.
Workaround is to manually enter your cloud address to network external address field. I hope this will be fixed soon.
OK there is one setting that I just realized that I forgot to revert in my troubleshooting. I don’t know if this will do the trick, but it may be worth a try.
Settings --> System --> Network --> In here for the Home Assistant URL I disabled Use Home Assistant Cloud and I just pasted in my cloud url in this format: https://xxxxxxxxxxxx.ui.nabu.casa
hallo,
same here…never seen working !!
I just figured out my problem. When registering my withings app (on the Withing’s developer portal), I had been using the suggested “My Home Assistant” method (using the https://my.home-assistant.io/redirect/oath URL). However…I realized that I had registered my INTERNAL URL when I setup my.home-assistant, rather than my Nabu Casa URL. Do the following:
binary_sensor.withings_in_bed_username
entity state should change to occupied.Mine is working fine, yes it shows unavailable sometimes but once you get into bed it activates. It has always done this, I have been using it now for over 3yrs.
I spoke to a support guy from Withings about this Callback URL Test. Apparently the callback URL you provide must be able to respond to POST and HEAD requests in under 2000ms (2 seconds).
I notice my /auth/external/callback URL gives a “method not supported” error when attempting to make a HTTP request with both POST and HEAD method types.