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

Samsung purposefully broke SmartThings integration on Dec 30 #133623

Closed
NewsGuyTor opened this issue Dec 19, 2024 · 354 comments
Closed

Samsung purposefully broke SmartThings integration on Dec 30 #133623

NewsGuyTor opened this issue Dec 19, 2024 · 354 comments

Comments

@NewsGuyTor
Copy link

The problem

https://community.smartthings.com/t/changes-to-personal-access-tokens-pat/292019

TLDR: Newly generated PATs will only work for 24 hours, which will be absurdly annoying for new users of this integration, so a change to OAuth auth is needed ASAP.

What version of Home Assistant Core has the issue?

NA

What was the last working version of Home Assistant Core?

NA

What type of installation are you running?

Home Assistant OS

Integration causing the issue

No response

Link to integration documentation on our website

No response

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

@NewsGuyTor NewsGuyTor changed the title Samsung will limit PATs to 24h on Dec 30 2024, breaking SmartThings Samsung will limit PATs to 24h on Dec 30 2024, breaking SmartThings integration Dec 19, 2024
@home-assistant
Copy link

@dengi76
Copy link

dengi76 commented Dec 29, 2024

Hello. I confirm the above! Today my token stopped working, I created a new one and when registering access (on the Samsung website) a notification appeared that access was created for an hour! What should I do?
Thank you!

@CarnsJalone
Copy link

This aligns with what I am seeing. Currently popping open the smartthings component to take a peek at the implementation. Does anyone know of another component that uses oauth 2.0 I can draw architectural reference from?

@joostlek
Copy link
Member

joostlek commented Jan 3, 2025

I'm trying to look into this but it doesn't look like we can use our normal oauth flow.

@ice3m
Copy link

ice3m commented Jan 4, 2025

Whew who ever gets SmartThings to stop giving me rate limits and doesn't make me get a new PAT every 24 hours will be my hero.

Sure you guys have seen it but here's their documentation on the OAuth flow:

https://developer.smartthings.com/docs/connected-services/oauth-integrations

@ozcet
Copy link

ozcet commented Jan 5, 2025

I am an old user of PAT. I restored from backup with mandatory new PAT. Now all my ST integration expired after 24 hours. Any progress for OAuth developement?

@dejatesting2
Copy link

Any word on the OAuth ? Half of my automations break every day due to an invalid token issue

@NewsGuyTor
Copy link
Author

Any word on the OAuth ? Half of my automations break every day due to an invalid token issue

I recommend you make a new thread here: https://community.smartthings.com/latest

@dejatesting2
Copy link

Any word on the OAuth ? Half of my automations break every day due to an invalid token issue

I recommend you make a new thread here: https://community.smartthings.com/latest

Why would I make a thread there? This is an issue with Home Assistant using PATs vs the OAuth method SmartThings wants people to use.... SmartThings has made the change and are not going back, this has to be changed on the home assistant integration side

@gemx
Copy link

gemx commented Jan 8, 2025

Also encountered this problem. Besides the short TTL i can only issue 1 commnd in 20 seconds due to rate limiting.
The integration is just not usable in this state.
Should we file a new ticket as feature request for the OAuth method?

@ozcet
Copy link

ozcet commented Jan 8, 2025

After PAT expire, HA get data only from read-only entities. I cannot execute actions. This is valid only If you do not restart HA. Temperature sensors values are correct. Strange !

@CarnsJalone
Copy link

So after a small bit of investigation, I believe (I am totally new to Home Assistant) that the underlying mechanism of control is the pysmartthings package and the specific method responsible for generating the token is located here.

If you look closely, the type of grant being used is basic (username + password --> very common in personal access token authentication). This is where my gut tells me the change would need to occur.

If my assumptions are correct, there's an additional problem, this repository has been archived on May 9, 2024. I don't know if there's an additional fork of this repository that is being supported.

@LiveMike78
Copy link

I wasn't aware of this and it coincided with me finally tidying up my SmartThings devices with the hass-smarthings-remove script. I thought I'd borked the integration by doing that. Subscribed to this thread to see when a solution drops. It's a major impact for me as my front door lock is connected via SmartThings to add redundancy (if I can't unlock with Home Assistant, I can fall back on SmartThings) but my family all use HA exclusively.

@daath
Copy link

daath commented Jan 11, 2025

Interested in seeing what the solution to this will be ...

@Jens-Wymeersch
Copy link

