Integration Smartthings fails

I’m having this issue as well and can’t find any residual entries for SmartThings in any YAML files. Anyone had any luck with this?

1 Like

same here… I have tested in a fresh install via VM and only works if you have home assistant cloud with Nabucasa, I have tried with Duckdns and no longer work… maybe some think I’m missing?

Per this issues page (https://github.com/home-assistant/core/issues/47449), have you checked to see that your external_url is configured? Two people on that page say that it worked for them.
I personally haven’t upgraded yet due to this issue, but I’m wondering if this works or not. I would think it would since hmbarbosa says that it works with Nabucasa but not Duckdns.

3 Likes

Thanks chewie8han!!!and the problem was the external_url not configured… easy fix… go to Configuration/General and add your https://*************duckdns.ogr:8123 and restart… works good here

Thanks for highlighting this, set up external_url parameter in my configuration and I am now able to install Smartthings integration.

Awesome. Glad I was able to help. This was hesitant to update to the newest release without knowing if this was working or not.

I have the external_url enabled but I continue to have issues after the recent upgrade. It says everything is successful but the integration does not show up after saying success.

Few lines in the log show below:

Could not start session, Max amount of sessions reached, got {}

8:35:02 PM – /usr/local/lib/python3.8/site-packages/pysma/init.py (ERROR) - message first occurred at 8:24:09 PM and shows up 8 times

Received message for unregistered webhook 9503cbd3152847243f7f12ef08d37292f448751453e0dbd2364fbd254870c9db from 54.83.145.181

8:33:08 PM – Webhook (WARNING)

Unable to setup configuration entry ‘Home’ - please reconfigure the integration

8:33:07 PM – SmartThings (ERROR)

Unable to load scenes for configuration entry ‘Home’ because the access token does not have the required access

8:33:07 PM – SmartThings (ERROR)

Gloom...!   

I have the same problem and have been trawling the pages trying to fix it. 

In the hope that the external_url parameter is the key I have entered my Nabu Casa address
(https://**********.ui.nabu.casa format) in the external_url parameter but get the same old “Config Flow Could Not be Loaded” message.

Do I have the external_url entry wrong?

Appreciate any experiences.

1 Like

I had the same issue. After trying the steps above and reaching the same error I found a file that was leftover after removing the earlier instance: “config/.storage/smartthings” (note that the storage folder is hidden). After deleting this smartthings file, I was able to get past this error and re-establish a connection to SmartThings. Hope this helps.

8 Likes

I’m having the same issue with smartthings how do you find this hidden folder?

Where can I find that duckdns link??

Easiest way I found was to install the Web & SSH integration. Then use use basic linux commands to navigate to the folder and rename the file in question. True enough it worked perfectly for me after that.

I found the file and removed it, but still having the same error. Any help is highly appreciated.

Thanks, this worked for me!
I wasn’t able to see the file in the file editor addon, but I could delete it using the Terminal & SSH addon.

I’d previously set up Home Assistant Cloud using Nabu Casa.

Here’s what I did:

  1. Go to Supervisor->Add-on store
  2. Search for Terminal & SSH and install it
  3. Enable “Show in sidebar”
  4. Click “Start”
  5. Open up the terminal in the sidebar
  6. Enter “cd config/.storage”
  7. Enter “ls -la” to confirm that there’s a smartthings file in the list
  8. Enter “rm smartthings” to delete the file

When I tried to set up the smartthings integration after that, I didn’t get the “Config flow could not be loaded” error.

12 Likes

This worked like a charm! thanks :slight_smile:

Thanks for the step by step. This worked perfectly.

Thank you - this solution fixed my config flow error.

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 config.storage 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.
image

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/__init__.py:45
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/web_protocol.py", line 422, in _handle_request
    resp = await self._request_handler(request)
  File "/usr/local/lib/python3.9/site-packages/aiohttp/web_app.py", line 499, in _handle
    resp = await handler(request)
  File "/usr/local/lib/python3.9/site-packages/aiohttp/web_middlewares.py", line 119, in impl
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 60, in security_filter_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 92, in forwarded_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 24, in request_context_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 78, in ban_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 138, in auth_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 135, in handle
    result = await result
  File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 130, in post
    return await super().post(request)
  File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 62, in wrapper
    result = await method(view, request, *args, **kwargs)
  File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 71, in post
    result = await self._flow_mgr.async_init(
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 197, in async_init
    flow, result = await task
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 224, in _async_init
    result = await self._async_handle_step(flow, flow.init_step, data, init_done)
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 320, in _async_handle_step
    result: FlowResult = await getattr(flow, method)(user_input)
  File "/usr/src/homeassistant/homeassistant/components/smartthings/config_flow.py", line 60, in async_step_user
    await setup_smartapp_endpoint(self.hass)
  File "/usr/src/homeassistant/homeassistant/components/smartthings/smartapp.py", line 225, in setup_smartapp_endpoint
    webhook.async_register(
  File "/usr/src/homeassistant/homeassistant/components/webhook/__init__.py", line 45, in async_register
    raise ValueError("Handler is already defined!")
ValueError: Handler is already defined!