I’ve been following this guide to add my Smartthings v2 hub in to Home Assistant.
I’m running my home assistant in a Docker Container on a Ubuntu Computer I had lying around.
All steps seem to be working until the moment I get click on the the Smartthings classic app inside this path -> Automations -> SmartApps -> Add a SmartApp-> My Apps->Home Assistant
after that I just get the “Somethings went wrong” message and I got no clue how to actually fix this.
I did notice about the same time that this log appears.
2019-08-03 11:18:02 WARNING (MainThread) [homeassistant.components.http.ban] Login attempt or request with invalid authentication from xxx.xxx.xxx.151
2019-08-03 15:13:37 WARNING (MainThread) [homeassistant.components.http.ban] Login attempt or request with invalid authentication from xxx.xxx.xxx.2
2019-08-03 15:13:52 ERROR (MainThread) [aiohttp.server] Unhandled exception
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/aiohttp/web_protocol.py", line 447, in start
await resp.prepare(request)
File "/usr/local/lib/python3.7/site-packages/aiohttp/web_fileresponse.py", line 344, in prepare
return await self._sendfile(request, fobj, count)
File "/usr/local/lib/python3.7/site-packages/aiohttp/web_fileresponse.py", line 160, in _sendfile_system
writer = await self._sendfile_fallback(request, fobj, count)
File "/usr/local/lib/python3.7/site-packages/aiohttp/web_fileresponse.py", line 185, in _sendfile_fallback
writer = await super().prepare(request)
File "/usr/local/lib/python3.7/site-packages/aiohttp/web_response.py", line 353, in prepare
return await self._start(request)
File "/usr/local/lib/python3.7/site-packages/aiohttp/web_response.py", line 410, in _start
await writer.write_headers(status_line, headers)
File "/usr/local/lib/python3.7/site-packages/aiohttp/http_writer.py", line 112, in write_headers
self._write(buf)
File "/usr/local/lib/python3.7/site-packages/aiohttp/http_writer.py", line 67, in _write
raise ConnectionResetError('Cannot write to closing transport')
ConnectionResetError: Cannot write to closing transport xxx.xxx.xxx.151
Linux is not my strongest side I can do some stuff but need to look up just about everything else.
Home Assistant is currently the only one that could connect to all of my bulbs which I am happy with but considering I have Zigbee devices connected to my smatthings hub I feel it is essential to get it integrated in to Home Assistant too.
Any suggestions to how I can proceed ?
I’ve reset my smartthings hub about 5 times today each time I get the same error trying to connect to it.
Edit:
I’ve tried one more time.
this time I only got this log and it was with extended debug logging on.
2019-08-03 22:50:14 DEBUG (MainThread) [homeassistant.components.smartthings.smartapp] Setup endpoint for https://MyDomain.dk/api/webhook/4c25248caf5119c1dadc00264b5cc1b2cd2fe0a48f038e65190bf9387a149ee2
hmm I can’t even get beyond the submit button in home assistant because it keeps saying I failed in the smartthings classic smartapp. if I try to submit it will not allow me.
I tried again today a new error is what I got this time. I really am beginning to give up on smartthings. Maybe I should just get a Xaiomi Gateway or something similar to get my few Xiaomi zigbee devices integrated in to home assistant…
2019-08-04 22:52:17 ERROR (MainThread) [homeassistant.components.smartthings.config_flow] API error setting up the SmartApp: {'requestId': '4DE22CF9-3059-48BE-8FEC-BE11A39F2DCE', 'error': {'code': 'ConstraintViolationError', 'message': 'The request is malformed.', 'details': [{'code': 'TargetTimeoutError', 'target': 'https://HomeDomain.dk/api/webhook/7a8da4204034eab8979b5c1cd0448fdc0ae64a45c53a9af2b3c666240dd3f410', 'message': 'Upstream target timed out', 'details': []}]}}
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/smartthings/config_flow.py", line 95, in async_step_user
app, client = await create_app(self.hass, self.api)
File "/usr/src/homeassistant/homeassistant/components/smartthings/smartapp.py", line 108, in create_app
app, client = await api.create_app(app)
File "/usr/local/lib/python3.7/site-packages/pysmartthings/smartthings.py", line 99, in create_app
entity = await self._service.create_app(app.to_data())
File "/usr/local/lib/python3.7/site-packages/pysmartthings/api.py", line 172, in create_app
return await self.post(API_APPS, data)
File "/usr/local/lib/python3.7/site-packages/pysmartthings/api.py", line 387, in post
data=data)
File "/usr/local/lib/python3.7/site-packages/pysmartthings/api.py", line 365, in request
data=data)
pysmartthings.errors.APIResponseError: Unprocessable Entity (422): {"requestId": "4DE22CF9-3059-48BE-8FEC-BE11A39F2DCE", "error": {"code": "ConstraintViolationError", "message": "The request is malformed.", "details": [{"code": "TargetTimeoutError", "target": "https://homedomain.dk/api/webhook/7a8da4204034eab8979b5c1cd0448fdc0ae64a45c53a9af2b3c666240dd3f410", "message": "Upstream target timed out", "details": []}]}}
However after a second try right after it went through it without any issues. Could be that my phone was a bit slow when I turned off the wifi of the phone.
the smart app still says something went wrong when I go in to it but let’s see.
it doesn’t seem to detect my newly added devices
I had to redo my integration today and normally this works without a problem but today it has been driving me mad. Finally got the error in the logs
2019-08-09 15:57:46 ERROR (MainThread) [homeassistant.components.webhook] Error processing webhook 88954c4357f9966a761f97fc4acc8dcd8d16247b35b8c5ce9274d53dddb570b0
Traceback (most recent call last):
File "/usr/src/app/homeassistant/components/webhook/__init__.py", line 77, in async_handle_webhook
response = await webhook["handler"](hass, webhook_id, request)
File "/usr/src/app/homeassistant/components/smartthings/smartapp.py", line 473, in smartapp_webhook
result = await manager.handle_request(data, request.headers)
File "/usr/local/lib/python3.7/site-packages/pysmartapp/smartapp.py", line 174, in handle_request
resp = await req.process(smartapp, headers, validate_signature)
File "/usr/local/lib/python3.7/site-packages/pysmartapp/request.py", line 70, in process
raise SignatureVerificationError
pysmartapp.errors.SignatureVerificationError
Not quite sure exactly what the issue is here with this one. I get it when I try and install the app within ST then it craps out and says that “Something wetn wrong. Please try to install the SmartApp again” . Then I get multiple copies of it stuck in the installed apps but I just use postman to go delete those out of the system. I’ve created a couple of new tokens today as well trying to get over this. As always I do this with my phone off the wifi.
I am running into this same error during the initial setup for the SmartThing integration. All steps before this work fine but when I follow the link in the “This step requires you to visit an external website to be completed.” prompt I get the “Something went wrong…” message.
Tried following the link on my phone with LTE on and WiFi off. No Dice…
Looks like it’s suppose to authorize the HomeAssistant smart app but I don’t have that on the smart things side. Is it supposed to created it during the process?
If I go through the SmartThings process again I just immediately get an “Aborted” message when the link is supposed to pop up.
EDIT: Mine finally worked on my laptop after trying 6-7 or more times. Only thing that changed on my end between unsuccessful and the final successful attempt was that I tried to re-add the integration in another tab (that failed as per above). Then went back to the original tab and tried the link again and it worked. No idea why.