home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
73.47k stars 30.69k forks source link

Smartthings Integration not working right - Will not re-add started with 2021.6.8 still broken in 2021.12.2 #62149

Closed jpcarter34us closed 2 years ago

jpcarter34us commented 2 years ago

The problem

Hello Team,

I need your help. I have been using the Smartthings Integration into HomeAssistant for over a year as of this 2021-12-15 at 18:00 CDT it stopped working. At that time I was running HomeAssistant 2021.6.6 on a docker container. Post this timeframe I have tried to recreate the integration following the steps. Everything looks like it is working successfully until the last step, in which it says the Created configuration successfully for Location, The integration could not be loaded, try to restart Home Assistant. When I restart the process there is no sign the integration was loaded even at runtime. With that I upgraded progressively to the 2021.12.2 (graduating up through versions). Screen Shot 2021-12-16 at 5 32 36 PM

I have followed the steps to validate my certificate is valid and it is, ran the test on my endpoint to validate the webhook that it is valid. My SSL ciphers have not changed and I have tried to generate new personal access token and removed orphaned homeassistant applications in smartthings. I have tried to set this integration from scratch and I am still getting the same results.

The log message supplied via the container logs when this occurs suggests that the system is making a API call to smartthings and Smartthings is returning a 401 unauthorized, I have taken the personal access token and the URL listed in the log and dropped them into postman and were able to get a 200 back with some payload, so ultimately something is broken with the API usage and/or in the pysmartthings library being utilized to broker the calls.

I would be appreciative of any help, since I do like to use Homeassistant as a frontend and a main controller for my SmartHome and would like to get this going soon, please let me know if I can supply any additional data I have.

What version of Home Assistant Core has the issue?

core-2021.6.1

What was the last working version of Home Assistant Core?

core-2021.12.2

What type of installation are you running?

Home Assistant Container

Integration causing the issue

smartthings

Link to integration documentation on our website

https://www.home-assistant.io/integrations/smartthings/#webhook

Example YAML snippet

No response

Anything in the logs that might be useful for us?

2021-12-16 17:31:27 INFO (MainThread) [simplipy] Websocket watchdog triggered – sleeping for 300.0 seconds
2021-12-16 17:31:42 WARNING (MainThread) [homeassistant.helpers.service] Unable to find referenced entities switch.sthm_disarm

2021-12-16 17:31:42 ERROR (MainThread) [homeassistant.components.alexa.state_report] Error when sending ChangeReport to Alexa: INVALID_ACCESS_TOKEN_EXCEPTION: Access token is not valid.

2021-12-16 17:31:45 INFO (SyncWorker_9) [zoneminder.zm] Initializing runstate 1
2021-12-16 17:31:53 INFO (MainThread) [homeassistant.setup] Setting up smartthings

2021-12-16 17:31:53 INFO (MainThread) [homeassistant.setup] Setup of domain smartthings took 0.0 seconds

2021-12-16 17:31:56 ERROR (MainThread) [homeassistant.components.smartthings] Unable to setup configuration entry 'Scott Drive' - please reconfigure the integration

Traceback (most recent call last):

  File "/usr/src/homeassistant/homeassistant/components/smartthings/__init__.py", line 131, in async_setup_entry

    devices = await api.devices(location_ids=[installed_app.location_id])

  File "/usr/local/lib/python3.9/site-packages/pysmartthings/smartthings.py", line 87, in devices

    resp = await self._service.get_devices(params)

  File "/usr/local/lib/python3.9/site-packages/pysmartthings/api.py", line 113, in get_devices

    return await self.get_items(API_DEVICES, params=params)

  File "/usr/local/lib/python3.9/site-packages/pysmartthings/api.py", line 388, in get_items

    resp = await self.request("get", next_link, params, None)

  File "/usr/local/lib/python3.9/site-packages/pysmartthings/api.py", line 376, in request

    resp.raise_for_status()

  File "/usr/local/lib/python3.9/site-packages/aiohttp/client_reqrep.py", line 1004, in raise_for_status

    raise ClientResponseError(

aiohttp.client_exceptions.ClientResponseError: 401, message='Unauthorized', url=URL('https://api.smartthings.com/devices?locationId=5e06fe85-6c2e-4b44-aef5-77e3d02a6b8a&max=200&page=1&locationId=5e06fe85-6c2e-4b44-aef5-77e3d02a6b8a')
2021-12-16 17:31:57 WARNING (MainThread) [homeassistant.components.webhook] Received message for unregistered webhook ccde4dff711b444f9e33bbd528fedd6d4c248ff06aac9e8c036184a0d2004929 from 52.203.225.134

Additional information

No response

probot-home-assistant[bot] commented 2 years ago

smartthings documentation smartthings source (message by IssueLinks)

probot-home-assistant[bot] commented 2 years ago

Hey there @andrewsayre, mind taking a look at this issue as it has been labeled with an integration (smartthings) you are listed as a code owner for? Thanks! (message by CodeOwnersMention)

jpcarter34us commented 2 years ago

An update here. It looks like via 2021.12.3 it resolved itself. Not sure if this was on Samsung Smartthings end as well. So with that I will close this ticket out.