On a HASS OS installation, I found that the quickest way to get it to work was to install the library through apk (apk add hidapion the SSH container, not the host ). This installs it in /usr/lib , which isn’t persistent between container restarts, so it has to be moved to a directory that is (e.g. /config/deps/ ). → Source
I am using HASS OS. Maybe someone can explain me how to install hidapi “on the SSH container”.
pip install /home/hassio/_pyhidapi-master
Successfully installed pyhidapi-1.0.0
**WARNING:** Running pip as the 'root' user can result in broken permissions and conflicting behaviour With the system package manager.
It is recormended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
After importing the custom component I got the error that the Module ‘hid’ is not found:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 359, in _async_setup_platform
await asyncio.shield(task)
File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/dali/light.py", line 77, in setup_platform
from dali.driver.hasseb import SyncHassebDALIUSBDriverFactory
File "/usr/local/lib/python3.11/site-packages/dali/driver/hasseb.py", line 18, in <module>
import hid
ModuleNotFoundError: No module named 'hid'