Bosch BME680 Environmental Sensor


bme680 센서 플랫폼을 사용하면 I2C 버스 (SDA, SCL 핀)를 통해 연결된 Bosch BME680 Environmental sensor의 온도, 습도, 압력 및 가스 저항 값을 읽을 수 있습니다. 데이터 시트에 설명된 센서의 모든 작동 모드를 사용할 수 있습니다. 또한 가스 저항 및 습도 측정을 사용하여 백분율 기반 대기질 측정을 계산하는 기본 대기질 계산이 포함됩니다.

테스트 된 장치 :

설정

BME680 센서를 사용하려면 configuration.yaml 파일에 다음을 추가하십시오.

# Example configuration.yaml entry
sensor:
  - platform: bme680

Configuration Variables

name

(string)(Optional)

The name of the sensor

Default value:

BME680 Sensor

i2c_bus

(integer)(Optional)

I2C bus that the sensor is connected to.

Default value:

1

i2c_address

(integer)(Optional)

I2C address of the sensor. It is 0x76 or 0x77.

Default value:

119

monitored_conditions

(list)(Optional)

Conditions to monitor.

Default value:

[“temperature”, “humidity”, “pressure”, “airquality”]

temperature

Monitor temperature.

humidity

Monitor relative humidity.

pressure

Monitor pressure.

gas

Monitor gas resistance values on the VOC sensor.

airquality

Monitor air quality using the values of humidity and gas resistance and calculate a percentage based air quality measurement.

oversampling_temperature

(integer)(Optional)

Oversampling multiplier as described in the sensor datasheet. Can be 0 (no sampling), 1, 2, 4, 8, or 16.

Default value:

8

oversampling_pressure

(integer)(Optional)

Oversampling multiplier as described in the sensor datasheet. Can be 0 (no sampling), 1, 2, 4, 8, or 16.

Default value:

2

oversampling_humidity

(integer)(Optional)

Oversampling multiplier as described in the sensor datasheet. Can be 0 (no sampling), 1, 2, 4, 8, or 16.

Default value:

4

filter_size

(integer)(Optional)

IIR filter size as described in the sensor datasheet. Can be 0 (off), 1, 3, 7, 15, 31, 63 or 127.

Default value:

3

gas_heater_temperature

(integer)(Optional)

The temperature to heat the hotplate to for gas resistance measurements as described in the sensor datasheet. Can be between 200-400°C.

Default value:

320

gas_heater_duration

(integer)(Optional)

The duration to heat the hotplate in milliseconds for gas resistance measurements as described in the sensor datasheet. Can be between 1-4032 ms. In reality, you will likely need between 80-100ms to reach a stable temperature. Using a duration greater than 1000ms is inadvisable as it will essentially result in the heater being continually on due to the 1-second update interval.

Default value:

150

aq_burn_in_time

(integer)(Optional)

The duration to perform gas resistance measurements to establish a stable baseline measurements for Air Quality calculations in seconds. The burn in time is only performed when the sensor integration is first initialized.

Default value:

300

aq_humidity_baseline

(integer)(Optional)

The baseline ideal relative humidity value for the air quality calculations.

Default value:

40

aq_humidity_bias

(integer)(Optional)

The bias for humidity to the gas resistance measurement in the air quality calculations expressed as a percentage of the total calculation e.g., 25% humidity to 75% gas.

Default value:

25

temp_offset

(float)(Optional)

The temperature for the sensor will always be too high as it pulls heat from the components around it. Consider adding a negative offset to ensure the sensor returns an accurate temperature. Note: This value is in celsius.

Default value:

0

전체 사례

디지털 센서의 작동 모드를 지정하거나 기본 I2C 주소 (0x77)를 변경해야하는 경우 configuration.yaml 파일에 세부 사항을 추가하십시오.

# Example of customized configuration.yaml entry
sensor:
  - platform: bme680
    name: BME680 Sensor
    i2c_bus: 1
    i2c_address: 0x77
    monitored_conditions:
      - temperature
      - humidity
      - pressure
      - gas
      - airquality
    oversampling_temperature: 8
    oversampling_humidity: 2
    oversampling_pressure: 4
    filter_size: 3
    gas_heater_temperature: 320
    gas_heater_duration: 150
    aq_burn_in_time: 300
    aq_humidity_baseline: 40
    aq_humidity_bias: 25
    temp_offset: -5.5

사용자 정의 센서 데이터

값에 친숙한 이름과 아이콘을 지정하고 customize: 섹션에 다음을 추가하십시오.

# Example configuration.yaml entry
customize:
  sensor.bme680_sensor_temperature:
    icon: mdi:thermometer
    friendly_name: Temperature
  sensor.bme680_sensor_humidity:
    icon: mdi:water
    friendly_name: Humidity
    device_class: humidity
    unit_of_measurement: "%"
  sensor.bme680_sensor_pressure:
    icon: mdi:gauge
    friendly_name: Pressure
  sensor.bme680_sensor_air_quality:
    icon: mdi:blur
    friendly_name: Air Quality
    device_class: pm25
    unit_of_measurement: "%"

그룹을 만들려면 group 섹션에 다음을 추가하십시오.

# Example configuration.yaml entry
group:
  climate:
    name: Climate
    entities:
      - sensor.bme680_sensor_temperature
      - sensor.bme680_sensor_humidity
      - sensor.bme680_sensor_pressure
      - sensor.bme680_sensor_air_quality

Hass.io에서 I2C 인터페이스를 활성화하기 위한 지침

enable I2C on Hass.io지침을 따르십시오.

Raspberry Pi에 SMBus 설치 지침

Raspberry Pi 설정 유틸리티를 사용하여 I2C 인터페이스를 활성화하십시오.

# pi user environment: Enable I2C interface
$ sudo raspi-config

Select Interfacing options->I2C choose <Yes> and hit Enter, then go to Finish and you’ll be prompted to reboot.

Install dependencies to use the smbus-cffi module and add your homeassistant user to the i2c group:

# pi user environment: Install I2C dependencies and utilities
$ sudo apt-get install build-essential libi2c-dev i2c-tools python-dev libffi-dev

# pi user environment: Add homeassistant user to the I2C group
$ sudo addgroup homeassistant i2c

# pi user environment: Reboot Raspberry Pi to apply changes
$ sudo reboot

센서의 I2C 주소 확인

i2c-tools를 설치한 후, 연결된 센서의 주소를 스캔하기 위해 새로운 유틸리티를 사용할 수 있습니다 :

$ /usr/sbin/i2cdetect -y 1

It will output a table like this:

     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- 3c -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- 76

따라서 찾고있는 센서 주소가 0x76임을 알 수 있습니다. (해당 Raspberry Pi에 다른 I2C 장치가 있음).