home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
71.5k stars 29.91k forks source link

After update with HA 0.89, Smartthings integration stopped working #21743

Closed oleg-78 closed 5 years ago

oleg-78 commented 5 years ago

Home Assistant release with the issue:

Home Assistant 0.89.0

Last working Home Assistant release (if known):

0.88.2 Operating environment (Hass.io/Docker/Windows/etc.): Home Assistant, environment Python 3.5.3

Component/platform:

Description of problem: In version 0.88, I have configured the smartthings integration. But after the update, integration has not stopped working. I tried to create smartapps again. I created a new token. I configured again Home Assistant, i entered the personal access token. I tried to add Smartapp in "My Apps", then choose ‘Home Assistant’. But again I get an error. I added screenshots. Smartthings app doesn't work. An old app is writing: Something's Wrong. We can't load your screen right now. After I removed the smartapp from api.smartthings.com. I rebooted the phone, deleted the application data and cache in the phone. Rebooted hub. But nothing helped. Home assistant does not create a Smart app in the API or in the classic Smartthings application. In the previous version, everything worked. All conditions are met- base_url, SSL and so on. I edded logger in congiguration file, but i don't know where to watch the logs. I did not find anything in the home-assistant.log.

Problem-relevant configuration.yaml entries and (fill out even if it seems unimportant):

Traceback (if applicable):

Additional information: screenshot_20190307_194207_com smartthings andro

screenshot_20190307_180220_com smartthings android screenshot_20190307_180439_com smartthings android

dshokouhi commented 5 years ago

There was a breaking change introduced in 0.89 for SmartThings did you make sure to follow the steps outlined in the blog? https://www.home-assistant.io/blog/2019/03/06/release-89/#noteworthy-breaking-changes

oleg-78 commented 5 years ago

I'm sure I did everything right.

  1. I have generate a new token.
  2. i have set up a new integration and сlicked the button ‘Configure’.
  3. I have entered the token and click ‘Submit’
  4. After, i have opened the SmartThings Classic mobile app. But the Home Assistant application did not appear in it. Old ones remained, but new application did not appear. I have a feeling that the Smartthings component is not workin

I can not also delete the old smartapps. I deleted it in SmartThings API, but in the mobile classic application they remained. And the new Smarapp does not appear. I looked at the Smartthings log. There are no events related to the Home Assistant.

viswa-swami commented 5 years ago

I am seeing the same behavior as well with the 0.89 hassio instance. Smarthings integration was working with previous version.

I tried everything from regenerating the token.. but still getting the "something is wrong" sort of message when using the home assistant smartapp

viswa-swami commented 5 years ago

It started working now all of a sudden... not sure if it just needs time.. !!! i restarted hass and then tried the same sequence as before, and now it connected successfully.

andrewsayre commented 5 years ago

Depending on where you are on the ST cloud a few people noticed theres a lag in when the old app is removed and to when the recreated one shows up. There have also been ST availability issues today which probably hasn’t helped.

One note to others, there’s no beed to create a new token, you can use the previous one.

If it continues to not work, it’s possible the webhook wasn’t entirely working before (like certain messages getting blocked, which weren’t required before but are now). Let me know and I’m happy to help you troubleshoot.

pajinki commented 5 years ago

I am also having trouble with this. It was working in 88.2, I tried generating a new token, I've restarted HASS at least 100 times. I also tried reverting back, that did not work. I tried using the troubleshooting steps in Smartthings component page but I have no idea how to access the NGINX configuration file. I'm using Hass.io if that make a difference.

oleg-78 commented 5 years ago

Unfortunately, I deleted the old token and cannot use it.

I also deleted the Home Assistant Smart from Smartthings api, but in the mobile application It is preserved, not retired.. Can I create SmartApp manually in Smartthings myself? Where can I get the code?

andrewsayre commented 5 years ago

For folks still having issues try this:

  1. Use this utility to complete remove all HASS automations/apps. It will output the IDs of the items removed. If it outputs nothing, there was nothing to remove.
  2. Ensure you do not see any HASS apps or automations in the ST Classic App. If you still see items in your account after running the utility, you are affected by cached data/synchronization lag. Wait until the items no longer show up.
  3. Start the integration setup in Home Assistant. If you don't see the SmartApp to install, then you're affected by synchronization lag again. Wait until it shows up. It's OK to exit out of the integration setup meanwhile, just go back into it BEFORE trying to add the SmartApp to your account.

The Home Assistant integration setup logic didn't change in this release (it just captures more data than before). As I mentioned earlier, there's been AWS issues today that affected SmartThings which is likely contributing to the synchronization lag.

Hunterdiver commented 5 years ago

Slightly off topic but new and struggling to find stuff. When do you expect to get the Axis function working on the Smartthings open/close sensors ?

andrewsayre commented 5 years ago

@hunterdiver please open a seperate issue and specify the device brand and model you have and what you’re looking to be able to do. If you’re using a custom Device Type Handler to control it in SmartThibgs, please include the link to the source.

oleg-78 commented 5 years ago

I executed the command -

pi@raspberrypi:~ $ sudo hass_smartthings_remove PERSONAL_ACCESS_TOKEN
Traceback (most recent call last):
  File "/usr/local/bin/hass_smartthings_remove", line 10, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.5/dist-packages/hass_smartthings_remove/remove.py", line 16, in main
    loop.run_until_complete(remove_apps(args.token))
  File "/usr/lib/python3.5/asyncio/base_events.py", line 466, in run_until_complete
    return future.result()
  File "/usr/lib/python3.5/asyncio/futures.py", line 293, in result
    raise self._exception
  File "/usr/lib/python3.5/asyncio/tasks.py", line 239, in _step
    result = coro.send(None)
  File "/usr/local/lib/python3.5/dist-packages/hass_smartthings_remove/remove.py", line 25, in remove_apps
    apps = await api.apps()
  File "/usr/local/lib/python3.5/dist-packages/pysmartthings/smartthings.py", line 89, in apps
    resp = await self._service.get_apps(params)
  File "/usr/local/lib/python3.5/dist-packages/pysmartthings/api.py", line 156, in get_apps
    return await self.get_items(API_APPS, params=params)
  File "/usr/local/lib/python3.5/dist-packages/pysmartthings/api.py", line 375, in get_items
    'get', self._api_base + resource, params, None)
  File "/usr/local/lib/python3.5/dist-packages/pysmartthings/api.py", line 366, in request
    resp.raise_for_status()
  File "/usr/local/lib/python3.5/dist-packages/aiohttp/client_reqrep.py", line 942, in raise_for_status
    headers=self.headers)
aiohttp.client_exceptions.ClientResponseError: 401, message='Unauthorized'

What does this mean?

Hunterdiver commented 5 years ago

@andrewsayre OK will do but it is the Samsung open/close device

oleg-78 commented 5 years ago

Should I re-run the Configure Smartthings? In Smartthings, nothing has changed. All Home Assistant Smartapps in place. I closed and opened the Smartthings app.

andrewsayre commented 5 years ago

@oleg-78 You have to replace PERSONAL_ACCESS_TOKEN with your access token...

oleg-78 commented 5 years ago

Everything worked out. Old SmartApp have been removed from Smartthings. And without any problems everything was integrated. Thank you so much for your help and patience. You saved me a lot of time.