@joostlek 4% of the community are using this integration (and it is a key feature of NabuCasa). Is there any timeline to fix this problem ?

@NewsGuyTor NewsGuyTor changed the title Samsung will limit PATs to 24h on Dec 30 2024, breaking SmartThings integration Samsung purposefully broke SmartThings integration on Dec 30 Jan 11, 2025
@joostlek
Copy link
Member

Why would it be a key feature of nabu casa?

We're still looking into but trust me, it's difficult. I don't have any timeline as for now

@Jens-Wymeersch
Copy link

@joostlek one of the reasons why I'm using NabuCasa is because the integration with Amazon and Smartthings was made easy. And thank you for taking a crack at it !
Of course, I also wanted to support the home assistant project.

@NewsGuyTor
Copy link
Author

@Jens-Wymeersch I recommend moving away from Samsung products and SmartThings, they broke this on purpose despite having received plenty of warning.

@Jens-Wymeersch
Copy link

@NewsGuyTor we have in total 7 A/Cs - 6 of the 7 are controlled locally but one with smartthings. I'm not planning to replace these devices in the near future (cost is way too high).
I have one a/c left which needs to be replaced, might be thinking of another manufacturer for that one

@snok3r-krk
Copy link

For some reason, integration over PAT has been working for me for the last two or three days. I have not noticed any changes in the integration itself, and I was also unable to find any changes on Samsung's side (using community.smartthings). Any idea what is happening?

@Roukanken42
Copy link

Roukanken42 commented Jan 12, 2025

@snok3r-krk Interesting, I've just recreated a PAT to test this, and at least the very strict API limits are not there right now (was like 1 request / minute?). Will have to wait to see if it has longer TTL too, or if they just relaxed the limits.

@PrayerfulDrop
Copy link

ST reversed their decision temporarily for those with legacy PAT. All users who did not delete and create a new PAT should be good until HA fixes with OAUTH.

@joostlek
Copy link
Member

joostlek commented Mar 1, 2025

I'm not sure what you mean? Why would you want to run it as custom component? The integration doesn't work without SSE and isn't planned to work that way

@Ishima
Copy link
Contributor

Ishima commented Mar 1, 2025

there are many that don't use default config or cloud in their configs. now samsung has also one ring to rule us all, as we all are linking to one st app and it's just that 'sse' which should be optional...

@joostlek
Copy link
Member

joostlek commented Mar 1, 2025

There's nothing I can do for that, I'm sorry

@Ishima
Copy link
Contributor

Ishima commented Mar 1, 2025

no worries, I have workaround. anyway, I checked the other problem with fan oscilation and now the problem leads to payload in pysmartthings. will get back to you with details.

NO more samsung devices for me (smart or not) until they allow local api

@Ishima
Copy link
Contributor

Ishima commented Mar 1, 2025

it's old ac, new app can't even add it (after that it works normally)

