Integration Smartthings fails

Fixed it for me. Thank you so much for posting the linux command line step-by-step. That’s exactly what I was looking for.

I seem to be having the same problem here and have tried all the suggestions from this thread.

I had the integration set up and working but had removed some devices from the smart things integration and they still existed in home assistant, I could not find a way to remove these devices anywhere I searched, found a thread on the forum where people indicated the only real way to remove un-used devices was to remove and re-add the integration so I removed the integration which went fine but when I try to re-add it I get an error reporting “config flow could not be loaded” no matter what I try.

I have removed the left over file from and have also set the Nabu casa URL up under my external URL but I cannot seem to get past the “config flow could not be loaded” message, tried many reboots too.

Checking the log shows this error

Also every so often when I press add integration HA just hangs like this.

I also found steps in the main integration page

initially I was not able to install the ‘pip install hass_smartthings_remove’ application, I kept getting an error reporting failed to build wheel due to multidict error reporting error ‘gcc’ failed with exit status 1

After a bit of research I found that another user had similar issues and fixed them using the following commands

~ $ apk add python3
~ $ apk add python3-dev
~ $ apk add gcc musl-dev
~ $ pip3 install insteonplm (for example)

So after I ran above commands via a putty terminal session to HA I was able to install the removal application, once you install the removal application the instruction is to remove the personal access token using the following command:
hass_smartthings_remove PERSONAL_ACCESS_TOKEN

When I ran this I seem to get a 401 unauthorised error

I am really at a loss here I have spent upwards of 5 hours + trying to rectify this mess and really don’t know what I can do next???

Any help or guidance would really be appreciated

Here is aother error I seem to be getting from the logs:

Logger: aiohttp.server
Source: components/webhook/
First occurred: 20:37:20 (2 occurrences)
Last logged: 20:52:26

Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/aiohttp/", line 422, in _handle_request
    resp = await self._request_handler(request)
  File "/usr/local/lib/python3.9/site-packages/aiohttp/", line 499, in _handle
    resp = await handler(request)
  File "/usr/local/lib/python3.9/site-packages/aiohttp/", line 119, in impl
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/", line 60, in security_filter_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/", line 92, in forwarded_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/", line 24, in request_context_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/", line 78, in ban_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/", line 138, in auth_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/", line 135, in handle
    result = await result
  File "/usr/src/homeassistant/homeassistant/components/config/", line 130, in post
    return await super().post(request)
  File "/usr/src/homeassistant/homeassistant/components/http/", line 62, in wrapper
    result = await method(view, request, *args, **kwargs)
  File "/usr/src/homeassistant/homeassistant/helpers/", line 71, in post
    result = await self._flow_mgr.async_init(
  File "/usr/src/homeassistant/homeassistant/", line 197, in async_init
    flow, result = await task
  File "/usr/src/homeassistant/homeassistant/", line 224, in _async_init
    result = await self._async_handle_step(flow, flow.init_step, data, init_done)
  File "/usr/src/homeassistant/homeassistant/", line 320, in _async_handle_step
    result: FlowResult = await getattr(flow, method)(user_input)
  File "/usr/src/homeassistant/homeassistant/components/smartthings/", line 60, in async_step_user
    await setup_smartapp_endpoint(self.hass)
  File "/usr/src/homeassistant/homeassistant/components/smartthings/", line 225, in setup_smartapp_endpoint
  File "/usr/src/homeassistant/homeassistant/components/webhook/", line 45, in async_register
    raise ValueError("Handler is already defined!")
ValueError: Handler is already defined!

So no idea how or why but it just started working after hours of trying! happy its working but sad as I dont know why or how!

This was the solution. That file should be removed by default when you remove the integration and I’m not sure why it’s not being done.

Same situation as everyone else, old, orphaned entries were competing with disabled devices (e.g. left_lamp was there and I had left_lamp_2 messing up all of my stuff).

Thanks thats works for me !

Worked perfectly. Thank you!

Worked like a charm … thanks :smile:

Removing the smart things dir and reattempting install worked for me!

Also worked for me! Thank you!

Hi All since few days, my Smarthing integration is not working. Here below is the logs, can someone help me please ?
Many thanks

Logger: homeassistant.components.websocket_api.http.connection
Source: components/websocket_api/
Integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 14:54:03 (7 occurrences)
Last logged: 15:00:39

[139642221088704] 409, message='Conflict', url=URL('')
[139641665934528] 409, message='Conflict', url=URL('')
[139641665934528] 409, message='Conflict', url=URL('')
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/", line 230, in handle_call_service
  File "/usr/src/homeassistant/homeassistant/", line 2035, in async_call
    response_data = await coro
  File "/usr/src/homeassistant/homeassistant/", line 2072, in _execute_service
    return await target(service_call)
  File "/usr/src/homeassistant/homeassistant/helpers/", line 235, in handle_service
    return await service.entity_service_call(
  File "/usr/src/homeassistant/homeassistant/helpers/", line 876, in entity_service_call
    response_data = await _handle_entity_call(
  File "/usr/src/homeassistant/homeassistant/helpers/", line 948, in _handle_entity_call
    result = await task
  File "/usr/src/homeassistant/homeassistant/components/smartthings/", line 54, in async_turn_on
    await self._device.switch_on(set_status=True)
  File "/usr/local/lib/python3.11/site-packages/pysmartthings/", line 1039, in switch_on
    result = await self.command(component_id, Capability.switch, Command.on)
  File "/usr/local/lib/python3.11/site-packages/pysmartthings/", line 842, in command
    response = await self._api.post_device_command(
  File "/usr/local/lib/python3.11/site-packages/pysmartthings/", line 147, in post_device_command
    return await, data)
  File "/usr/local/lib/python3.11/site-packages/pysmartthings/", line 395, in post
    return await self.request("post", self._api_base + resource, data=data)
  File "/usr/local/lib/python3.11/site-packages/pysmartthings/", line 376, in request
  File "/usr/local/lib/python3.11/site-packages/aiohttp/", line 1005, in raise_for_status
    raise ClientResponseError(
aiohttp.client_exceptions.ClientResponseError: 409, message='Conflict', url=URL('')