FAQ Home Assistant | ESPhome: ESP8266 NodeMCU v3 + Bosch BME680

Silas Mariusz

Silas Mariusz

rm -rf /
Help us, GOD!
Apr 5, 2008
9,802
25
2,191
153
38
www.devspark.pl
QNAP
TS-x77
Ethernet
1 GbE
Wybrane odczytyPełne odczyty z obydwu czujników
1684770507311
1684770468161

266 BME680 Environmental Sensor Wiring Diagram I2C


Czujnik BME680:
I2C WiringESP NodeMCU Pinout
SCLD1
SDAD2
VIN3V
GNDG

Warianty komunikatów:
IAQ (Jakość powietrza)Opis
<= 50Wspaniała
>= 51 && <= 100Dobra
>= 101 && <= 150Lekko zanieczyszczone
>= 151 && <= 200Średnio zanieczyszczone
>= 201 && <= 250Bardzo zanieczyszczone
>= 251 && <= 350Silnie zanieczyszczone
>= 351Ekstremalnie zanieczyszczone

Klasyfikacja CO2Opis
<= 5Etan
>= 6 && <= 10Izopren lub Etanol
>= 11 && <= 25Tlenek węgla (czad)
>= 26 && <= 99Aceton
>= 100 && <= 199Dla bezpieczeństwa przewietrz
>= 200 && <= 600Bardzo dobre
>= 601 && <= 1000Dobre
>= 1001 && <= 1400Akceptowalne
>= 1401 && <= 5000Należy przewietrzyć pomieszczenie
>= 5000Osiągnięto próg bezpieczeństwa CO2

Kod dla ESPhome
Code:
esphome:
  name: bme680
  friendly_name: BME680

esp8266:
  board: nodemcuv2

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: "DjPRy575TFB7ntEb62zxxzOCzIgx6bQ/OrTalzi61vM="

ota:
  password: "7323579e6e2987f3f5444f5622fda252"

wifi:
  ssid: "MY_WIFI_NETWORK_SSID"
  password: "12345678"

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Esphome-Web-BME280"
    password: "12345678"

captive_portal:

i2c:
  sda: D2
  scl: D1
  scan: True
  id: bus_a

bme680_bsec:
  i2c_id: bus_a

  # Temperature offset
  # ------------------
  # Useful if device is in enclosure and reads too high
  # For example, if it reads 5C too high, set this to 5
  # This also corrects the relative humidity readings
  # Default: 0
  temperature_offset: 3

sensor:
  - platform: bme680_bsec
    temperature:
      name: "BME680 Temperature"
      id: bme680_temperature
      filters:
        - median
    pressure:
      name: "BME680 Pressure"
      id: bme680_pressure
      filters:
        - median
    humidity:
      name: "BME680 Humidity"
      id: bme680_humidity
      filters:
        - median
    iaq:
      name: "BME680 IAQ"
      id: iaq
      filters:
        - median
    co2_equivalent:
      name: "BME680 CO2 Equivalent"
      id: co2_equivalent
      filters:
        - median
    breath_voc_equivalent:
      name: "BME680 Breath VOC Equivalent"
      filters:
        - median
  - platform: template
    name: "BME680 Altitude"
    lambda: |-
      const float STANDARD_SEA_LEVEL_PRESSURE = 1013.25; //in hPa, see note
      return ((id(bme680_temperature).state + 273.15) / 0.0065) *
        (powf((STANDARD_SEA_LEVEL_PRESSURE / id(bme680_pressure).state), 0.190234) - 1); // in meter
    update_interval: 15s
    icon: 'mdi:signal'
    unit_of_measurement: 'm'
  - platform: absolute_humidity
    name: "BME680 Absolute Humidity"
    temperature: bme680_temperature
    humidity: bme680_humidity
  - platform: template
    name: "BME680 Dew Point"
    lambda: |-
      return (243.5*(log(id(bme680_humidity).state/100)+((17.67*id(bme680_temperature).state)/
      (243.5+id(bme680_temperature).state)))/(17.67-log(id(bme680_humidity).state/100)-
      ((17.67*id(bme680_temperature).state)/(243.5+id(bme680_temperature).state))));
    unit_of_measurement: °C
    icon: 'mdi:thermometer-alert'
  - platform: template
    name: "BME680 Equivalent sea level pressure"
    lambda: |-
      const float STANDARD_ALTITUDE = 0.6; // in meters, see note
      return id(bme680_pressure).state / powf(1 - ((0.0065 * STANDARD_ALTITUDE) /
        (id(bme680_temperature).state + (0.0065 * STANDARD_ALTITUDE) + 273.15)), 5.257); // in hPa
    update_interval: 15s
    unit_of_measurement: 'hPa'

