I am running Home Assistant (0.86.4) under Docker on a Raspberry Pi. I have been trying for several days to get an Adafruit sht31d temperature sensor to work. It works under Python on the Raspberry Pi: will happily output temperature and humidity to the command line, so I know that things like i2c are working properly at the basic hardware level. However, Home Assistant gives me the following error:
Error while setting up platform sht31
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/homeassistant/helpers/entity_platform.py", line 128, in _async_setup_platform
SLOW_SETUP_MAX_WAIT, loop=hass.loop)
File "/usr/local/lib/python3.6/asyncio/tasks.py", line 358, in wait_for
return fut.result()
File "/usr/local/lib/python3.6/concurrent/futures/thread.py", line 56, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/local/lib/python3.6/site-packages/homeassistant/components/sensor/sht31.py", line 54, in setup_platform
sensor = SHT31(address=i2c_address)
File "/usr/local/lib/python3.6/site-packages/Adafruit_SHT31.py", line 61, in __init__
self._device = i2c.get_i2c_device(address, **kwargs)
File "/usr/local/lib/python3.6/site-packages/Adafruit_GPIO/I2C.py", line 64, in get_i2c_device
return Device(address, busnum, i2c_interface, **kwargs)
File "/usr/local/lib/python3.6/site-packages/Adafruit_GPIO/I2C.py", line 97, in __init__
self._bus = Adafruit_PureIO.smbus.SMBus(busnum)
File "/usr/local/lib/python3.6/site-packages/Adafruit_PureIO/smbus.py", line 105, in __init__
self.open(bus)
File "/usr/local/lib/python3.6/site-packages/Adafruit_PureIO/smbus.py", line 130, in open
self._device = open('/dev/i2c-{0}'.format(bus), 'r+b', buffering=0)
FileNotFoundError: [Errno 2] No such file or directory: '/dev/i2c-1'
When I ssh to the command line, /dev/i2c-1 is present. I have tried the various fixes suggested in these pages including this one. Nothing seems to work. I donāt think there is anything wrong with my configuration.yaml file which sticks closely to the HA recommendation, but here it is just in case:
sensor:
- platform: sht31
name: Living room ambience
i2c_address: 0x44
monitored_conditions:
- temperature
- humidity
Does anyone have any suggestions?