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
71.13k stars 29.8k forks source link

Smartthings no longer working after upgrade HACS to 2.0 #124367

Closed filip-heens closed 1 week ago

filip-heens commented 3 weeks ago

The problem

Hi, did anybody else notice that the (Samsung) Smartthings integration appears "broker" after the upgrade to HACS 2.0

What version of Home Assistant Core has the issue?

core-2024.8.2

What was the last working version of Home Assistant Core?

core-2024.8.2

What type of installation are you running?

Home Assistant Core

Integration causing the issue

HACS

Link to integration documentation on our website

No response

Diagnostics information

2024-08-21 18:45:09.577 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Mijn huis for smartthings Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 604, in async_setup result = await component.async_setup_entry(hass, self) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/smartthings/init.py", line 135, in async_setup_entry token = await api.generate_tokens( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/pysmartthings/smartthings.py", line 209, in generate_tokens result = await self._service.generate_tokens( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/pysmartthings/api.py", line 424, in generate_tokens raise APIInvalidGrant(data.get("error_description")) pysmartthings.errors.APIInvalidGrant: Invalid refresh token: be1b0031-1c17-48fc-964d-0edd51c6bb29 requested by clientId: 8680c77a-08c2-4bfc-95fe-c71956d82bd7 with grantType: refresh_token, e.cause: no cause

I checked the samsung API and it is still there, nothing has changed execpt for the HACS upgrade...

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

mib1185 commented 3 weeks ago

If you really think, it is caused by updating hacs, than you should report this issue to the hacs repository.

But my bet goes to https://github.com/home-assistant/core/issues/124336#issuecomment-2299880036 :thinking:

L81ker commented 3 weeks ago

If you really think, it is caused by updating hacs, than you should report this issue to the hacs repository.

But my bet goes to #124336 (comment) 🤔

I discovered during upgrade to HACS 2.0 and Core 20248.2 that SmartThings not working. Log file shows:

File "/usr/local/lib/python3.12/site-packages/pysmartthings/api.py", line 424, in generate_tokens raise APIInvalidGrant(data.get("error_description")) pysmartthings.errors.APIInvalidGrant: Invalid refresh token: 681d94f8-d949-4fe5-8904-c9b808786ff6 requested by clientId: cbf7109d-acf4-47fa-b0c0-866cca0d5fbf with grantType: refresh_token, e.cause: no cause

Is that the same deprecated pysmartthings - > looks like it is.

mib1185 commented 3 weeks ago

to exclude hacs as possible cause, please restart HA in safe mode and check again if smartthings integration is still broken

filip-heens commented 3 weeks ago

I think I solved it (at least for me it’s working again) At First I tried a restore to HACS 1.3.4 (I think… at least the version I had before upgrading 😇) Still not working… Then I found a link directing me to go to the SmartThings app itself (not HA) - go to the automations (there were 2 now? One broken and one not) - go to the HA automation, click "ready" - give access to all devices and click "Allow" And it Works again... (I hope I translated everything correctly as SmartThings is running in Dutch on my Phone 😂)

Verzonden via Outlookhttps://aka.ms/qtex0l voor IOS Let niet op de typo's van mijn dikke vingers en de autocorrectie van mijn iPhone aub

issue-triage-workflows[bot] commented 1 week ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.