I added a GPIO switch in the configuration yaml like this:
switch:
- platform: rpi_gpio
ports:
21:Downstairs LR
But when I start, the log gives the following error
2020-12-02 16:43:09 ERROR (MainThread) [homeassistant.bootstrap] Error setting up integration switch - received exception
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 827, in async_forward_entry_setup
result = await async_setup_component(self.hass, domain, self._hass_config)
File "/usr/src/homeassistant/homeassistant/setup.py", line 57, in async_setup_component
return await setup_tasks[domain] # type: ignore
File "/usr/src/homeassistant/homeassistant/setup.py", line 64, in async_setup_component
return await task # type: ignore
File "/usr/src/homeassistant/homeassistant/setup.py", line 174, in _async_setup_component
processed_config = await conf_util.async_process_component_config(
File "/usr/src/homeassistant/homeassistant/config.py", line 823, in async_process_component_config
platform = p_integration.get_platform(domain)
File "/usr/src/homeassistant/homeassistant/loader.py", line 424, in get_platform
cache[full_name] = self._import_platform(platform_name)
File "/usr/src/homeassistant/homeassistant/loader.py", line 429, in _import_platform
return importlib.import_module(f"{self.pkg_path}.{platform_name}")
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 961, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
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 "/usr/src/homeassistant/homeassistant/components/rpi_gpio/__init__.py", line 2, in <module>
from RPi import GPIO # pylint: disable=import-error
File "/usr/local/lib/python3.8/site-packages/RPi/GPIO/__init__.py", line 23, in <module>
from RPi._GPIO import *
RuntimeError: This module can only be run on a Raspberry Pi!
I’ve tried installing rpi.gpio_common using apt install.
I tried installing rpi.gpio using pip install. I’m fairly sure I have it installed, but it’s not working.
I have HA installed using docker on a Ras Pi 4. The base OS is Raspberry Pi OS, and I’m pretty sure its the 32-bit version, which from what I was reading is important it seems.
What can I do to troubleshoot this more?