Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SmartThings integrations broken after upgrade to 2025.1.0 #134945

Open
eclizotte opened this issue Jan 7, 2025 · 20 comments
Open

SmartThings integrations broken after upgrade to 2025.1.0 #134945

eclizotte opened this issue Jan 7, 2025 · 20 comments

Comments

@eclizotte
Copy link

The problem

Smartthings integratons Failed to Set up - been running fine for years.

What version of Home Assistant Core has the issue?

2025.1.0

What was the last working version of Home Assistant Core?

2024.12

What type of installation are you running?

Home Assistant OS

Integration causing the issue

official SmartThings

Link to integration documentation on our website

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

Diagnostics information

home-assistant_smartthings_2025-01-07T03-01-45.450Z.log
home-assistant_smartthings_2025-01-07T02-33-25.078Z.log
home-assistant_smartthings_2025-01-07T01-46-02.211Z.log

Example YAML snippet

No response

Anything in the logs that might be useful for us?

2025-01-06 21:59:35.747 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Cottage for smartthings
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 640, in __async_setup_with_context
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/smartthings/__init__.py", line 129, in async_setup_entry
    token = await api.generate_tokens(
            ^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...<3 lines>...
    )
    ^
  File "/usr/local/lib/python3.13/site-packages/pysmartthings/smartthings.py", line 209, in generate_tokens
    result = await self._service.generate_tokens(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        client_id, client_secret, refresh_token
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/usr/local/lib/python3.13/site-packages/pysmartthings/api.py", line 424, in generate_tokens
    raise APIInvalidGrant(data.get("error_description"))
pysmartthings.errors.APIInvalidGrant: Invalid refresh token requested by clientId: a226dc49-8816-49eb-b775-d1daeefcf47a with grantType: refresh_token, e.cause: no cause

Additional information

No response

@home-assistant
Copy link

home-assistant bot commented Jan 7, 2025

@eclizotte
Copy link
Author

I deleted and re-added it and it appears to come back, lets see if it stays.

@vantech14
Copy link

I can add that rebooting home assistant causes the integration to break, however it then shows as an “available integration”.

You have to re-auth with a brand new token to fix.

Subsequent reboots replicates the same issue.

@skurian25
Copy link

skurian25 commented Jan 7, 2025

Hi, might this be related to #133623 ?
EDIT: Smartthings "OAuth access tokens expire 24 hours from the time they are generated." (this is an update for any new token after 2024-12-24)

@molodoy6260
Copy link

after the update to 2025.1 every day you have to generate a new token

@eclizotte
Copy link
Author

after the update to 2025.1 every day you have to generate a new token

I'm using the same token since 2023, this is not a new token.

@cbrinks17
Copy link

after the update to 2025.1 every day you have to generate a new token

I'm using the same token since 2023, this is not a new token.

Samsung made a change that only affects new tokens created after December 30th, 2024.

If you are unlucky and had to restore a backup after that, you are out of luck.

@LazyLizardJago
Copy link

LazyLizardJago commented Jan 7, 2025

I have a similat issue as I can go through all installation steps and it says config successsfully created but it also has error message at same time. (Integration could not be loaded. Please try to restart HA) But restart does not help in any way.
HA core is on version 2025.1.1

@matt0020190
Copy link

matt0020190 commented Jan 7, 2025

Same issue here, I reverted to HA 2024.12.5 and all working again.

In 2025.1.0 the integration stops working as stated by the OP. Didn't want to delete and re-add as means potentially updating my automation entities again

@vantech14
Copy link

Has there been any movement on this? The token needs to be recreated every 24 hours which is slightly annoying.

@Schmider112
Copy link

same issue here. very disappointing

@PedroArkanson
Copy link

Who will take up the issue? Is a solution being worked on?

To be honest, I’m surprised that this topic has such a low priority and that there is hardly any feedback on it, even though 4.7% of active installations use Smartthings.

Does anyone know what will happen here in the future?

@Tobias712
Copy link

I have the same issue and would really be thankfull if this could be fixed

@dettofatto
Copy link

I have the same issue...

@Joshbloam
Copy link

I have the same issue

@jpvanhulst
Copy link

I have same issue :-(

@Denox78
Copy link

Denox78 commented Jan 11, 2025

Hi everyone,

Could someone confirm if the issue is linked to the changes Samsung made regarding the token expiring after 24H? Or is it more related to the latest 2025 version of HA OS?

I’m asking because someone mentioned having an old token and experiencing the same problem.

Can anyone else confirm encountering the issue with an old token?

@matt0020190
Copy link

matt0020190 commented Jan 11, 2025

I think it's a separate issue. When the integration stopped working, I rolled HA back and all fine again.
I've waited and a new Smartthings integration update was issued yesterday. I updated HA to the latest version and issue fixed thereafter.
I didn't do anything else including removing the integration. Therefore I'd suggest the token problem is unrelated to the 2025.1.2 update which happened to break the integration as per the OP

@matt0020190
Copy link

after the update to 2025.1 every day you have to generate a new token

I'm using the same token since 2023, this is not a new token.

Samsung made a change that only affects new tokens created after December 30th, 2024.

If you are unlucky and had to restore a backup after that, you are out of luck.

Worth adding that this seems to be why the token problem is caused. If you tried to fix the issue with Smartthings and the new version of HA in 2025.1.x, you might have created a new token after 30.12.24 which now expire every 24h. Therefore you may be out of luck as suggested.
Sometimes it's worth sitting tight and opposed to reinstalling integrations, wait for updates after a new version of HA breaks them

@Jens-Wymeersch
Copy link

I have the same issue with the token. Not sure how to address it with samsung though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests