Deleting SmartThings Web Hooks

I am very new to Home Assistant I had to delete and recreate my installation due to some unrecoverable mistakes I made.

As a result of this I cannot install the SmartThings integration as the old web hook is still active and I am unable to delete it.

Is anyone able to assist with this?

Thanks.

Just delete the integration and add it again.
What is the problem of reusing webhook created for smartthings ?

That’s the problem. The reinstall won’t use the old SmartThings web hook and returns an error. I need some way of deleting the old web hook from Nabu Casa.

1 Like

Hi, did you ever find a solution? I used to have the Smartthings integration running, but after a major error I had to restore Home Assistant and now when I try to connect the Smartthings integration I get an error regarding token_url and base_url. It must have something to do with the webhook. I can see the Smartthings webhook under the Home Assistant Cloud settings but I cannot remove it to start from scratch.

Did you find solution?
I registered smartthings during trial period of cloud and now whatever I do new smartthings install still shows the same webhook and samsung still the same error doesn’t matter I generate new tokens.

2022-09-26 20:54:30.002 ERROR (MainThread) [homeassistant.components.webhook] Error processing webhook 3ba1f5ab1XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXb7a
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/webhook/__init__.py", line 129, in async_handle_webhook
    response = await webhook["handler"](hass, webhook_id, request)
  File "/usr/src/homeassistant/homeassistant/components/smartthings/smartapp.py", line 505, in smartapp_webhook
    result = await manager.handle_request(data, request.headers)
  File "/usr/local/lib/python3.10/site-packages/pysmartapp/smartapp.py", line 174, in handle_request
    resp = await req.process(smartapp, headers, validate_signature)
  File "/usr/local/lib/python3.10/site-packages/pysmartapp/request.py", line 70, in process
    raise SignatureVerificationError
pysmartapp.errors.SignatureVerificationError
2022-09-26 21:03:22.027 ERROR (MainThread) [homeassistant.components.ipp.coordinator] Error fetching ipp data: Invalid response from API: Timeout occurred while connecting to IPP server.
2022-09-26 21:03:35.004 ERROR (MainThread) [homeassistant.components.brother] Timeout fetching brother data

I have public domain accessible https://homeassistant.[mydomain].com with * ssl certificate audited as “A”.
Running on raspi.

I did it! Stupid me.
I erased rm /config/.storage/smartthings

