I’ve just upgraded to 0.75.2 and transitioned over to using HomeAssistant in a docker container. Previously I’d been using a virtualenv.
However, since changing, I’ve been unable to get DHT and BH1750 sensor components to work. I get the error RuntimeError: Error accessing GPIO.. I know there was an issue with the Adafruit library in the last few updates to HomeAssistant. But GitHub is showing that it’s working as normal in the 0.75.2 build.
ps aux | grep -i homeassistant shows that homeassistant is being run as a root user via docker. So I’m guessing that there should be no issue with permissions or need to add root to the gpio group.
It’s the same issue. I’m unable to access the GPIO from docker, despite declaring privileged: true and devices: - /dev/gpiomem:/dev/gpiomem - /dev/mem:/dev/mem in my docker-compose file. So I’m still getting the same error as before. DHT.py error is showing RuntimeError: Error accessing GPIO.and BH1750.oy error is showing as FileNotFoundError: [Errno 2] No such file or directory: '/dev/i2c-1'
not sure about RuntimeError: Error accessing GPIO, but FileNotFoundError: [Errno 2] No such file or directory: '/dev/i2c-1' suggests you also need to map /dev/i2c-1 in your docker-compose file
Thanks for your help. I managed to sort it out. You were right, both gpiomem and i2c-1 needed to be declared in my docker-compose file. Here’s what had to be added under the homeassistant docker: