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

ImportError: cannot import name 'PhilipsOnOffCluster' from 'zhaquirks.philips' #1071

Closed
dajomas opened this issue Oct 15, 2021 · 4 comments
Closed

Comments

@dajomas
Copy link

dajomas commented Oct 15, 2021

Describe the bug
During startup of Home Assistant 2021.10.4 (using zha-quirks==0.0.62) the following error occurs:

2021-10-15 08:35:38 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry /dev/Zigbee for zha
Traceback (most recent call last):
  File "/srv/hass/lib/python3.8/site-packages/homeassistant/config_entries.py", line 304, in async_setup
    result = await component.async_setup_entry(hass, self)  # type: ignore
  File "/srv/hass/lib/python3.8/site-packages/homeassistant/components/zha/__init__.py", line 99, in async_setup_entry
    setup_quirks(config)
  File "/srv/hass/lib/python3.8/site-packages/zhaquirks/__init__.py", line 394, in setup
    importlib.import_module(modname)
  File "/usr/local/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 783, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/srv/hass/lib/python3.8/site-packages/zhaquirks/philips/llc011.py", line 25, in <module>
    from zhaquirks.philips import PHILIPS, PhilipsOnOffCluster
ImportError: cannot import name 'PhilipsOnOffCluster' from 'zhaquirks.philips' (/srv/hass/lib/python3.8/site-packages/zhaquirks/philips/__init__.py)

To Reproduce
Steps to reproduce the behavior:

  1. sudo systemctl stop home-assistant@homeassistant
  2. sudo systemctl start home-assistant@homeassistant
  3. less home-assistant.log
  4. scroll down until you reach the error

Expected behavior
Setup of /dev/Zigbee (my Zigbee dongle) is succesful

Screenshots
N/A

Additional context
configuration contains:

logger:
  default: info
  logs:
    homeassistant.components: info
    homeassistant.components.zha: debug
    bellows: debug
    zigpy: debug

but no additional information seems to be available

My Zigbee dongle is:

$ lsusb
[...]
Bus 001 Device 063: ID 1cf1:0030 Dresden Elektronik
[...]

And the UDEV rule is:

SUBSYSTEM=="tty", ATTRS{idVendor}=="1cf1", ATTRS{idProduct}=="0030", SYMLINK+="Zigbee"

Thus creating /dev/Zigbee

The installed zha-quirks version is:

$ pip3 list
Package                 Version
----------------------- -----------
[...]
zha-quirks              0.0.62
[...]
@MattWestb
Copy link
Contributor

Your system is using one not compatible file in the HA container:

File "/srv/hass/lib/python3.8/site-packages/zhaquirks/philips/llc011.py", line 25, in <module>
    from zhaquirks.philips import PHILIPS, PhilipsOnOffCluster

The PhilipsOnOffCluster was removed in #993 and also in all remaining Philips quirk it have being deleted / updated, how your system is getting the /srv/hass/lib/python3.8/site-packages/zhaquirks/philips/llc011.py its little strange then its not in the dev brash and was not be the deleted quirks so somthing must have adding it in your system.

Do you have adding or modding quirks in the HA container or with local quirks ?

@dajomas
Copy link
Author

dajomas commented Oct 15, 2021

I am not using the HA container but the venv version. I will try to remove the zha-quirks completely and reinstall it to see if that solves the issue.

I have not modified anything within the HA installation, nor in the local quircks

@dajomas
Copy link
Author

dajomas commented Oct 15, 2021

I have used pip3 to remove the zha-quirks package and manually removed the directory /usr/local/lib/python3.8/site-packages/zhaquirks

Then I re-installed zha-quirks==0.0.62 and all seems to be working again.

Thanx for pointing me in the right direction!

@dajomas dajomas closed this as completed Oct 15, 2021
@MattWestb
Copy link
Contributor

I was searching github for llc011.py and i have not find any so its little strange how you was getting it in your system (if adding it local, is the updating not deleting it so it can being old as python 3.8 then running no docker install).

Great that you was getting it working and the quirk is up to date and not making more problems.

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

2 participants