Smartthings Integration using (not Classic Smartthings App) and Hass.io 0.100.2

At Step 3.1 of Configure Home Assistant:

  1. The SmartThings Classic App is no longer available.
  2. The current SmartThings App does not present a “My Apps” option
  3. How does Home Assistant get onto the list of My Apps (I used the SmartThings web app to search for it)?

The linked Video is not current with either Home Assistant or SmartThings screen images.

thnx.

I’m stuck at this same place. Did you get it working?

Nevermind, I got it running. You can still download the “Classic” SmartThings phone app. From there, log on with your same account used on the new style app and you’ll have access to all your automation devices. Then follow the steps to add the “SmartApp” which is really just another way of saying add your Oauth API identity you created in the first steps of the integration. Once done with all that, you don’t have to use the “Classic” app again.

Background: Adam Hughes got us off to a good start back in November with a simple fix as follows:

1. Get a Smartthings API Token @ https://account.smartthings.com/tokens

2. Prepare a processor to work from:
	a. I use the Home Assistant IDE and its command line
	b. Verify that python is installed and note the version in case the following does not work for you. My Raspberry had python installed.
	c. Test the setup using curl from Step 1 below and deal with network and python issues if any are found.
	
3. Get a list of all SmartApps using curl on any processor that has python installed:
        curl --header "Authorization: Bearer <your API Token>" https://api.smartthings.com/v1/apps | python -m json.tool
   You will get something like this with one or more apps listed
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   373  100   373    0     0    770      0 --:--:-- --:--:-- --:--:--   769
{
    "_links": {},
    "items": [
        {
            "appId": "28cc68a7-65ec-4106-a22c-8e9a4136fgb6",
            "appName": "homeassistant.e0a91471-a833-4532-80a4-f26c3bac3d15e",
            "appType": "WEBHOOK_SMART_APP",
            "classifications": [
                "AUTOMATION"
            ],
            "createdDate": "2019-12-17T01:57:31Z",
            "description": "Home at https://uvga17.duckdns.org",
            "displayName": "Home Assistant",
            "iconImage": {},
            "lastUpdatedDate": "2019-12-17T01:57:32Z"
        }
    ]
}
4. Now delete (one of) the homeassistant AUTOMATION using curl
   curl -X DELETE --header "Authorization: Bearer <your API Token>" https://api.smartthings.com/v1/apps/<your appid from the previous curl>

5. Repeat 3 and 4 until no homeassistant AUTOMATIONs are reported at Step 3.

6. Wait a few minutes then check the Smartthings app to see if all homeassistant AUTOMATIONs are gone. I experienced several minutes delay during one rebuild.

Complications discovered along the way.

  1. My first attempt failed because the curl at Step one had “/apps” before the pipe to python and then I replaced it with “/installedapps” and it worked.
  2. I only deleted one of two homeassistant AUTOMATIONs because I did not go back and check.
  3. I tried using pip to install the utility by my version of python is incompatible with the utility.
  4. Neglecting to delete Scenes and Automations from Smartthings caused no end of confusion when Hass.io and Hass.io Node-Red automations did not behave as exspected.
  5. Some Devices connected to Hass.io directly were also connected via the Smartthings Integration. I chose to let Smartthings provide the connection and all worked well.
  6. Some devices, specifically my First Alert Smoke/CO Detectors needed to be deleted and reinstalled on Smartthings to get proper and timely status reporting through Hass.io.
  7. One old Wemo SmartPlug and my Wemo Maker Switch were no longer recognized by either Hass.io or Smartthings.

Recent discoveries:

  1. The current (as of December 10, 2019) Home Assistant App from the App Store works a bit differently but as well as the Classic App.
  2. Overall, the integration cooperates well with others on Hass.io and perform properly. No issues with over 1,000 of continuous hours operation and counting.

You have to specify the installedAppId instead of appId using installedapps api. Hope this helps!

