Coder Social home page Coder Social logo

Comments (21)

joostlek avatar joostlek commented on September 26, 2024 1

You can remove them via https://my.home-assistant.io/redirect/application_credentials/

from core.

Shredder5262 avatar Shredder5262 commented on September 26, 2024 1

Following along, I'm experiencing this also for the 'in bed' sensor.

update my spouses bed sensor appeared after some time (several hours) and shows as it should. Strange because i presumed that it should show up on the next state change. However, my bed sensor remains in 'unknown' status. I've noticed that my bed sensor does go to a 'clear' state at some point while I'm sleeping and then goes back to an unknown status.

Here's a history of my sensor behavior. It does get recognized eventually, but it takes a while to display also note that i have to reboot HA quite often because of various changes so the bed sensor takes a while to recover when it does.

2024-05-15 23_57_18-History – Home Assistant - Vivaldi

update again as per usual, when i start to complain about the 'in bed' status remaining 'unknown' then it sorts itself out. Not sure why this particular sensor seems to have sporadic behaviors unlike the rest of the sensors, but for both of my persons in withings the 'in bed' sensor looks as it should.

from core.

home-assistant avatar home-assistant commented on September 26, 2024

Hey there @joostlek, mind taking a look at this issue as it has been labeled with an integration (withings) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of withings can trigger bot actions by commenting:

  • @home-assistant close Closes the issue.
  • @home-assistant rename Awesome new title Renames the issue.
  • @home-assistant reopen Reopen the issue.
  • @home-assistant unassign withings Removes the current integration label and assignees on the issue, add the integration domain after the command.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


withings documentation
withings source
(message by IssueLinks)

from core.

joostlek avatar joostlek commented on September 26, 2024

How many accounts do you have?

from core.

danbayliss avatar danbayliss commented on September 26, 2024

I have one account

from core.

joostlek avatar joostlek commented on September 26, 2024

It's saying something about invalid callback. Can you try setting up the whole integration again with new withings application credentials?

from core.

danbayliss avatar danbayliss commented on September 26, 2024

I had only set it up again a few days prior to the issue however I have just set it up again now

2024-05-14 11:41:02.061 DEBUG (MainThread) [homeassistant.components.withings] Finished fetching Withings measurements data in 0.106 seconds (success: True)
2024-05-14 11:41:02.241 DEBUG (MainThread) [homeassistant.components.withings] Finished fetching Withings activity data in 0.180 seconds (success: True)
2024-05-14 11:41:02.241 DEBUG (MainThread) [homeassistant.components.withings] Finished fetching Withings bed presence data in 0.000 seconds (success: True)
2024-05-14 11:41:02.356 DEBUG (MainThread) [homeassistant.components.withings] Finished fetching Withings goals data in 0.115 seconds (success: True)
2024-05-14 11:41:02.587 DEBUG (MainThread) [homeassistant.components.withings] Finished fetching Withings sleep data in 0.231 seconds (success: True)
2024-05-14 11:41:02.713 DEBUG (MainThread) [homeassistant.components.withings] Finished fetching Withings workout data in 0.126 seconds (success: True)
2024-05-14 11:41:03.714 DEBUG (MainThread) [homeassistant.components.withings] Registered Withings webhook at hass: https://removed.duckdns.org/api/webhook/26620dd535d26cef7f9de017210b0dd9421f3058e9ad4017cf4ae1c07e8d0705
2024-05-14 11:41:03.889 DEBUG (MainThread) [homeassistant.components.withings] Subscribing https://removed.duckdns.org/api/webhook/26620dd535d26cef7f9de017210b0dd9421f3058e9ad4017cf4ae1c07e8d0705 for 1 in 5.0 seconds

I then rebooted

