Skip to content
New issue

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

Version 1.1.16 does not work in Home Assistant 2025.1.0 #115

Open
z-oo-m opened this issue Jan 3, 2025 · 11 comments
Open

Version 1.1.16 does not work in Home Assistant 2025.1.0 #115

z-oo-m opened this issue Jan 3, 2025 · 11 comments

Comments

@z-oo-m
Copy link

z-oo-m commented Jan 3, 2025

SmartThings Custom integration, the latest version 1.1.16, was working fine until the latest HA 2024 version (2024.12.5). After upgrading Home Assistant to 2025.1.0, the integration fails to start with the following error message:

Setup failed for custom integration 'smartthings': Unable to import component: cannot import name 'ELECTRIC_POTENTIAL_VOLT' from 'homeassistant.const' (/usr/src/homeassistant/homeassistant/const.py)

This might be possibly resolved by pull request #114 where the author replaced ELECTRIC_POTENTIAL_VOLT with UnitOfElectricPotential along with many other changes/improvements.


Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/loader.py", line 1015, in async_get_component
    comp = await self.hass.async_add_import_executor_job(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        self._get_component, True
        ^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/usr/local/lib/python3.13/concurrent/futures/thread.py", line 59, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/loader.py", line 1075, in _get_component
    ComponentProtocol, importlib.import_module(self.pkg_path)
                       ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/util/loop.py", line 200, in protected_loop_func
    return func(*args, **kwargs)
  File "/usr/local/lib/python3.13/importlib/__init__.py", line 88, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 1026, in exec_module
  File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
  File "/config/custom_components/smartthings/__init__.py", line 28, in <module>
    from .config_flow import SmartThingsFlowHandler  # noqa: F401
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/smartthings/config_flow.py", line 14, in <module>
    from .const import (
    ...<8 lines>...
    )
  File "/config/custom_components/smartthings/const.py", line 5, in <module>
    from homeassistant.const import (
    ...<5 lines>...
    )
ImportError: cannot import name 'ELECTRIC_POTENTIAL_VOLT' from 'homeassistant.const' (/usr/src/homeassistant/homeassistant/const.py)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/setup.py", line 334, in _async_setup_component
    component = await integration.async_get_component()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/loader.py", line 1035, in async_get_component
    self._component_future.result()
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/src/homeassistant/homeassistant/loader.py", line 1027, in async_get_component
    comp = self._get_component()
  File "/usr/src/homeassistant/homeassistant/loader.py", line 1075, in _get_component
    ComponentProtocol, importlib.import_module(self.pkg_path)
                       ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/util/loop.py", line 200, in protected_loop_func
    return func(*args, **kwargs)
  File "/usr/local/lib/python3.13/importlib/__init__.py", line 88, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 1026, in exec_module
  File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
  File "/config/custom_components/smartthings/__init__.py", line 28, in <module>
    from .config_flow import SmartThingsFlowHandler  # noqa: F401
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/smartthings/config_flow.py", line 14, in <module>
    from .const import (
    ...<8 lines>...
    )
  File "/config/custom_components/smartthings/const.py", line 5, in <module>
    from homeassistant.const import (
    ...<5 lines>...
    )
ImportError: cannot import name 'ELECTRIC_POTENTIAL_VOLT' from 'homeassistant.const' (/usr/src/homeassistant/homeassistant/const.py)
@fate8383
Copy link

fate8383 commented Jan 4, 2025

yes not workin the same error

@sergiograndini
Copy link

same here.

@z-oo-m
Copy link
Author

z-oo-m commented Jan 4, 2025

I did a small test with the pull request #114 - I took all 6 modified files (binary_sensor.py, climate.py, const.py, cover.py, fan.py, sensor.py) and replaced them in my HA installation in /homeassistant/custom_components/smartthings/.

I can report that the SmartThings Custom integration now starts without any errors and all previous settings are left intact. There are still some warnings in the Logs about constants that will be deprecated in HA in the future, but the integration works. I only have Samsung WindFree A/C units, so can only report on that. Anyone who doesn't want to wait for the fix/pull request merge can do the same.

@mrbrunopardal
Copy link

Can you explain how did you replace the files? Tks

@moexpa
Copy link

moexpa commented Jan 4, 2025

Just a note: This integration stopped working after the 2025 update. I decided to delete the custom integration and opt for the vanilla one, which is functional. However, I created a new token and deleted my old ones, only to discover that since January, smartthings tokens only last for 24 hours.

@Diegocampy
Copy link

Just a note: This integration stopped working after the 2025 update. I decided to delete the custom integration and opt for the vanilla one, which is functional. However, I created a new token and deleted my old ones, only to discover that since January, smartthings tokens only last for 24 hours.

So the integration will only work for 24h? I don't understand. Aside from this problem, how do you feel with the standard? Would it work well? Did you find a solution for the tokens of only 24h?

@gonzotek
Copy link

gonzotek commented Jan 4, 2025

Just for reference, here's the notification thread smartthings posted in their community site about the change to a 24 hours expiration for Personal Access Tokens:
https://community.smartthings.com/t/changes-to-personal-access-tokens-pat/292019

@thekoma
Copy link

thekoma commented Jan 4, 2025

Fixed in latest release ! Thanks @veista

@Berteko
Copy link

Berteko commented Jan 4, 2025

Hi Thekoma, can you give details on what to do so that this integration could work as it used to? Thanks

@mrbrunopardal
Copy link

mrbrunopardal commented Jan 4, 2025

Captura de ecrã 2025-01-05 004012
Its already fixed @Berteko, just update it. However, my HA cant turn on or off my AC units via node red/Automations. Seems like the Climate turn off/on services just gone.

@Berteko
Copy link

Berteko commented Jan 5, 2025

Many thanks thekoma and mrbrunopardal!

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

9 participants