8000 Get SmartThings token from config/.storage/core.config_entries · Issue #128 · atxbyea/samsungrac · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Get SmartThings token from config/.storage/core.config_entries #128

New issue
8850

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

Open
acm3006 opened this issue Mar 7, 2025 · 0 comments
Open

Get SmartThings token from config/.storage/core.config_entries #128

acm3006 opened this issue Mar 7, 2025 · 0 comments

Comments

@acm3006
Copy link
acm3006 commented Mar 7, 2025

My setup: I have both integrations for SmartThings:

I like more the Climate IP integration as it works with my Samsung EHS heating pump, instead of Official SmartThings integration that lacks many features.

[Breaking News] Official SmartThings integration started working with OAuth tokens (refreshed automatically) from HA core version 2025.3.0!
This means the access_token is available somewhere in HA and (maybe?) can be used by Climate IP also, instead of setting it in configuration.yaml file.

I found that it is stored in config/.storage/core.config_entries, under same entry with the same ID and it is changed/refreshed regularly.
It looks like this:
{ "created_at": "2025-03-05T18:53:59.335589+00:00", "data": { "auth_implementation": "cloud", "location_id": "abcdefgh-20aa-4065-b572-6acae74b68ba", "old_data": { "access_token": "abcdefgh-71fd-413a-a502-086648767ca3", "app_id": "abcdefgh-4645-4993-a502-46b45baecac4", "client_id": "abcdefgh-bfd3-432a-ad50-7c788cd3a654", "client_secret": "abcdefgh-ea4d-4773-8ec2-83e684d9586e", "installed_app_id": "abcdefgh-aebf-4da4-9f22-b3428c3802ac", "location_id": "abcdefgh-20aa-4065-b572-6acae74b68ba", "refresh_token": "abcdefgh-2d58-4139-b9cf-6cc79401627a" }, "token": { "access_tier": 0, "access_token": "abcdefgh-49ea-4da0-b993-50a3bc4f069c", "expires_at": 1741417499.9367576, "expires_in": 86399, "installed_app_id": "abcdefgh-6840-4fd8-8107-a6a0ddab6c8b", "refresh_token": "abcdefgh-7ab7-4328-88e8-ddeb36a83ff1", "scope": "r:hubs:* r:locations:* r:rules:* r:scenes:* x:devices:* sse w:rules:* w:locations:* w:devices:* r:devices:* x:locations:* x:scenes:*", "service": "smartthings", "token_type": "bearer" } }, "disabled_by": null, "discovery_keys": {}, "domain": "smartthings", "entry_id": "01JNKTGMN74E2EH6JA5G8E184E", "minor_version": 1, "modified_at": "2025-03-07T07:05:01.170242+00:00", "options": {}, "pref_disable_new_entities": false, "pref_disable_polling": false, "source": "user", "subentries": [], "title": "My home", "unique_id": "abcdefgh-20aa-4065-b572-6acae74b68ba", "version": 3 }

As we all know, Climate IP integration has now the token issue - it works only with PAT tokens from SmartThings account and it has to be issued and manually changed daily.
Is there a way to change the code to grab programmatically the working access_token that is available from official SmartThings integration in core.config_entries file?

I've experimented with manually getting the token from there and setting it in the configuration.yaml file.
And Climate IP works with it, instead of going to SmartThings website and generating a new PAT token each day...

What we need to get in the code is this information (mind the values below, they are just examples from my setup):
"token": {
"access_token": "abcdefgh-49ea-4da0-b993-50a3bc4f069c",
Calling it by the "entry_id": "01JNKTGMN74E2EH6JA5G8E184E"
https://developers.home-assistant.io/docs/config_entries_index/

I am not a skilled developer for this kind of job, just a newbie
Is somebody here that can fork the code with this idea?
Requires installing SmartThings official integration

Thanks a lot!

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

No branches or pull requests

1 participant
0