cat /config/.storage/smartthings 
{
  "version": 1,
  "minor_version": 1,
  "key": "smartthings",
  "data": {
    "instance_id": "b795XXXXXXXXXXXXXXXXXXXXXef0e",
    "webhook_id": "a16XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXeeeca7",
    "cloudhook_url": null
  }
3 Likes

In my case, it didn’t work. After deleting the file and restarting home assistant. At the moment that I start again the smartthing integration, it shows the old address and token and it recreates the deleted file.
Any ideas?

Did you delete integration, reboot, delete file, add integration? Or just stopped integration and erased file?

The integration, I am not sure if never has been started, because it had been configured wrong many months ago. It points to a lan address. It was made when I wasn’t so skilled with home assistant.
The integration does not appear next to the other ones, at least visually. But If I try to add it, it popups the error that the webhook is wrong. So the only thing I have done it was to delete the file, restart home assistant and add the integration again. In the moment that I try to add it, it shows the popup with the wrong webhook, and the file is restored in the directory.

I have the same issue… starting from few days … just after the token is expired… (it was working for over 3 months)

Now I am no longer able to add the SmartThings integration because of this generic error… (tried many times to uninstall and reinstall the integration and to generate new token… always with the same error… )

229363933-164cb9d8-6a1f-486f-8be0-bdceb40ca2f5

229363974-708b6375-69be-4541-826d-57da788e9a09

In the log I see the following…

Logger: homeassistant.components.smartthings.config_flow
Source: components/smartthings/smartapp.py:176
Integration: smartthings (documentation, issues)
First occurred: 13:23:50 (3 occurrences)
Last logged: 17:46:13

API error setting up the SmartApp: {‘requestId’: ‘160A574A-E27A-4BF5-9FF1-DFFEAB699145’, ‘error’: {‘code’: ‘ConstraintViolationError’, ‘message’: ‘The request is malformed.’, ‘details’: [{‘code’: ‘PatternError’, ‘target’: ‘targetUrl’, ‘message’: ‘targetUrl is malformed.’, ‘details’: []}]}}
API error setting up the SmartApp: {‘requestId’: ‘42420777-D6B9-44C9-AFC8-3C9801416702’, ‘error’: {‘code’: ‘ConstraintViolationError’, ‘message’: ‘The request is malformed.’, ‘details’: [{‘code’: ‘PatternError’, ‘target’: ‘targetUrl’, ‘message’: ‘targetUrl is malformed.’, ‘details’: []}]}}
API error setting up the SmartApp: {‘requestId’: ‘AA3F565B-728D-4C95-A07A-2DB85A758162’, ‘error’: {‘code’: ‘ConstraintViolationError’, ‘message’: ‘The request is malformed.’, ‘details’: [{‘code’: ‘PatternError’, ‘target’: ‘targetUrl’, ‘message’: ‘targetUrl is malformed.’, ‘details’: []}]}}
Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/components/smartthings/config_flow.py”, line 104, in async_step_pat
await update_app(self.hass, app)
File “/usr/src/homeassistant/homeassistant/components/smartthings/smartapp.py”, line 176, in update_app
await app.save()
File “/usr/local/lib/python3.10/site-packages/pysmartthings/app.py”, line 349, in save
response = await self._api.update_app(self._app_id, self.to_data())
File “/usr/local/lib/python3.10/site-packages/pysmartthings/api.py”, line 179, in update_app
return await self.put(API_APP.format(app_id=app_id), data)
File “/usr/local/lib/python3.10/site-packages/pysmartthings/api.py”, line 399, in put
return await self.request(“put”, self._api_base + resource, data=data)
File “/usr/local/lib/python3.10/site-packages/pysmartthings/api.py”, line 368, in request
raise APIResponseError(
pysmartthings.errors.APIResponseError: Unprocessable Entity (422): {“requestId”: “160A574A-E27A-4BF5-9FF1-DFFEAB699145”, “error”: {“code”: “ConstraintViolationError”, “message”: “The request is malformed.”, “details”: [{“code”: “PatternError”, “target”: “targetUrl”, “message”: “targetUrl is malformed.”, “details”: []}]}}

Any idea how to fix it?

Forgot to mention that I also deleted:

  • “smartthings” file from HA config/.storage folder
  • the “Home Assistant” automation from my SmartThings account (in the mobile App)

solved… the config for duckdns was missing some parameters… and even if it was working (the external access)… the smartthings integration would not complete the configuration without that parameters…

Yes delete the file. AND restart HA. after. Made it for me.

What were the parameters? I am stuck at this point adding ST back into HA.

I have just run into this. I performed a core update, and was informed that config was moved/renamed to homeassistant. My Smartthings integration broke at that point.

I’m using Nabu Casa.

I removed the integration, following this thread I deleted /homeassistant/.storage/smartthings and rebooted. When I try to reinstall the smartthings integration, it always defaults to a local webhook address, not the Nabu Casa link.

My other cloud integrations are working correctly.

Any suggestions appreciated.

Core 2023.11.2
Supervisor 2023.11.0
Operating System 11.1
Frontend 20231030.2

I am having a similar issue on Home Assistant VM running generic Linux install with HA supervisor install. After updating to 2024.2 Smartthings hub integration failed. Any advice would be great.

I had a similar issue. It was stuck on an invalid webhook. I went into terminal and removed anything related to smartthings

rm /config/.storage/smartthings
cd config/custom_components/
rm -rf smartthinq_sensors 

Rebooted HA and then was able to get to the SmartThings setup wizard again and put in my Personal Access Token and all worked.
BTW I am using CloudFlare tunnel