Smartthings Integration Error - Unable to setup the SmartApp. Please try again


#1

I recently attempted to setup the new Smartthings Integration, however upon entering the access token I receive the error ‘Unable to setup the SmartApp. Please try again.’ I have tried multiple times with different tokens and permission scopes.

Is this a known error? If it helps, I used a Samsung account for login to the Smartthings IDE.

Thanks,

Joel


#2

I am having the same issue all my set up appears correct. Would appreciate any advice. Thanks in advance.


#3

Yes, Me too…


#4

I think I found the issue - my base_url did not have the ‘https://’ prefix, one of the requirements detailed in the config. I found the suggestion here - https://github.com/home-assistant/home-assistant/issues/20978.

Hope this helps.


#5

My base URL was already with HTTPS and this thing was working before. Any clue in how to fix this?
The smartapp still on Smarthings app and I cannot delete it anymore. I don’t know how because from the app is impossible.

Thu Mar 14 2019 17:12:29 GMT-0300 (Argentina Standard Time)
Error processing webhook 2c4e834439134b8e63f5811d82cd680a0bf6417987be4cf959ed1b12b0c9a4ea
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/homeassistant/components/webhook/__init__.py", line 85, in async_handle_webhook
    response = await webhook['handler'](hass, webhook_id, request)
  File "/usr/local/lib/python3.7/site-packages/homeassistant/components/smartthings/smartapp.py", line 335, in smartapp_webhook
    result = await manager.handle_request(data, request.headers)
  File "/usr/local/lib/python3.7/site-packages/pysmartapp/smartapp.py", line 173, in handle_request
    raise SmartAppNotRegisteredError(req.installed_app_id)
pysmartapp.errors.SmartAppNotRegisteredError: SmartApp handler for installed app 'd1d6004e-1c5c-444f-b5f9-e6725c94f7e0' was not found.


Thu Mar 14 2019 17:12:19 GMT-0300 (Argentina Standard Time)
API error setting up the SmartApp: {'requestId': '0C62B642-C8EE-4004-8DF7-2ED42686F8F9', 'error': {'code': 'UnexpectedError', 'message': 'A non-recoverable error condition occurred.', 'details': []}}
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/homeassistant/components/smartthings/config_flow.py", line 87, in async_step_user
    await app.refresh()  # load all attributes
  File "/usr/local/lib/python3.7/site-packages/pysmartthings/app.py", line 355, in refresh
    data = await self._api.get_app(self._app_id)
  File "/usr/local/lib/python3.7/site-packages/pysmartthings/api.py", line 164, in get_app
    return await self.get(API_APP.format(app_id=app_id))
  File "/usr/local/lib/python3.7/site-packages/pysmartthings/api.py", line 370, in get
    return await self.request('get', self._api_base + resource, params)
  File "/usr/local/lib/python3.7/site-packages/pysmartthings/api.py", line 365, in request
    data=data)
pysmartthings.errors.APIResponseError: 500, message='Internal Server Error'

#6

Could you solved it?


#7

Here is the scoop!

how the integration works

The hass_smartthings_remove utility can be run from any PC or VM. I built a linux VM to setup the python3 and PIP environment to execute the utility and it worked great. (I had an ubuntu template VM ready to go from a different project so setting up the VM took about 20 seconds)


#8

Thanks for the answer. Sadly I have hass.io then I guess the problem cannot be solved. Well I will use the older solution that basically it works as a charm and does not have any BIG issue like this nee plugin.


#9

I got the utility to cleanup ST to work just fine.

I am still trying to get things working in Hass.io… I will update if I find success…


#10

Thank you very much. I will wait for that solution. Let me know if you need more information for debugging purposes.


#11

Will it work if I remove the webhook?


#12

I have just been running the utility on a linux machine to clear the orphaned app from SF. the token on the HA side is not the issue.


#13

What are your thought then?


#14

@Javier_Dst I got it working… below is the config I used for the http section in configuration.yaml. I had to generate a Long-Lived Access Token from a user profile and insert it in so that SmartThings could auth to HA then I rebooted HA. I then installed the Home Assistant app in the SmartThings mobile client. once that installed I clicked on the link in HA to validate I could see all of my devices from SmartThings in HA… Woo Hoo!!

http:
api_password: (Long-Lived Access Token)
base_url: https://ha.insert_your_domain.org:8123
server_port: 8123
ssl_certificate: /ssl/fullchain.pem
ssl_key: /ssl/privkey.pem

Once I could see everything I tested by adding a couple cards to HA and tested them out. Success!!


#15

Trying… I will let you know ASAP.


#16

IT WORKED! So the problem is:

The missing port
The kind of password (LONG LIFE)

Thank you very much!


#17

:+1: Awesome!!