BME280 not working on Home Assistant 0.82.0 with hass.io

Hy!

as i understand using hass.io i can not log in with the pi user (i have ssh to admin user, but that one can not do raspi-confin or anything good), so not able to enable i2c, since it´s a docker thing?

Some say hass.io does it for me, but nor working for me:
tried
i2c_address: 0x76
and
i2c_address: 0x77

thanks for hints!

Tue Nov 13 2018 01:34:18 GMT+0100 (Mitteleuropäische Normalzeit)

Error while setting up platform bme280
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/smbus/smbus.py", line 81, in open
    self._fd = os.open(path, os.O_RDWR, 0)
FileNotFoundError: [Errno 2] No such file or directory: '/dev/i2c-1'

During handling of the above exception, another exception occurred:

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/site-packages/homeassistant/components/sensor/bme280.py", line 92, in async_setup_platform
    bus = smbus.SMBus(config.get(CONF_I2C_BUS))
  File "/usr/local/lib/python3.6/site-packages/smbus/smbus.py", line 56, in __init__
    self.open(bus)
  File "/usr/local/lib/python3.6/site-packages/smbus/smbus.py", line 83, in open
    raise IOError(e.errno)
OSError: 2
1 Like

Hi, I’m getting the exact same issue.

I tried raspbian to see if it’s a hardware issue, but Raspbian detects the sensor ok:

pi@raspberrypi:~ $ i2cdetect -y 1
0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- 76 --

However under HassIO / HassOS I get the exact same error as you:

~ # docker container exec homeassistant cat /config/home-assistant.log
2018-11-16 15:04:59 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up platform bme280
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/smbus/smbus.py", line 81, in open
    self._fd = os.open(path, os.O_RDWR, 0)
FileNotFoundError: [Errno 2] No such file or directory: '/dev/i2c-1'

During handling of the above exception, another exception occurred:

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/site-packages/homeassistant/components/sensor/bme280.py", line 92, in async_setup_platform
    bus = smbus.SMBus(config.get(CONF_I2C_BUS))
  File "/usr/local/lib/python3.6/site-packages/smbus/smbus.py", line 56, in __init__
    self.open(bus)
  File "/usr/local/lib/python3.6/site-packages/smbus/smbus.py", line 83, in open
    raise IOError(e.errno)
OSError: 2
~ # 

Any advice to help would be good as I’d like to be able to use this sensor under hassOS.

Under Raspbian you need to run raspi-config to turn on I2C, maybe there is something similar for HassOS?

2 Likes

I also have the same problem, with Hass.io and Raspberry Pi 3. The log file is exactly the same.
I have tested with i2c address 0x76, 0x77 and none, without any results.
The same sensor works correctly in Raspbian, with the same connections of the pins.
Does anyone know how to solve this problem?

I wonder: did anybody found a solution? Is there any similar sensor is working with hass.io?

Consult this thread