Hello every one I have a problem with gpio on Home assistant, someone can help me? my installation is on rspberry pi 3b and when I try to modify the configuration. yaml file nothing apper on the main page of home assistant.
this is my code:
Example configuration.yaml entry
switch:
platform: rpi_gpio
ports:
11: Fan Office
12: Light Desk
2020-04-29 16:20:48 ERROR (MainThread) [homeassistant.components.binary_sensor] Error while setting up rpi_gpio platform for binary_sensor
Traceback (most recent call last):
File “/srv/homeassistant/lib/python3.7/site-packages/homeassistant/helpers/entity_platform.py”, line 178, in _async_setup_platform
await asyncio.wait_for(asyncio.shield(task), SLOW_SETUP_MAX_WAIT)
File “/usr/lib/python3.7/asyncio/tasks.py”, line 416, in wait_for
return fut.result()
File “/usr/lib/python3.7/concurrent/futures/thread.py”, line 57, in run
result = self.fn(*self.args, **self.kwargs)
File “/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/rpi_gpio/binary_sensor.py”, line 45, in setup_platform
port_name, port_num, pull_mode, bouncetime, invert_logic
File “/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/rpi_gpio/binary_sensor.py”, line 63, in init
rpi_gpio.setup_input(self._port, self._pull_mode)
File “/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/rpi_gpio/init.py”, line 36, in setup_input
GPIO.setup(port, GPIO.IN, GPIO.PUD_DOWN if pull_mode == “DOWN” else GPIO.PUD_UP)
RuntimeError: No access to /dev/mem. Try running as root!
2020-04-29 16:20:49 WARNING (MainThread) [pydeconz.utils] Received unexpected bridge id: 0000000000000000
2020-04-29 16:20:49 WARNING (MainThread) [pydeconz.utils] Received unexpected bridge id: 0000000000000000
# Example configuration.yaml entry
switch:
- platform: rpi_gpio
ports:
11: Fan Office
12: Light Desk
and this is the log:
2020-04-29 18:27:44 ERROR (MainThread) [homeassistant.components.switch] Error while setting up rpi_gpio platform for switch
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/helpers/entity_platform.py", line 178, in _async_setup_platform
await asyncio.wait_for(asyncio.shield(task), SLOW_SETUP_MAX_WAIT)
File "/usr/lib/python3.7/asyncio/tasks.py", line 416, in wait_for
return fut.result()
File "/usr/lib/python3.7/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/rpi_gpio/switch.py", line 37, in setup_platform
switches.append(RPiGPIOSwitch(name, port, invert_logic))
File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/rpi_gpio/switch.py", line 50, in __init__
rpi_gpio.setup_output(self._port)
File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/rpi_gpio/__init__.py", line 31, in setup_output
GPIO.setup(port, GPIO.OUT)
RuntimeError: No access to /dev/mem. Try running as root!
2020-04-29 18:27:44 WARNING (MainThread) [pydeconz.utils] Received unexpected bridge id: 0000000000000000
2020-04-29 18:27:44 WARNING (MainThread) [pydeconz.utils] Received unexpected bridge id: 0000000000000000