Struggling to get Withings integrations fully operational

I just recently got this working (including in_bed sensor) after struggling for a bit. My set-up is completely without Nabu Casa / Home Assistant Cloud.

Steps to re-produce a working set-up:

  1. BEFORE adding the withings integration (or after removing) add the below to the configuration.yml file and restart. The integration seems to only read this config when it’s first added, not when it’s changed afterwards.

    withings:
      use_webhook: true
    

    See: Withings webhook for in_bed state not working · Issue #37290 · home-assistant/core · GitHub

  2. During integration set-up https://my.home-assistant.io/redirect/oauth is needed in Withings as a Callback URL to set-up the integration & authentication. The Withings website will say Partner error: Host Unreachable when you “Test” this callback. Make sure you’ve configured my.home-assistant.io to point to your external URL (duckDNS in my case).

    The set-up should be trivial after this, the re-direct will take you to my.home-assistant.io you click “Link Account” and it’ll close the tab and the integration has finished.

  3. After setting up the integration the webhook won’t be working. The trick is the following, in the file /config/.storage/core.config_entries there is now a Withings entry ("domain": "withings"). Note the following (by doing e.g. cat /config/.storage/core.config_entries from terminal):
    (a) It says "use_webhook": true (otherwise back to step 1)
    (b) It will say "webhook_id": "{UUID}" where you want to copy the {UUID} part.

  4. Go back to the Withings developer portal, add a new Callback URL using “Register Another url” and add https://{EXTERNAL_URL}/api/webhook/{UUID}. Where {EXTERNAL_URL} is the external Home Assistant URL (only accepts ports 80 or 443, for me it was XXXX.duckdns.org), and {UUID} is the UUID from step 3b. When pressing “Test” the border of the field should turn green.

  5. PROFIT!


Additional pointers should you get stuck. Enable debug logging on the Withings integration, and look for webhook related entries in the log (HELP: Received message for unregistered webhook).

18 Likes