Smartthings integration wont work with or without casa nabu

I had the ST integration working fine. Then I had some network problems and had to reconfigure st. Now when I try to integrate I get to the point where it says you have to connect to st and then I get this error "{“requestId”:“8dcc3e4d-5166-34fb-ada6-d12e6961855e”,“error”:{“code”:“UnexpectedError”,“message”:“A non-recoverable error condition occurred.”,“details”:[]}}. I tried Hassio with nabu case and I did a fresh install of HA on a freenas box using duckdns and dehydration and got the same error.

here is the error I get on the machine using hassio and casa nabu


General
Server Controls
Logs
Info
Error in database connectivity during keepalive: This Session's transaction has been rolled back due to a previous exception during flush. To begin a new transaction with this Session, first issue Session.rollback(). Original exception was: (sqlite3.DatabaseError) database disk image is malformed [SQL: INSERT INTO events (event_type, event_data, origin, time_fired, created, context_id, context_user_id, context_parent_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?)] [parameters: ('state_changed', '{}', 'LOCAL', '2020-10-03 13:00:50.014131', '2020-10-03 13:00:50.020878', '76138cc8057811ebbc739b2fdb6854a7', None, None)] (Background on this error at: http://sqlalche.me/e/13/4xp6) (Background on this error at: http://sqlalche.me/e/13/7s2a)
9:16:51 AM – Recorder (ERROR) - message first occurred at October 2, 2020, 1:00:51 PM and shows up 84 times
Error adding state change: This Session's transaction has been rolled back due to a previous exception during flush. To begin a new transaction with this Session, first issue Session.rollback(). Original exception was: (sqlite3.DatabaseError) database disk image is malformed [SQL: INSERT INTO events (event_type, event_data, origin, time_fired, created, context_id, context_user_id, context_parent_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?)] [parameters: ('state_changed', '{}', 'LOCAL', '2020-10-03 13:15:48.668172', '2020-10-03 13:15:48.681459', '8db74608057a11eba015dff19688990d', None, None)] (Background on this error at: http://sqlalche.me/e/13/4xp6) (Background on this error at: http://sqlalche.me/e/13/7s2a)
9:16:50 AM – Recorder (ERROR) - message first occurred at October 2, 2020, 10:46:08 AM and shows up 13798 times
Error adding event: (sqlite3.DatabaseError) database disk image is malformed [SQL: INSERT INTO events (event_type, event_data, origin, time_fired, created, context_id, context_user_id, context_parent_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?)] [parameters: ('state_changed', '{}', 'LOCAL', '2020-10-03 13:15:48.668172', '2020-10-03 13:15:48.681459', '8db74608057a11eba015dff19688990d', None, None)] (Background on this error at: http://sqlalche.me/e/13/4xp6)
9:16:50 AM – Recorder (ERROR) - message first occurred at October 2, 2020, 10:46:08 AM and shows up 7306 times
Config entry for ipp not ready yet. Retrying in 40 seconds
9:16:49 AM – config_entries.py (WARNING) - message first occurred at October 2, 2020, 7:08:42 AM and shows up 3329 times
Error saving events: This Session's transaction has been rolled back due to a previous exception during flush. To begin a new transaction with this Session, first issue Session.rollback(). Original exception was: (sqlite3.DatabaseError) database disk image is malformed [SQL: INSERT INTO events (event_type, event_data, origin, time_fired, created, context_id, context_user_id, context_parent_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?)] [parameters: ('state_changed', '{}', 'LOCAL', '2020-10-03 13:15:18.653665', '2020-10-03 13:15:18.664833', '7bd36c69057a11eb80855bee6e78610d', None, None)] (Background on this error at: http://sqlalche.me/e/13/4xp6) (Background on this error at: http://sqlalche.me/e/13/7s2a)
9:16:49 AM – Recorder (ERROR) - message first occurred at October 2, 2020, 10:46:09 AM and shows up 7222 times
Error executing query: This Session's transaction has been rolled back due to a previous exception during flush. To begin a new transaction with this Session, first issue Session.rollback(). Original exception was: (sqlite3.DatabaseError) database disk image is malformed [SQL: INSERT INTO events (event_type, event_data, origin, time_fired, created, context_id, context_user_id, context_parent_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?)] [parameters: ('state_changed', '{}', 'LOCAL', '2020-10-03 13:15:18.653665', '2020-10-03 13:15:18.664833', '7bd36c69057a11eb80855bee6e78610d', None, None)] (Background on this error at: http://sqlalche.me/e/13/4xp6) (Background on this error at: http://sqlalche.me/e/13/7s2a)
9:16:49 AM – Recorder (ERROR) - message first occurred at October 2, 2020, 10:46:09 AM and shows up 7222 times
Error adding event: This Session's transaction has been rolled back due to a previous exception during flush. To begin a new transaction with this Session, first issue Session.rollback(). Original exception was: (sqlite3.DatabaseError) database disk image is malformed [SQL: INSERT INTO events (event_type, event_data, origin, time_fired, created, context_id, context_user_id, context_parent_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?)] [parameters: ('state_changed', '{}', 'LOCAL', '2020-10-03 13:14:48.669276', '2020-10-03 13:14:48.679611', '69f42ec5057a11eb87657b7fa607d43b', None, None)] (Background on this error at: http://sqlalche.me/e/13/4xp6) (Background on this error at: http://sqlalche.me/e/13/7s2a)
9:16:48 AM – Recorder (ERROR) - message first occurred at October 2, 2020, 10:46:08 AM and shows up 7557 times
Host 192.168.0.78 is not available
9:16:48 AM – radarr_upcoming_media (WARNING) - message first occurred at October 2, 2020, 7:08:42 AM and shows up 3137 times
Unable to fetch data from Google Wifi
9:16:44 AM – google_wifi (WARNING) - message first occurred at October 2, 2020, 7:08:39 AM and shows up 3138 times
Platform songpal not ready yet. Retrying in 150 seconds.
9:16:41 AM – Media player (WARNING) - message first occurred at October 2, 2020, 7:08:40 AM and shows up 2085 times
[Sony Receiver(http://192.168.0.78:10000/sony)] Unable to connect
9:16:41 AM – Sony Songpal (WARNING) - message first occurred at October 2, 2020, 7:08:42 AM and shows up 519 times
Failed to connect to 192.168.0.28:7345
9:16:28 AM – VIZIO SmartCast (WARNING) - message first occurred at October 2, 2020, 7:08:43 AM and shows up 1040 times
Stream connection failed: rtsp://Mryusef1:[email protected]/live
9:16:14 AM – Stream (ERROR) - message first occurred at October 2, 2020, 7:08:53 AM and shows up 9408 times
Connection to tcp://192.168.0.14:554?timeout=5000000 failed: Host is unreachable
9:16:14 AM – components/stream/worker.py (ERROR) - message first occurred at October 2, 2020, 7:08:53 AM and shows up 9408 times
Could not connect to Shield TV at 192.168.0.8:5555 using ADB server at 127.0.0.1:5037
9:16:14 AM – androidtv (WARNING) - message first occurred at October 2, 2020, 7:08:40 AM and shows up 526 times
Couldn't connect to 192.168.0.8:5555 via ADB server 127.0.0.1:5037 because the server is not connected to the device
9:16:14 AM – /usr/local/lib/python3.8/site-packages/androidtv/adb_manager/adb_manager_async.py (WARNING) - message first occurred at October 2, 2020, 7:08:40 AM and shows up 526 times
Error fetching ipp data: Invalid response from API: Error occurred while communicating with IPP server.
9:16:04 AM – Internet Printing Protocol (IPP) (ERROR) - message first occurred at October 2, 2020, 7:08:42 AM and shows up 1136 times
Component error: external_url - Integration 'external_url' not found.
9:06:32 AM – Hass.io (ERROR) - message first occurred at 9:04:00 AM and shows up 2 times
The 'base_url' option is deprecated, please remove it from your configuration
9:06:32 AM – HTTP (WARNING) - message first occurred at October 2, 2020, 7:23:50 AM and shows up 3 times
setup_internal_discovery failed to get info for fc127ed9-94c2-4013-a6e1-68397dc97a73, Google-Cast-Group-fc127ed994c24013a6e168397dc97a73._googlecast._tcp.local.
8:49:27 AM – Google Cast (WARNING) - message first occurred at October 2, 2020, 2:07:10 PM and shows up 249 times
[Whole House(192.168.0.142):32105] Failed to connect to service Google-Cast-Group-163d939819524839b335ed39e66a1e08._googlecast._tcp.local., retrying in 5.0s
8:45:42 AM – /usr/local/lib/python3.8/site-packages/pychromecast/socket_client.py (ERROR) - message first occurred at October 2, 2020, 12:00:28 PM and shows up 173 times
[Office speaker(192.168.0.122):8009] Heartbeat timeout, resetting connection
8:45:24 AM – /usr/local/lib/python3.8/site-packages/pychromecast/socket_client.py (WARNING) - message first occurred at October 2, 2020, 11:59:58 AM and shows up 208 times
Time out fetching recording url for camera camera.backyard
8:37:53 AM – Ring (WARNING) - message first occurred at October 2, 2020, 3:42:53 PM and shows up 55 times
Update of camera.garage1 is taking over 10 seconds
8:37:53 AM – /usr/local/lib/python3.8/asyncio/events.py (WARNING) - message first occurred at October 2, 2020, 8:38:00 AM and shows up 68 times
Unable to find referenced entities light.island_light, light.ladies_bar
8:36:36 AM – helpers/service.py (WARNING) - message first occurred at October 2, 2020, 7:09:37 AM and shows up 46 times
Error reporting state - 5: Requested entity was not found.
8:36:20 AM – Home Assistant Cloud (WARNING) - message first occurred at October 2, 2020, 7:08:51 AM and shows up 234 times
Websocket connection failed, retrying in 15s: Cannot connect to host 192.168.0.10:32400 ssl:default [Connect call failed ('192.168.0.10', 32400)]
8:22:36 AM – /usr/local/lib/python3.8/site-packages/plexwebsocket.py (ERROR) - message first occurred at 8:21:45 AM and shows up 3 times
[1st Floor(192.168.0.116):32110] Error communicating with socket, resetting connection
7:55:00 AM – /usr/local/lib/python3.8/site-packages/pychromecast/socket_client.py (WARNING) - message first occurred at October 2, 2020, 2:06:58 PM and shows up 48 times
[1st Floor(192.168.0.116):32110] Error reading from socket.
7:55:00 AM – /usr/local/lib/python3.8/site-packages/pychromecast/socket_client.py (ERROR) - message first occurred at October 2, 2020, 2:06:58 PM and shows up 48 times
Error fetching Ring device data: 401 Client Error: Unauthorized for url: https://api.ring.com/clients_api/ring_devices?api_version=9
4:43:43 AM – Ring (WARNING)
Error purging history: (sqlite3.DatabaseError) database disk image is malformed [SQL: DELETE FROM states WHERE states.last_updated < ?] [parameters: ('2020-09-17 10:12:12.456745',)] (Background on this error at: http://sqlalche.me/e/13/4xp6)
4:12:00 AM – Recorder (WARNING)
Error executing query: (sqlite3.DatabaseError) database disk image is malformed [SQL: DELETE FROM states WHERE states.last_updated < ?] [parameters: ('2020-09-17 10:12:12.456745',)] (Background on this error at: http://sqlalche.me/e/13/4xp6)
4:12:00 AM – Recorder (ERROR)
Error handling message
October 2, 2020, 11:42:30 PM – /usr/local/lib/python3.8/site-packages/hass_nabucasa/iot.py (ERROR) - message first occurred at October 2, 2020, 11:42:23 PM and shows up 2 times
Can't handle request-connection without backend
October 2, 2020, 11:42:30 PM – /usr/local/lib/python3.8/site-packages/hass_nabucasa/remote.py (ERROR) - message first occurred at October 2, 2020, 11:42:23 PM and shows up 2 times
Updating wyzeapi binary_sensor took longer than the scheduled update interval 0:00:05
October 2, 2020, 10:13:46 PM – Binary sensor (WARNING) - message first occurred at October 2, 2020, 8:37:55 AM and shows up 51 times
Error doing job: Unclosed connection
October 2, 2020, 6:53:19 PM – runner.py (ERROR) - message first occurred at October 2, 2020, 7:08:53 AM and shows up 3 times
192.168.0.99: Connecting to HUB failed with error: [Errno 113] Connect call failed ('192.168.0.99', 5222)
October 2, 2020, 6:29:31 PM – /usr/local/lib/python3.8/site-packages/aioharmony/hubconnector_xmpp.py (ERROR)
Login attempt or request with invalid authentication from 192.168.0.3 (192.168.0.3) (Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.121 Safari/537.36)
October 2, 2020, 5:33:20 PM – HTTP (WARNING) - message first occurred at October 2, 2020, 5:33:20 PM and shows up 2 times
Fetched https://remotestate.nabucasa.com/request_sync (500)
October 2, 2020, 5:28:19 PM – /usr/local/lib/python3.8/site-packages/hass_nabucasa/cloud_api.py (WARNING)
Error doing job: Task exception was never retrieved
October 2, 2020, 5:28:19 PM – components/webhook/__init__.py (ERROR)
Error doing job: Task exception was never retrieved
October 2, 2020, 5:20:41 PM – components/cloud/alexa_config.py (ERROR) - message first occurred at October 2, 2020, 1:00:50 PM and shows up 27 times
Updating wyzeapi switch took longer than the scheduled update interval 0:00:30
October 2, 2020, 5:04:45 PM – Switch (WARNING) - message first occurred at October 2, 2020, 5:03:15 PM and shows up 4 times
API error setting up the SmartApp: {'requestId': '57627A09-0199-4ABF-BC26-9EB3CBF46350', 'error': {'code': 'ConstraintViolationError', 'message': 'The request is malformed.', 'details': [{'code': 'TargetTimeoutError', 'target': 'https://yusefntosia.duckdns.org/api/webhook/2a09bb2417cdad368af05db8234be67b3139dcd23fbd16735f5f8c57000d4749', 'message': 'Upstream target timed out', 'details': []}]}}
October 2, 2020, 7:20:45 AM – smartthings (ERROR) - message first occurred at October 2, 2020, 7:16:21 AM and shows up 3 times
Exception in _async_prefs_updated called from File "/usr/local/lib/python3.8/runpy.py", line 194, in _run_module_as_main return _run_code(code, main_globals, None, File "/usr/local/lib/python3.8/runpy.py", line 87, in _run_code exec(code, run_globals) File "/usr/src/homeassistant/homeassistant/__main__.py", line 320, in <module> sys.exit(main()) File "/usr/src/homeassistant/homeassistant/__main__.py", line 312, in main exit_code = runner.run(runtime_conf) File "/usr/src/homeassistant/homeassistant/runner.py", line 133, in run return asyncio.run(setup_and_run_hass(runtime_config)) File "/usr/local/lib/python3.8/asyncio/runners.py", line 43, in run return loop.run_until_complete(main) File "/usr/local/lib/python3.8/asyncio/base_events.py", line 603, in run_until_complete self.run_forever() File "/usr/local/lib/python3.8/asyncio/base_events.py", line 570, in run_forever self._run_once() File "/usr/local/lib/python3.8/asyncio/base_events.py", line 1859, in _run_once handle._run() File "/usr/local/lib/python3.8/asyncio/events.py", line 81, in _run self._context.run(self._callback, *self._args) File "/usr/local/lib/python3.8/site-packages/aiohttp/web_app.py", line 458, in _handle resp = await handler(request) File "/usr/local/lib/python3.8/site-packages/aiohttp/web_middlewares.py", line 119, in impl return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 18, in request_context_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 72, in ban_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 127, in auth_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 129, in handle result = await result File "/usr/src/homeassistant/homeassistant/components/cloud/http_api.py", line 141, in error_handler result = await handler(view, request, *args, **kwargs) File "/usr/src/homeassistant/homeassistant/components/cloud/http_api.py", line 232, in post await cloud.logout() File "/usr/local/lib/python3.8/site-packages/hass_nabucasa/__init__.py", line 194, in logout await self.client.cleanups() File "/usr/src/homeassistant/homeassistant/components/cloud/client.py", line 128, in cleanups await self.prefs.async_set_username(None) File "/usr/src/homeassistant/homeassistant/components/cloud/prefs.py", line 179, in async_set_username await self._save_prefs({**self._prefs, PREF_CLOUD_USER: None}) File "/usr/src/homeassistant/homeassistant/components/cloud/prefs.py", line 344, in _save_prefs self._hass.async_create_task(async_create_catching_coro(listener(self))) Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/cloud/google_config.py", line 161, in _async_prefs_updated await self.async_sync_entities_all() File "/usr/src/homeassistant/homeassistant/components/google_assistant/helpers.py", line 152, in async_sync_entities_all res = await gather( File "/usr/src/homeassistant/homeassistant/components/google_assistant/helpers.py", line 148, in async_sync_entities return await self._async_request_sync_devices(agent_user_id) File "/usr/src/homeassistant/homeassistant/components/cloud/google_config.py", line 148, in _async_request_sync_devices resp = await cloud_api.async_google_actions_request_sync(self._cloud) File "/usr/local/lib/python3.8/site-packages/hass_nabucasa/cloud_api.py", line 16, in check_token await cloud.auth.async_check_token() File "/usr/local/lib/python3.8/site-packages/hass_nabucasa/auth.py", line 168, in async_check_token if not self._authenticated_cognito.check_token(renew=False): File "/usr/local/lib/python3.8/site-packages/pycognito/__init__.py", line 287, in check_token raise AttributeError("Access Token Required to Check Token") AttributeError: Access Token Required to Check Token
October 2, 2020, 7:15:51 AM – util/logging.py (ERROR)
You are using a custom integration for wyzesense which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant.
October 2, 2020, 7:14:40 AM – loader.py (WARNING) - message first occurred at October 2, 2020, 7:08:37 AM and shows up 4 times
Found duplicate device name Yusef Phone
October 2, 2020, 7:08:41 AM – Mobile App (WARNING) - message first occurred at October 2, 2020, 7:08:41 AM and shows up 2 times
Using slower stringprep, consider compiling the faster cython/libidn one.
October 2, 2020, 7:08:39 AM – /usr/local/lib/python3.8/site-packages/slixmpp/stringprep.py (WARNING)
Error setting up entry ecobee for ecobee
October 2, 2020, 7:08:39 AM – components/ecobee/__init__.py (ERROR)
 
Log Details (ERROR)
Logger: homeassistant.components.smartthings.config_flow
Source: components/smartthings/smartapp.py:145
Integration: smartthings (documentation, issues)
First occurred: October 2, 2020, 7:16:21 AM (3 occurrences)
Last logged: October 2, 2020, 7:20:45 AM

API error setting up the SmartApp: {'requestId': '57627A09-0199-4ABF-BC26-9EB3CBF46350', 'error': {'code': 'ConstraintViolationError', 'message': 'The request is malformed.', 'details': [{'code': 'TargetTimeoutError', 'target': 'https://yusefntosia.duckdns.org/api/webhook/2a09bb2417cdad368af05db8234be67b3139dcd23fbd16735f5f8c57000d4749', 'message': 'Upstream target timed out', 'details': []}]}}
API error setting up the SmartApp: {'requestId': '6436D59E-B7D6-4CF6-918F-76250EABB6AB', 'error': {'code': 'ConstraintViolationError', 'message': 'The request is malformed.', 'details': [{'code': 'TargetTimeoutError', 'target': 'https://yusefntosia.duckdns.org/api/webhook/2a09bb2417cdad368af05db8234be67b3139dcd23fbd16735f5f8c57000d4749', 'message': 'Upstream target timed out', 'details': []}]}}
API error setting up the SmartApp: {'requestId': '5D6E59F0-07D1-43C0-B93A-1FBADF102553', 'error': {'code': 'ConstraintViolationError', 'message': 'The request is malformed.', 'details': [{'code': 'TargetTimeoutError', 'target': 'https://yusefntosia.duckdns.org/api/webhook/2a09bb2417cdad368af05db8234be67b3139dcd23fbd16735f5f8c57000d4749', 'message': 'Upstream target timed out', 'details': []}]}}
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/smartthings/config_flow.py", line 131, in async_step_pat
    app, client = await create_app(self.hass, self.api)
  File "/usr/src/homeassistant/homeassistant/components/smartthings/smartapp.py", line 145, in create_app
    app, client = await api.create_app(app)
  File "/usr/local/lib/python3.8/site-packages/pysmartthings/smartthings.py", line 123, in create_app
    entity = await self._service.create_app(app.to_data())
  File "/usr/local/lib/python3.8/site-packages/pysmartthings/api.py", line 180, in create_app
    return await self.post(API_APPS, data)
  File "/usr/local/lib/python3.8/site-packages/pysmartthings/api.py", line 404, in post
    return await self.request("post", self._api_base + resource, data=data)
  File "/usr/local/lib/python3.8/site-packages/pysmartthings/api.py", line 377, in request
    raise APIResponseError(
pysmartthings.errors.APIResponseError: Unprocessable Entity (422): {"requestId": "57627A09-0199-4ABF-BC26-9EB3CBF46350", "error": {"code": "ConstraintViolationError", "message": "The request is malformed.", "details": [{"code": "TargetTimeoutError", "target": "https://yusefntosia.duckdns.org/api/webhook/2a09bb2417cdad368af05db8234be67b3139dcd23fbd16735f5f8c57000d4749", "message": "Upstream target timed out", "details": []}]}}

please help

Same problem here, did you manage to solve that?

Yes and no. I bought a Hubitat which has an integration through HACs. Works perfectly. Its better because it lets me choose what goes over to HA. Hubitat also has an integration with Smartthings so that I can get Smartthing’s devices in HA through Hubitat. However, I know the problem is on Smartthings side because I tried the integration on 3 different install of HA, 2 of which are clean installs of Hassio and HA Core. I also tried to delete the hub and location on Smartthings but got the same error. I believe its a problem with the account.

When I figured out the problem was with the account I disabled the ST hub think it would eventually clear. It has been disabled for about 5 days now. I enabled it just now and tried the integration now and it worked as expected.

I am facing the same issue. Did you find a solution to this

If you wait a few day and try again it should work. At least that has been my experience. I finally gave up on smartthings and went with a usb zwave/zigbee dongle. I don’t like that smartthings doesn’t have anyway to backup config.

believe this is the same issue that took me ages to figure out.

My issue was that when I would attempt to add the SmartThings integration, Id get to the point where I had to connect to SmartThings to authorize the hook, and it would just hang and not complete the process.

I finally found the way to create the hook was to add the integration only when I was connected via an external link into HA, in my case thats Nabu Casa. If I get off my home WiFi and use cellular so Im not on my LAN, and use the NabuCasa link to my HA, then SmartThings authorization completes no issue.

The cause appears to be related to SmartThings, but this gets everything tied out.

*** Ill be posting this seperately, but I came across this when searching for an answer to my issue:

Amazon routines are failing to trigger on SmartThings sensors exposed via Nabu Casa.
Just started, or at least I just noticed.
The sensors are showing in Alexa just fine, their states are accurate and update in a timely fashion. The issue is that Alexa doesnt recognize the trigger event and the Alexa routines I have setup all fail to trigger.
The same sensors, exposed directly to Alexa by the SmartThings skill trigger no problem.

I contacted Amazon directly, they indicate the issue is on the HA side, but will research and get back to me in 2-3 days (got to love Amazons idea of tech support).

Any ideas as to root cause of this, or how I might fix (assuming its possibly my issue??)

I can work around the issue by doing the automation on the HA side, but these are quick, “Door contact opens, announce the door opened and turn on the light” type automations, and are just simpler to slap out on the Alexa side.

Hope this helps.

Noticed you were a recent post, hope this helps.