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

Silas Mariusz

Silas Mariusz

rm -rf /
Help us, GOD!
Apr 5, 2008
9,928
30
2,476
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: "XXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
ota:
  password: "XXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
wifi:
  ssid: "MY_WIFI_NETWORKl"
  password: "12345678"
  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Esphome-Web-BME680"
    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
    gas_resistance:
      name: "BME680 Gas Resistance"
      id: bme680_gas_resistance
      filters:
        - median
    iaq:
      name: "BME680 IAQ"
      id: iaq
      filters:
        - median
    iaq_accuracy:
      # IAQ accuracy as a numeric value of 0, 1, 2, 3
      name: "BME680 Numeric IAQ Accuracy"
    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łe powietrze"};
      }
      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 niezdatne"};
      }
      else if (int(id(iaq).state) >= 151 && int(id(iaq).state) <= 200) {
        return {"Średnio niezdatne"};
      }
      else if (int(id(iaq).state) >= 201 && int(id(iaq).state) <= 250) {
        return {"Bardzo niezdatne"};
      }
      else if (int(id(iaq).state) >= 251 && int(id(iaq).state) <= 350) {
        return {"Silnie niezdatne"};
      }
      else if (int(id(iaq).state) >= 351) {
        return {"Ekstremalnie niezdatne"};
      }
      else {
        return {"error"};
      }
  - platform: template
    name: "BME680 Resistane Classification"
    icon: "mdi:periodic-table-co2"
    lambda: |-
      if ( int(id(bme680_gas_resistance).state) <= 7) {
        return {"UWAGA: Etan"};
      }
      else if (int(id(bme680_gas_resistance).state) >= 8 && int(id(bme680_gas_resistance).state) <= 12) {
        return {"UWAGA: Izopren lub Etanol"};
      }
      else if (int(id(bme680_gas_resistance).state) >= 13 && int(id(bme680_gas_resistance).state) <= 30) {
        return {"UWAGA: Tlenek węgla (czad)"};
      }
      else if (int(id(bme680_gas_resistance).state) >= 31 && int(id(bme680_gas_resistance).state) <= 100) {
        return {"UWAGA: Aceton"};
      }
        else if (int(id(bme680_gas_resistance).state) >= 101) {
        return {"Brak wycieku gazu"};
      }
      else {
        return {"error"};
      }
  - platform: template
    name: "BME680 Effect on health"
    icon: "mdi:periodic-table-co2"
    lambda: |-
      if ( int(id(co2_equivalent).state) <= 1499) {
        return {"Znakomite powietrze"};
      }
      else if (int(id(co2_equivalent).state) >= 1500 && int(id(bme680_gas_resistance).state) <= 2499) {
        return {"Problemy z koncentracją"};
      }
      else if (int(id(co2_equivalent).state) >= 2500 && int(id(co2_equivalent).state) <= 3499) {
        return {"Uczucie zmęczenia"};
      }
      else if (int(id(bme680_gas_resistance).state) >= 3499) {
        return {"Negatywny wpływ na zdrowie!"};
      }
      else {
        return {"error"};
      }
 
Ice

Ice

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

gacmistrz2007

Nowy użytkownik
Noobie
Feb 11, 2015
1
2
3
35
QNAP
TS-x51+
Ethernet
1 GbE
You must log in or register to view this reply.
 

Attachments

  • 1.jpg
    1.jpg
    611.4 KB · Views: 22
  • IMG_20230727_105412.jpg
    IMG_20230727_105412.jpg
    3.6 MB · Views: 22
  • IMG_20230727_105420.jpg
    IMG_20230727_105420.jpg
    1 MB · Views: 21

Users search this thread by keywords

  1. home assistant
  2. esphome