Issue - Unable to integrate SmartThings into Home Assistant "The token does not have the required OAuth scopes"

I receive this error every time I attempt to integrate SmartThings.
The only documentation I’ve found states to just retry the process if it occurs, but that
doesn’t seem to be working for me?

I’ve tried selecting ALL available options and just the required ones.

The Home Assistant forums were unable to answer the question… I hope this is the right board?

Thank you for your time!

  • Will

When you create your token from the developer portal, check the permissions (scope) provided to the token.

If you’re referring to the check boxes, I have checked them all… :frowning:

How’re you trying to integrate it?

I believe he’s refering to this. https://www.home-assistant.io/integrations/smartthings/

I use this integration but it was a pain to get going. Unfortunately, a lot can go wrong. Are you using Nabu Casa or a direct SSL encrypted connection (like duckdns) to your machine in Home Assistant?

I’ve tried both Nabu Casa or a direct SSL. Both have the same result. I actually wiped the server
and started from scratch last night, but the SmartThings integration is still generating this same error.

Ok that should rule out issues there. When you add a token a web browser windiw should pop-up where you have to click ok to authorize the connection. Sounds like that is where this is going wrong. There was an issue recently with the home assistant smartthings integration where the link made in that page was incorrect. Try this solution mentioned on Github that worked for me.

I’m not making it this far into the integration process.
I can’t bypass the screen I posted in the screen shot.

I do see the webhook url screen beforehand…
Is that link supposed to be clickable? When I use
Navy or my own SSL I receive a 405 not allowed reply.

I appreciate the help and suggestions…

Yeah that link would accept webhooks which are a different type of web request then a browser so a 405 error for method not allowed is a normal response. So that link is not clickable basically.

So it sounds like your system can’t even validate the token at all. Maybe it’s a firewall issue with your router. Can you try bypassing it or setting up a temporary DMZ for the device running home assistant? What kind of system are you running home assistant on? Is it a Docker version on a linux machine or something else? Or supervised on an RPI? If docker you need to use --net option to make sure all ports are open, but that is restricted if trying to run on a mac or windows machine. If firewall/router isn’t the issue more clues about your setup might help troubleshoot.

I am running HA supervised (via Docker) on a dedicated Debian system (little Intel NUC).
This same hardware setup has had a working SmartThings integration on it previously
(I ended up having to wipe the drive and start fresh).

As far as installation and setup, I have followed all steps listed within this tutorial:

I’m pretty sure all required ports (unless SmartThings is using something itself?) are forwarded…

I’ve tried to integrate SmartThings from my mobile device (on an outsider network), but honestly
have not tried the --net option you’re speaking of. Maybe that’s something I can give a go to when
I get home today…

Its almost like the SmartThings site just isn’t SEEING me enabling the checkboxes for the token.
I’ve even tried it on multiple browsers. =p

Ok that method is different from mine. You have a supervised version and mine is “unsupervised” in a docker container (I believe they call mine Home Assistant “Core” or Home Assistant “Container”). Although both use Docker, you’re not creating the container the same way following those Debian instructions and the --net option probably doesn’t apply to that setup.

I have ubuntu so went a different route. My setup follows these instructions https://www.home-assistant.io/docs/installation/docker/ but I lose the Home Assistant supervisor and addons. That Debian method seems more complex to me where more could potentially go wrong, as it’s “sorta” supported by home assistant as opposed to the Docker or RPI install. With the docker install method, since I don’t have supervisor, I can run other docker containers on the same machine and use it for other stuff, which is a plus. The biggest pain in the butt without supervisor though was setting up the SSl server which I did by following these instructions - https://community.home-assistant.io/t/nginx-reverse-proxy-set-up-guide-docker/54802 . I would hate to recommend you start over from scratch with a different Home Assistant installation though, but that’s the key difference between my setup and yours. I looked through that Debian thread and someone there mentioned they have Smartthings, so I would think it would work with your setup.

I don’t think it’s an issue with Smartthings or your token, and tend to think its more of an issue with your Homeassistant setup, firewall, or your machine. You’re getting your token from this page and copying all of it right? - https://account.smartthings.com/tokens

To test if it is a problem with your machine getting webhooks in general, you can try another Home Assitant integration that needs webhooks, like IFTTT, and see if you run into the same issues. If so, that would definitely tell you the problem is not just the Smartthings integration.

If you’re still having issues, sometimes the setup gets corrupted and you have to run a special removal tool to get rid of it discussed here - Can't Remove Home Assistant smartapp

I know you said you completely redid the server, but if you restored a home assistant backup, the corruption will just come over from the backup. Basically the way this integration works is that it creates a smartapp within home assistant that communicates with the Smartthings API. API’s are just interfaces and don’t really run anything, and just respond to whatever the commands coming into it are from where the app is actually running.

Removal tool:

1 Like

I just went through the process of running the removal tool, but still receiving
“The token does not have the required OAuth scopes.” in Home Assistant.

Was worth a try!


I wonder if there is a way I can ‘simulate’ SmartThings is installed/integrated… by like just
copying the appropriate files where they need to go and manually changing the token within the install? I know a piece of the integration lives under .storage path…

It could work but definitely beyond what I could figure out.

I would try a completely clean home assistant install on another machine using docker. Do you have an old laptop lying around you can throw linux on?

If all else fails, you can open an issue on Github https://github.com/home-assistant/core/issues

Welp… it’s been sometime later, but I can officially say it also generates this error on a completely different Home Assistant appliance (this time one of the ODroid’s Home Assistant released)…

I’ve spoken with SmartThings Developer support, but they pretty much have ruled it to be a Home Assistant issue and are not able to help.

This is an old thread, but have any other ideas sir? lol

I’ve now tried on a COMPLETELY different setup and new install and am receiving the same error.
I am officially out of ideas.

If its a totally different setup my guess is still a local firewall/ISP/router issue blocking it. Did you try temporarily putting the machine in a DMZ or bypassing the router and hooking ethernet right to the machine to rule out a local block?

Also what I posted above is not entirely right. While almost all this integration runs in Home Assistant, I found out there is some small instance of code installed in Smartthings when this is setup to direct where to send the webhooks. There could be some leftover instance of that small app sending things to the wrong place. However, the cleanup utility I posted above if run properly is supposed to fix that.

A lot has changed in Home Assistant in the last few months with zwavejs2mqtt being a game changer. I find myself moving more off of smartthings everyday as time goes by and things improve with Home-assistant. Mind sharing what you’re running on the Smartthings side still that isn’t directly hooked up to Home-assistant?

Yea, I’ve tried placing it in a DMZ, but the new hardware was actually tested at
my girlfriend’s house. She has nothing that would obstruct its communication
on her network (no Pi-Hole, no firewalls, etc)
:frowning:
I actually just tried it from my mobile phone (with the wifi turned off) and it
generated the same error. :expressionless:

heh, I really do appreciate your input! You’ve been the only response I’ve really gotten…

Ok so it can’t be a local issue then.

Was it the same dns provider at both locations? Maybe there’s something wrong with that. Do you want to try duckdns maybe? That’s what I’m using. https://www.duckdns.org/

I looked back at the post though and you said even Nabu Casa didn’t work, so it sounds like you’ve tried almost everything.

One last thought, you can go into the command line interface and run commands manually to look for and delete any residual smartapps hiding in your account. A list of commands and how to use it is below:

Yup, I use DuckDNS too. =/
I think I’ve taken steps to do what you recommended earlier… just get off the entire platform.
I’ve ordered replacement bulbs and will work on the other entities I have that need some work…
(SmartDry)

Hoping I can use some of the actual SmartThing devices within HA too.