Smartthings now migrates you over to the new app. NOW WHAT??? The new app does not list the HA smart app.

Possible ways forward: If you are using andriod, the Smartthings Classic app is still available and it works on my Samsung Phone. Also, If I wait up to twelve hours, Home Assistant shows up in both the classic and replacement versions of the Smartthings app iff all previous references to Home Assistant have been removed using one of the methods described in previous posts. I tested authorization using both versions for android and both worked equally well. One more point: Reboot your Home Assistant server after adding Home Assistant as a “My Apps” in Smartthings.

Hope this works for you.

Just ran into this issue with SmartThings and trying to resolve the issue. I tried your first curl command in the Terminal & SSH add on in Home Assistant. I keep getting a failed writing body error. Not sure what to do. Any advice?

I am no expert but… perhaps if you send me what you a sending to SmartThings (the entire curl…) I might see somethings helpful

Others, please chime in here.

Jim D.

@jfd Thanks for replying. I not sure how, but I managed to fix it…lol. I started by trying to delete the Home Assistant app from SmartThings, but kept getting an error. I eventually saw it could be done from the new app but not the classic one for some reason. After that, I tried to add the SmartThings integration in Home Assistant again. However, every time I tried to add it, it would disappear. It would not give me any setup options. I tried restoring to an older snapshot prior to me integrating SmartThings. That worked. However, before setting it up, I signed back into Nabu Casa, which broke everything again. As soon as I signed in, it added the app back to SmartThings, which would give me the error again when I tried to delete. So, I repeated the whole processes. At that point I notice the Home Assistant app in SmartThings, had my old duckdns address under it, not Nabu Casa. I added my duckdns address back into my config.yaml and setup smarthings without Nabu Casa enabled. Everything is working now.

Although I would prefer to use Nabu Casa, what is the CORRECT way to remote the integration without causing the issue again. Do I just delete the integration in Home Assistant and it will remove the app from Home Assistant? Then I can sign in to Nabu Casa and set it up again?

@jfd Been playing around with this more, I can install and remove the integration no problem now. I just have to remove it form Home Assistant first, and it automatically removes the smartapp in SmartThings. However, I still have one smartapp under myapp linked to my old duckdns.org address that I can not remove. I assume it is because I deleted the something in the wrong order and that is how I ended up in this situation. This is what I am running in CMD on windows…

curl --header "Authorization: Bearer xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxx" https://api.smartthings.com/v1/installedapps | python -m json.tool
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   176  100   176    0     0    176      0  0:00:01 --:--:--  0:00:01  1408
Expecting value: line 1 column 1 (char 0)

I am not getting a list of anything though.

Oops, was using the token from the remaining app. I deleted that token, created a new one and ran the curl command again…

C:\WINDOWS\system32>curl --header "Authorization: Bearer xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx" https://api.smartthings.com/v1/installedapps | python -m json.tool
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   172  100   172    0     0    172      0  0:00:01 --:--:--  0:00:01   366
{
    "items": [],
    "_links": {
        "next": {
            "href": "https://api.smartthings.com/installedapps?currentShard=YXAwMg&currentOffset=MA&currentPrincipalType=VVNFUl9MRVZFTA"
        },
        "previous": null
    }
}

Welcome to several new worlds. That of minimal integration handshaking between “partners”; plausible deniability between partners; and finally Home Assistant and Smarthings working together at last.

Glad to hear that you got through the gauntlet. Unfortunately we, and others find that the process is NOT 100% repeatable.

Best luck.

I am trying to get this working again. The curl method worked for me to uninstall previous apps… when I click install on home assistant, I enter my new key, choose “My home” and then submit… I get

{“requestId”:“c38a256e-1f70-ea9f-b131-545854860cb5”,“error”:{“code”:“UnexpectedError”,“message”:“A non-recoverable error condition occurred.”,“details”:}}

Any help would be great appreciated.