andrewsayre / hass-smartthings-remove Goto Github PK
View Code? Open in Web Editor NEWDEPRECATED: Utility to remove/clean-up orphaned SmartApps created by the Home Assistant integration
License: MIT License
DEPRECATED: Utility to remove/clean-up orphaned SmartApps created by the Home Assistant integration
License: MIT License
Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.7/bin/hass_smartthings_remove", line 11, in <module> sys.exit(main()) File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/hass_smartthings_remove/remove.py", line 16, in main loop.run_until_complete(remove_apps(args.token)) File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/asyncio/base_events.py", line 584, in run_until_complete return future.result() File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/hass_smartthings_remove/remove.py", line 25, in remove_apps apps = await api.apps() File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pysmartthings/smartthings.py", line 89, in apps resp = await self._service.get_apps(params) File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pysmartthings/api.py", line 156, in get_apps return await self.get_items(API_APPS, params=params) File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pysmartthings/api.py", line 375, in get_items 'get', self._api_base + resource, params, None) File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pysmartthings/api.py", line 350, in request headers={"Authorization": "Bearer " + self._token}) as resp: File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/aiohttp/client.py", line 1005, in __aenter__ self._resp = await self._coro File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/aiohttp/client.py", line 476, in _request timeout=real_timeout File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/aiohttp/connector.py", line 522, in connect proto = await self._create_connection(req, traces, timeout) File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/aiohttp/connector.py", line 854, in _create_connection req, traces, timeout) File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/aiohttp/connector.py", line 992, in _create_direct_connection raise last_exc File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/aiohttp/connector.py", line 974, in _create_direct_connection req=req, client_error=client_error) File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/aiohttp/connector.py", line 927, in _wrap_create_connection req.connection_key, exc) from exc aiohttp.client_exceptions.ClientConnectorCertificateError: Cannot connect to host api.smartthings.com:443 ssl:True [SSLCertVerificationError: (1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1056)')]
I get that error with a newly generated API token.
I have the ST problem but in Hassio. How can I install the script in Hassio
Hey,
im not sure where to even start?
where do i run this PIP command from sorry?
im running Hassio on a RPI4 and need to clean up 3 HA "apps" which all show up in ST
I'm relatively new to this ... I'm trying to remove a broken Smartthings integration from HASS. Python 22.1.2 is installed. When I execute the removal tool, the program runs but always aborts with an error. Below is the what happens - see Lines 20 onward, the error occurring on line 23 (I numbered the lines to make this easier to discuss). Line 34 says to modify PIP to run the shown command, which I did. But that didn't help. Can you help me get past this?
---------------------------------------- 133.4/133.4 kB 7.7 MB/s eta 0:00:00
---------------------------------------- 60.6/60.6 kB ? eta 0:00:00
Collecting pip>=18
Using cached pip-22.1.2-py3-none-any.whl (2.1 MB)
Collecting setuptools>=40
Using cached setuptools-63.2.0-py3-none-any.whl (1.2 MB)
Collecting wheel
Using cached wheel-0.37.1-py2.py3-none-any.whl (35 kB)
ERROR: To modify pip, please run the following command:
C:\Users\Larry\AppData\Local\Programs\Python\Python310\python.exe -m pip install --ignore-installed --no-user --prefix C:\Users\Larry\AppData\Local\Temp\pip-build-env-prkyyvxx\overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- pip>=18 setuptools>=40 wheel
[end of output]
Hi. First I will say I am thankful for the work you have put into this. Im just realizing how dependent I am on this integration.
I too had the SmartThings app stuck and unable to remove. I followed your steps (both on Ubuntu & Win10 - Each with different issues).
Ultimately, I ended up using thew API to remove the instances. When I went back to install, everything seemed to work fine but the entities never showed. When I looked at the logs this is the error I received:
Unable to setup config entry 'Home' - please reconfigure the integration
aiohttp.client_exceptions.ClientResponseError: 403, message='Forbidden', url='https://api.smartthings.com/v1/installedapps/04f653bc-0d6d-4dac-81ee-849f342b90fa
Full log:
Unable to setup config entry 'Home' - please reconfigure the integration Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/smartthings/__init__.py", line 100, in async_setup_entry api, entry.data[CONF_INSTALLED_APP_ID] File "/usr/src/homeassistant/homeassistant/components/smartthings/smartapp.py", line 77, in validate_installed_app installed_app = await api.installed_app(installed_app_id) File "/usr/local/lib/python3.7/site-packages/pysmartthings/smartthings.py", line 151, in installed_app entity = await self._service.get_installed_app(installed_app_id) File "/usr/local/lib/python3.7/site-packages/pysmartthings/api.py", line 246, in get_installed_app API_INSTALLEDAPP.format(installed_app_id=installed_app_id)) File "/usr/local/lib/python3.7/site-packages/pysmartthings/api.py", line 370, in get return await self.request('get', self._api_base + resource, params) File "/usr/local/lib/python3.7/site-packages/pysmartthings/api.py", line 366, in request resp.raise_for_status() File "/usr/local/lib/python3.7/site-packages/aiohttp/client_reqrep.py", line 946, in raise_for_status headers=self.headers) aiohttp.client_exceptions.ClientResponseError: 403, message='Forbidden', url='https://api.smartthings.com/v1/installedapps/04f653bc-0d6d-4dac-81ee-849f342b90fa
I hope I am posting in the correct place.
Any help is greatly appreciated. Thanks Again!
Hello tiny little issue here.
Due to the problems I had getting Smartthings to rework with Hassio 0.89 I thought I would try a new Smartthings API token. However I didn't save the old one. Now I cannot remove the SmartApp from the Smartthings Classic App and I still cannot get the intergration to work between SmartThings and Hassio.
Any suggestion please?
Thank you.
Background History
I were using mosquitto and SmartThings Bridge plugin so far without any issue. Then, I have updated my Hass.io and wanted to test this plugin. I have configured it with no much troubles. It wasn't easy to understand the new nomenclature and how to show the sensors, but finally it worked.
After a few days, 2 of my sensors stopped reporting data to Hass.IO but they continue reporting correctly to the SmartThings Classic app. When that issue started I have tried everything to fix it and nothing worked. Then I have decided to remove the integration, then I removed the token I have used to connect HA to my Smart App on SmartThings Classic.
I created a new token, I started the integration process again form HA, but when I submitted the token it says: "Please install the Home Assistant SmartApp in at least one location and click submit" - Of course I have the SmartApp installed but I cannot uninstall it from the SmartThings Classic App anymore because it popups with an error when trying to get access to it.
Finally, I have tried to create a new token and when I do that, I can enter into the Home Assistant SmartApp but, it is trying to Authorize the SmartThings App instead the SmartThings Classic app (I don't know if this is or not related to) By then, when you try to submit with the new token, HA says: "Please ensure you have installed and authorized the Home Assistant SmartApp and try again." - It means that the Classic app is not being authorized.
Hi
I am attempting to run this but I keep getting tracebacks. I am running HA in the Python Virtual Environment.
Here is the error:
Traceback (most recent call last):
File "./hass_smartthings_remove", line 10, in
sys.exit(main())
File "/home/pi/.local/lib/python3.7/site-packages/hass_smartthings_remove/remove.py", line 16, in main
loop.run_until_complete(remove_apps(args.token))
File "/usr/lib/python3.7/asyncio/base_events.py", line 584, in run_until_complete
return future.result()
File "/home/pi/.local/lib/python3.7/site-packages/hass_smartthings_remove/remove.py", line 25, in remove_apps
apps = await api.apps()
File "/home/pi/.local/lib/python3.7/site-packages/pysmartthings/smartthings.py", line 89, in apps
resp = await self._service.get_apps(params)
File "/home/pi/.local/lib/python3.7/site-packages/pysmartthings/api.py", line 156, in get_apps
return await self.get_items(API_APPS, params=params)
File "/home/pi/.local/lib/python3.7/site-packages/pysmartthings/api.py", line 375, in get_items
'get', self._api_base + resource, params, None)
File "/home/pi/.local/lib/python3.7/site-packages/pysmartthings/api.py", line 366, in request
resp.raise_for_status()
File "/home/pi/.local/lib/python3.7/site-packages/aiohttp/client_reqrep.py", line 942, in raise_for_status
headers=self.headers)
aiohttp.client_exceptions.ClientResponseError: 401, message='Unauthorized'
This is what I get when I try to install this. Ubuntu 18 server.
Collecting hass-smartthings-remove
Downloading https://files.pythonhosted.org/packages/e3/8f/ec2681793b4c288a1937e5db45891b699cd2f119f02866c3ae43d78f1299/hass_smartthings_remove-1.0.1.tar.gz
Collecting aiohttp==3.5.4 (from hass-smartthings-remove)
Could not find a version that satisfies the requirement aiohttp==3.5.4 (from hass-smartthings-remove) (from versions: 0.1, 0.2, 0.3, 0.4, 0.4.1, 0.4.2, 0.4.3, 0.4.4, 0.5.0, 0.6.0, 0.6.1, 0.6.2, 0.6.3, 0.6.4, 0.6.5, 0.7.0, 0.7.1, 0.7.2, 0.7.3, 0.8.0, 0.8.1, 0.8.2, 0.8.3, 0.8.4, 0.9.0, 0.9.1, 0.9.2, 0.9.3, 0.10.0, 0.10.1, 0.10.2, 0.11.0, 0.12.0, 0.13.0, 0.13.1, 0.14.0, 0.14.1, 0.14.2, 0.14.3, 0.14.4, 0.15.0, 0.15.1, 0.15.2, 0.15.3, 0.16.0, 0.16.1, 0.16.2, 0.16.3, 0.16.4, 0.16.5, 0.16.6, 0.17.0, 0.17.1, 0.17.2, 0.17.3, 0.17.4, 0.18.0, 0.18.1, 0.18.2, 0.18.3, 0.18.4, 0.19.0, 0.20.0, 0.20.1, 0.20.2, 0.21.0, 0.21.1, 0.21.2, 0.21.4, 0.21.5, 0.21.6, 0.22.0a0, 0.22.0b0, 0.22.0b1, 0.22.0b2, 0.22.0b3, 0.22.0b4, 0.22.0b5, 0.22.0b6, 0.22.0, 0.22.1, 0.22.2, 0.22.3, 0.22.4, 0.22.5, 1.0.0, 1.0.1, 1.0.2, 1.0.3, 1.0.5, 1.1.0, 1.1.1, 1.1.2, 1.1.3, 1.1.4, 1.1.5, 1.1.6, 1.2.0, 1.3.0, 1.3.1, 1.3.2, 1.3.3, 1.3.4, 1.3.5, 2.0.0rc1, 2.0.0, 2.0.1, 2.0.2, 2.0.3, 2.0.4, 2.0.5, 2.0.6.post1, 2.0.7, 2.1.0, 2.2.0, 2.2.1, 2.2.2, 2.2.3, 2.2.4, 2.2.5, 2.3.0a4, 2.3.0, 2.3.1, 2.3.2b2)
No matching distribution found for aiohttp==3.5.4 (from hass-smartthings-remove)
If I remove a device from Smartthings this fails to sync with HA and I end up with an orphaned entry in my HA config, will this app remove those entries?
Can this utility be installed and used in a non-Supervised HA instance?
I'm running HA in a Docker container - so no Supervised, no HAOS (HASS).
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.