2024-05-14 11:43:42.475 DEBUG (MainThread) [homeassistant.components.withings] Finished fetching Withings activity data in 0.203 seconds (success: True)
2024-05-14 11:43:42.475 DEBUG (MainThread) [homeassistant.components.withings] Finished fetching Withings bed presence data in 0.000 seconds (success: True)
2024-05-14 11:43:42.667 DEBUG (MainThread) [homeassistant.components.withings] Finished fetching Withings workout data in 0.191 seconds (success: True)
2024-05-14 11:43:42.809 DEBUG (MainThread) [homeassistant.components.withings] Finished fetching Withings goals data in 0.142 seconds (success: True)
2024-05-14 11:43:42.976 DEBUG (MainThread) [homeassistant.components.withings] Finished fetching Withings sleep data in 0.167 seconds (success: True)
2024-05-14 11:43:43.978 DEBUG (MainThread) [homeassistant.components.withings] Registered Withings webhook at hass: https://removed.duckdns.org/api/webhook/26620dd535d26cef7f9de017210b0dd9421f3058e9ad4017cf4ae1c07e8d0705
2024-05-14 11:43:44.133 DEBUG (MainThread) [homeassistant.components.withings] Subscribing https://removed.duckdns.org/api/webhook/26620dd535d26cef7f9de017210b0dd9421f3058e9ad4017cf4ae1c07e8d0705 for 1 in 5.0 seconds
2024-05-14 11:43:59.477 ERROR (Recorder) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/aiowithings/withings.py", line 107, in _request
    response = await self.session.request(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/aiohttp/client.py", line 608, in _request
    await resp.start(conn)
  File "/usr/local/lib/python3.12/site-packages/aiohttp/client_reqrep.py", line 976, in start
    message, payload = await protocol.read()  # type: ignore[union-attr]
                       ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/aiohttp/streams.py", line 640, in read
    await self._waiter
asyncio.exceptions.CancelledError

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/aiowithings/withings.py", line 106, in _request
    async with asyncio.timeout(self.request_timeout):
  File "/usr/local/lib/python3.12/asyncio/timeouts.py", line 115, in __aexit__
    raise TimeoutError from exc_val
TimeoutError

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/withings/__init__.py", line 330, in register_webhook
    await async_subscribe_webhooks(self.withings_data.client, webhook_url)
  File "/usr/src/homeassistant/homeassistant/components/withings/__init__.py", line 260, in async_subscribe_webhooks
    await client.subscribe_notification(webhook_url, notification)
  File "/usr/local/lib/python3.12/site-packages/aiowithings/withings.py", line 351, in subscribe_notification
    await self._request(
  File "/usr/local/lib/python3.12/site-packages/aiowithings/withings.py", line 115, in _request
    raise WithingsConnectionError(msg) from exception
aiowithings.exceptions.WithingsConnectionError: Timeout occurred while connecting to Withings

I then tried another reboot to see if I was being rate limited and/or if it would recover

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/withings/__init__.py", line 330, in register_webhook
    await async_subscribe_webhooks(self.withings_data.client, webhook_url)
  File "/usr/src/homeassistant/homeassistant/components/withings/__init__.py", line 260, in async_subscribe_webhooks
    await client.subscribe_notification(webhook_url, notification)
  File "/usr/local/lib/python3.12/site-packages/aiowithings/withings.py", line 351, in subscribe_notification
    await self._request(
  File "/usr/local/lib/python3.12/site-packages/aiowithings/withings.py", line 135, in _request
    raise WithingsInvalidParamsError(error)
aiowithings.exceptions.WithingsInvalidParamsError: The callback URL is either absent or incorrect

from core.

joostlek avatar joostlek commented on September 26, 2024

Double check: You used new application credentials for this?

Something is odd, Withings responds that The callback URL is either absent or incorrect. But we can definitely see the webhook url in the log messages, so it has to be that the url is incorrect. My other idea would be that there is something in your URL that withings just does not like, as I am assuming you replaced your duckdns prefix with removed

from core.

danbayliss avatar danbayliss commented on September 26, 2024

Apologies I misunderstood and reauthenticated. I'll setup a new application credential later this afternoon and give it a try. I agree with your thoughts regarding the URL but the fact it works when setting up and then doesn't later is strange.

I did change the URL to hide my duckdns name from the public

from core.

joostlek avatar joostlek commented on September 26, 2024

Understandable, can you maybe give some info about that URL? Does it contain any special characters? I am also wondering, does it always show the same URL in the logs? (this should. stay the same between restarts, but will change if you delete the integration and add it back again)

from core.

danbayliss avatar danbayliss commented on September 26, 2024

The URL is just alpha characters. Happy to share this with you in a direct message if you need it.

I've just setup a new application credential however when I add the Withings integration to Home Assistant and it redirects me to Withings website it asks me if I want to allow my old app credentials and I can't find how to switch it to use my new app credentials. I've tried to delete my old one but it takes 7 days to delete. Any idea how to force the new one?

Once I've got the new app credentials working I'll do some further testing and compare the URLs

from core.

danbayliss avatar danbayliss commented on September 26, 2024

Thanks. I've removed them and added the new app credentials and seeing the same. Below log shows me setting it up

2024-05-14 12:33:44.932 DEBUG (MainThread) [homeassistant.components.withings] Subscribing https://removed.duckdns.org/api/webhook/8704e448412be5041cc81ff791228436c699e92ce57f32690a961be4b51c38da for 16 in 5.0 seconds
2024-05-14 12:33:50.207 DEBUG (MainThread) [homeassistant.components.withings] Subscribing https://removed.duckdns.org/api/webhook/8704e448412be5041cc81ff791228436c699e92ce57f32690a961be4b51c38da for 50 in 5.0 seconds
2024-05-14 12:33:55.474 DEBUG (MainThread) [homeassistant.components.withings] Subscribing https://removed.duckdns.org/api/webhook/8704e448412be5041cc81ff791228436c699e92ce57f32690a961be4b51c38da for 51 in 5.0 seconds
2024-05-14 12:34:00.877 DEBUG (MainThread) [homeassistant.components.withings] Registered Withings webhook at Withings: https://removed.duckdns.org/api/webhook/8704e448412be5041cc81ff791228436c699e92ce57f32690a961be4b51c38da
2024-05-14 12:43:27.956 DEBUG (MainThread) [homeassistant.components.withings] Finished fetching Withings measurements data in 0.247 seconds (success: True)
2024-05-14 12:43:28.071 DEBUG (MainThread) [homeassistant.components.withings] Finished fetching Withings activity data in 0.206 seconds (success: True)
2024-05-14 12:43:28.243 DEBUG (MainThread) [homeassistant.components.withings] Finished fetching Withings sleep data in 0.142 seconds (success: True)
2024-05-14 12:43:28.260 DEBUG (MainThread) [homeassistant.components.withings] Finished fetching Withings workout data in 0.136 seconds (success: True)
2024-05-14 13:33:28.295 DEBUG (MainThread) [homeassistant.components.withings] Finished fetching Withings goals data in 0.197 seconds (success: True)

I then do the reboot and get the below. The URLs remain the same

2024-05-14 14:05:39.719 DEBUG (MainThread) [homeassistant.components.withings] Finished fetching Withings workout data in 0.156 seconds (success: True)
2024-05-14 14:05:39.834 DEBUG (MainThread) [homeassistant.components.withings] Finished fetching Withings measurements data in 0.115 seconds (success: True)
2024-05-14 14:05:40.039 DEBUG (MainThread) [homeassistant.components.withings] Finished fetching Withings sleep data in 0.205 seconds (success: True)
2024-05-14 14:05:40.153 DEBUG (MainThread) [homeassistant.components.withings] Finished fetching Withings goals data in 0.114 seconds (success: True)
2024-05-14 14:05:40.153 DEBUG (MainThread) [homeassistant.components.withings] Finished fetching Withings bed presence data in 0.000 seconds (success: True)
2024-05-14 14:05:41.155 DEBUG (MainThread) [homeassistant.components.withings] Registered Withings webhook at hass: https://removed.duckdns.org/api/webhook/8704e448412be5041cc81ff791228436c699e92ce57f32690a961be4b51c38da
2024-05-14 14:05:41.343 DEBUG (MainThread) [homeassistant.components.withings] Subscribing https://removed.duckdns.org/api/webhook/8704e448412be5041cc81ff791228436c699e92ce57f32690a961be4b51c38da for 1 in 5.0 seconds
2024-05-14 14:05:56.666 ERROR (SyncWorker_12) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/aiowithings/withings.py", line 107, in _request
    response = await self.session.request(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/aiohttp/client.py", line 608, in _request
    await resp.start(conn)
  File "/usr/local/lib/python3.12/site-packages/aiohttp/client_reqrep.py", line 976, in start
    message, payload = await protocol.read()  # type: ignore[union-attr]
                       ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/aiohttp/streams.py", line 640, in read
    await self._waiter
asyncio.exceptions.CancelledError

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/aiowithings/withings.py", line 106, in _request
    async with asyncio.timeout(self.request_timeout):
  File "/usr/local/lib/python3.12/asyncio/timeouts.py", line 115, in __aexit__
    raise TimeoutError from exc_val
TimeoutError

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/withings/__init__.py", line 330, in register_webhook
    await async_subscribe_webhooks(self.withings_data.client, webhook_url)
  File "/usr/src/homeassistant/homeassistant/components/withings/__init__.py", line 260, in async_subscribe_webhooks
    await client.subscribe_notification(webhook_url, notification)
  File "/usr/local/lib/python3.12/site-packages/aiowithings/withings.py", line 351, in subscribe_notification
    await self._request(
  File "/usr/local/lib/python3.12/site-packages/aiowithings/withings.py", line 115, in _request
    raise WithingsConnectionError(msg) from exception
aiowithings.exceptions.WithingsConnectionError: Timeout occurred while connecting to Withings```

from core.

joostlek avatar joostlek commented on September 26, 2024

Does it raise a reauth? It only says that it had a timeout, nothing more

from core.

danbayliss avatar danbayliss commented on September 26, 2024

No it doesn't. I don't see any error message in Home Assistant but my bed status is 'unknown' and doesn't change when I go and lie on it and no errors in the log at point of lying down and getting out of bed. This is what my entities looks like after it stops working

3NML191

from core.

joostlek avatar joostlek commented on September 26, 2024

Oh right, I understood that it would raise a reauth. which is incorect.

Hmm,one thing that I kinda notice is that it doesn't unsubscribe the webhooks for what matter. I would expect that it would first get a list of all notifications and remove the current ones and register new ones

from core.

danbayliss avatar danbayliss commented on September 26, 2024

Just a note. If I reload the integration, rather than delete and re-add, it appears to register the webhook but the bed sensor entity does not update when I then go and lie in the bed

**EDIT - It does then show a timeout error 10 minutes later

2024-05-14 14:43:51.105 DEBUG (MainThread) [homeassistant.components.withings] Subscribing https://removed.duckdns.org/api/webhook/8704e448412be5041cc81ff791228436c699e92ce57f32690a961be4b51c38da for 1 in 5.0 seconds```

from core.

joostlek avatar joostlek commented on September 26, 2024

Can you post the full log of that reload -> timeout?

from core.

danbayliss avatar danbayliss commented on September 26, 2024

Sure

Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/aiowithings/withings.py", line 107, in _request
    response = await self.session.request(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/aiohttp/client.py", line 608, in _request
    await resp.start(conn)
  File "/usr/local/lib/python3.12/site-packages/aiohttp/client_reqrep.py", line 976, in start
    message, payload = await protocol.read()  # type: ignore[union-attr]
                       ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/aiohttp/streams.py", line 640, in read
    await self._waiter
asyncio.exceptions.CancelledError

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/aiowithings/withings.py", line 106, in _request
    async with asyncio.timeout(self.request_timeout):
  File "/usr/local/lib/python3.12/asyncio/timeouts.py", line 115, in __aexit__
    raise TimeoutError from exc_val
TimeoutError

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/withings/__init__.py", line 330, in register_webhook
    await async_subscribe_webhooks(self.withings_data.client, webhook_url)
  File "/usr/src/homeassistant/homeassistant/components/withings/__init__.py", line 260, in async_subscribe_webhooks
    await client.subscribe_notification(webhook_url, notification)
  File "/usr/local/lib/python3.12/site-packages/aiowithings/withings.py", line 351, in subscribe_notification
    await self._request(
  File "/usr/local/lib/python3.12/site-packages/aiowithings/withings.py", line 115, in _request
    raise WithingsConnectionError(msg) from exception
aiowithings.exceptions.WithingsConnectionError: Timeout occurred while connecting to Withings
2024-05-14 14:53:49.583 DEBUG (MainThread) [homeassistant.components.withings] Finished fetching Withings sleep data in 0.174 seconds (success: True)
2024-05-14 14:53:49.600 DEBUG (MainThread) [homeassistant.components.withings] Finished fetching Withings activity data in 0.148 seconds (success: True)
2024-05-14 14:53:49.720 DEBUG (MainThread) [homeassistant.components.withings] Finished fetching Withings workout data in 0.099 seconds (success: True)
2024-05-14 14:53:49.790 DEBUG (MainThread) [homeassistant.components.withings] Finished fetching Withings measurements data in 0.074 seconds (success: True)

from core.

joostlek avatar joostlek commented on September 26, 2024

Do you have the full logs?

from core.

danbayliss avatar danbayliss commented on September 26, 2024

Here is the full log
home-assistant.log

from core.

danbayliss avatar danbayliss commented on September 26, 2024

Is there anyone who can help with this? Everytime I reboot HA I have to delete and re-add my Withings integration

from core.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.