`2025-03-01 15:16:12.100 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Home for smartthings
Traceback (most recent call last):
File "", line 93, in mashumaro_from_dict_json
File "", line 41, in mashumaro_from_dict_json
mashumaro.exceptions.MissingField: Field "platform_version" of type str is missing in OCF instance

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "", line 9, in mashumaro_from_json
File "", line 95, in mashumaro_from_dict_json
mashumaro.exceptions.InvalidFieldValue: Field "ocf" of type Optional[OCF] in Device has invalid value {'ocfDeviceType': 'oic.d.airconditioner', 'name': 'Room A/C', 'specVersion': 'core.1.1.0', 'verticalDomainSpecVersion': 'res.1.1.0,sh.1.1.0', 'manufacturerName': 'Samsung Electronics', 'modelNumber': 'TP6X_RAC_15K', 'vendorId': 'DA-AC-RAC-100001', 'lastSignupTime': '2024-11-25T22:17:37.928118320Z', 'transferCandidate': False, 'additionalAuthCodeRequired': False}

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 753, in __async_setup_with_context
result = await component.async_setup_entry(hass, self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/smartthings/init.py", line 100, in async_setup_entry
devices = await client.get_devices()
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.13/site-packages/pysmartthings/smartthings.py", line 202, in get_devices
return DeviceResponse.from_json(resp).items
~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
File "", line 11, in mashumaro_from_json
mashumaro.exceptions.InvalidFieldValue: Field "items" of type list[Device] in DeviceResponse has invalid value [{'deviceId': 'F8042E25-0E53-0000-0000-000000000000', 'name': 'Room A/C', 'label': 'Corridor A/C', 'manufacturerName': 'Samsung Electronics', 'presentationId': 'DA-AC-RAC-100001', 'deviceManufacturerCode': 'Samsung Electronics', 'locationId': '5df0730b-38ed-43e4-b291-ec14feb3224c', 'ownerId': '63b9c79b-90fe-5262-9a6a-5e24db90915e', 'roomId': '547b08f3-505a-44b9-a893-773dab079f22', 'deviceTypeName': 'Samsung OCF Air Conditioner', 'components': [{'id': 'main', 'label': 'main', 'capabilities': ['ocf', 'switch', 'airConditionerMode', 'airConditionerFanMode', 'temperatureMeasurement', 'thermostatCoolingSetpoint', 'airQualitySensor', 'dustSensor', 'odorSensor', 'refresh', 'execute', 'samsungce.driverVersion', 'samsungce.driverState', 'custom.thermostatSetpointControl', 'custom.disabledCapabilities'], 'categories': [{'name': 'AirConditioner', 'categoryType': 'manufacturer'}], 'manufacturer_category': 'AirConditioner'}], 'createTime': '2024-11-25T22:17:38.129Z', 'profile': {'id': '9e3e03b1-7f8c-3ea2-8568-6902b79b99dd'}, 'ocf': {'ocfDeviceType': 'oic.d.airconditioner', 'name': 'Room A/C', 'specVersion': 'core.1.1.0', 'verticalDomainSpecVersion': 'res.1.1.0,sh.1.1.0', 'manufacturerName': 'Samsung Electronics', 'modelNumber': 'TP6X_RAC_15K', 'vendorId': 'DA-AC-RAC-100001', 'lastSignupTime': '2024-11-25T22:17:37.928118320Z', 'transferCandidate': False, 'additionalAuthCodeRequired': False}, 'type': 'OCF', 'restrictionTier': 0, 'allowed': [], 'executionContext': 'CLOUD', 'relationships': []}, {'deviceId': 'C0972777-40F4-0000-0000-000000000000', 'name': 'Washer', 'label': 'Washer', 'manufacturerName': 'Samsung Electronics', 'presentationId': 'DA-WM-WM-100001', 'deviceManufacturerCode': 'Samsung Electronics', 'locationId': '5df0730b-38ed-43e4-b291-ec14feb3224c', 'ownerId': '63b9c79b-90fe-5262-9a6a-5e24db90915e', 'roomId': '4fa9334c-f0e8-4e97-8c3a-16c2be572486', 'deviceTypeName': 'Samsung OCF Washer', 'components': [{'id': 'main', 'label': 'main', 'capabilities': [{'id': 'ocf', 'version': 1}, {'id': 'execute', 'version': 1}, {'id': 'refresh', 'version': 1}, {'id': 'switch', 'version': 1}, {'id': 'remoteControlStatus', 'version': 1}, {'id': 'washerOperatingState', 'version': 1}, {'id': 'samsungce.driverVersion', 'version': 1}, {'id': 'samsungce.washerOperatingState', 'version': 1}], 'categories': [{'name': 'Washer', 'categoryType': 'manufacturer'}]}], 'createTime': '2023-12-03T02:57:50.347Z', 'profile': {'id': '4d7ca844-d20d-39eb-bf8f-3063d4722b07'}, 'ocf': {'ocfDeviceType': 'oic.d.washer', 'name': 'Washer', 'specVersion': 'core.1.1.0', 'verticalDomainSpecVersion': 'res.1.1.0,sh.1.1.0', 'manufacturerName': 'Samsung Electronics', 'modelNumber': 'TP6X_WW6500|FF18E000|', 'vendorId': 'DA-WM-WM-100001', 'lastSignupTime': '2023-12-03T02:57:50.221205Z', 'transferCandidate': False, 'additionalAuthCodeRequired': False}, 'type': 'OCF', 'restrictionTier': 0, 'allowed': [], 'executionContext': 'CLOUD', 'relationships': []}]`

@joostlek
Copy link
Member

joostlek commented Mar 1, 2025

Can you please download the device status and the device overview json? You seem to know how the API work. It would be helpful as I think we should support this one as well

@Ishima
Copy link
Contributor

Ishima commented Mar 1, 2025