text_sensor:
  - platform: bme680_bsec
    iaq_accuracy:
      name: "BME680 IAQ Accuracy"

  - platform: template
    name: "BME680 IAQ Classification"
    icon: "mdi:checkbox-marked-circle-outline"
    lambda: |-
      if ( int(id(iaq).state) <= 50) {
        return {"Wspaniała"};
      }
      else if (int(id(iaq).state) >= 51 && int(id(iaq).state) <= 100) {
        return {"Dobra"};
      }
      else if (int(id(iaq).state) >= 101 && int(id(iaq).state) <= 150) {
        return {"Lekko zanieczyszczone"};
      }
      else if (int(id(iaq).state) >= 151 && int(id(iaq).state) <= 200) {
        return {"Średnio zanieczyszczone"};
      }
      else if (int(id(iaq).state) >= 201 && int(id(iaq).state) <= 250) {
        return {"Bardzo zanieczyszczone"};
      }
      else if (int(id(iaq).state) >= 251 && int(id(iaq).state) <= 350) {
        return {"Silnie zanieczyszczone"};
      }
      else if (int(id(iaq).state) >= 351) {
        return {"Ekstremalnie zanieczyszczone"};
      }
      else {
        return {"error"};
      }
  - platform: template
    name: "BME680 CO2 Classification"
    icon: "mdi:periodic-table-co2"
    lambda: |-
      if ( int(id(co2_equivalent).state) <= 5) {
        return {"UWAGA: Etan"};
      }
      else if (int(id(co2_equivalent).state) >= 6 && int(id(co2_equivalent).state) <= 10) {
        return {"UWAGA: Izopren lub Etanol"};
      }
      else if (int(id(co2_equivalent).state) >= 11 && int(id(co2_equivalent).state) <= 25) {
        return {"UWAGA: Tlenek węgla"};
      }
      else if (int(id(co2_equivalent).state) >= 26 && int(id(co2_equivalent).state) <= 99) {
        return {"UWAGA: Aceton"};
      }
      else if (int(id(co2_equivalent).state) >= 100 && int(id(co2_equivalent).state) <= 199) {
        return {"Dla bezpieczeństwa przewietrz"};
      }
      else if (int(id(co2_equivalent).state) >= 200 && int(id(co2_equivalent).state) <= 600) {
        return {"Bardzo dobre"};
      }
      else if (int(id(co2_equivalent).state) >= 601 && int(id(co2_equivalent).state) <= 1000) {
        return {"Dobre"};
      }
      else if (int(id(co2_equivalent).state) >= 1001 && int(id(co2_equivalent).state) <= 1400) {
        return {"Akceptowalne"};
      }
      else if (int(id(co2_equivalent).state) >= 1401 && int(id(co2_equivalent).state) <= 5000) {
        return {"Należy przewietrzyć pomieszczenie"};
      }
      else if (int(id(co2_equivalent).state) >= 5000) {
        return {"Osiągnięto próg bezpieczeństwa CO2"};
      }
      else {
        return {"error"};
      }
 
Ice

Ice

Best of the best. Cream de la cream.
Q's Reseller
Jan 16, 2018
1,329
1
495
83
37
QNAP
TVS-h1288X
Ethernet
10 GbE
You must log in or register to view this reply.
 
  • Like
Reactions: Silas Mariusz