@joostlek here is get_devices result from pysmartthings and export from my.smartthings. Let me know if you need something else, I'm just playing with this since yesterday...

pysmartthings.json
Device Commands.json
Devices.json

@Ishima
Copy link
Contributor

Ishima commented Mar 2, 2025

@joostlek those two PRs solves my problem with AC, just need to fix tests (still new to python...)
pySmartThings #175
Integration: #139616

and here is a PR to fix sse #139610
I really hope that there was no deal with Samsung and HA didn't went back on their local policies...
Already tested that this works with my set up and even that you CAN create new ST account and custom app.

@joostlek
Copy link
Member

joostlek commented Mar 2, 2025

@Ishima do you also have the device status per device?

@Ishima
Copy link
Contributor

Ishima commented Mar 2, 2025

@joostlek which endpoint is it?

@Ishima
Copy link
Contributor

Ishima commented Mar 2, 2025

thanks for help with tests, I can't fire them locally....

@joostlek
Copy link
Member

joostlek commented Mar 2, 2025

/devices/<device_id>/status from the top of my head

@Ishima
Copy link
Contributor

Ishima commented Mar 2, 2025

ok, give me few minutes

@joostlek
Copy link
Member

joostlek commented Mar 2, 2025

But let's continue this conversation in your PR

@Ishima
Copy link
Contributor

Ishima commented Mar 2, 2025

good thing you wanted to check, pyST has problem with samsungce.driverState field

state.json

@joostlek
Copy link
Member

joostlek commented Mar 2, 2025

It did just accept it right? I made it so that it logged everything

@joostlek
Copy link
Member

joostlek commented Mar 2, 2025

just to verify, did you change your device_ids or were they uppercase to begin with?

@miketarg
Copy link

miketarg commented Mar 2, 2025 via email

@Ishima
Copy link
Contributor

Ishima commented Mar 2, 2025

@joostlek it's working under HA, this error is from pyST, didn't saw it before as I just fixed blockers from HA logs.
pyST stops with Unknown capability samsungce.driverState. Please raise an issue at https://github.com/pySmartThings/pysmartthings.

@joostlek
Copy link
Member

joostlek commented Mar 2, 2025

Oh but that shouldn't be a blocker, it should just parse it as string

@joostlek
Copy link
Member

joostlek commented Mar 2, 2025

@miketarg please create a separate issue

@Ishima
Copy link
Contributor

Ishima commented Mar 2, 2025

I have just few devices, but for other users this month release will be interesting :)

@Ishima

This comment has been minimized.

@Ishima

This comment has been minimized.

@balloob
Copy link
Member

balloob commented Mar 2, 2025

This issue is fixed and the fix is included in 2025.3. Users will be able to control their SmartThings devices again without having to re-authenticate.

We always recommend to buy devices that work locally. If people buy cloud devices, we will work with the cloud manufacturers to make sure that those devices work for you.

@balloob balloob closed this as completed Mar 2, 2025
@Ishima
Copy link
Contributor

Ishima commented Mar 2, 2025

@balloob it's not working like that and entire conversation from the closed PR is about that. You need to have default_config or cloud enabled for it to re-authenticate. If you don't have it, you will not be able to.

@balloob
Copy link
Member

balloob commented Mar 2, 2025

We only support Home Assistant when the default_config is used. If you disable default_config, it's up to you as user to have the right integrations enabled.

I will lock this issue now, as each comment pings a lot of people and the issue has been resolved. If people experience any issue with the new integration, and use a supported Home Assistant installation with default_config enabled, please open a new issue.

@home-assistant home-assistant locked as resolved and limited conversation to collaborators Mar 2, 2025
@joostlek
Copy link
Member

joostlek commented Mar 3, 2025

Anyway,

I want to massively thank you all for helping me in this journey! I had a blast working with you all, and I am proud of the end result. A ton of people have tried out the beta so far and for the size of the change, not a lot of issues came up, all thanks to the provided test data and help. I enjoyed having a project again to throw a ton of time in and to hyperfocus into.

If you like the work I (and many others) do, consider subscribing to Home Assistant Cloud, as it enabled me to work full time on Home Assistant and to make our beloved piece of software better every day.

Also note that I started a place for SmartThings users to collaborate and gain common knowledge on how the API of their devices work. So if you want to see more features or want to help out on this (you don't need to be a developer to help out) be sure to checkout the Discord server https://discord.gg/EJYdwMCz7K.

🫡

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

No branches or pull requests