Full Guide to read BME680 via BSEC2 on esp8266

Hello!

I wanted to share my painful experience with BME680. This tiny wonderful sensor is really tricky to get it work on an ESP8266 using the latest BSEC libraries from Bosch. On esphome.io there’s a good documentation (BME68x Temperature, Humidity, Pressure & Gas Sensor via BSEC2 — ESPHome) but it’s lacking some tricks to make it work flawless with 8266 boards. I’ve spent a full day trying to make it work, but here’s everything I did, just in case someone else want to try this great sensor.

Wiring scheme:

BME680 ESP8266 NodeMCUv2
VCC 3V3
GND GND
SCL D1
SDA D2
SDO Not Connected
CS Not Connected

Then we have to setup the yaml configuration, we’ll copy and paste more or less the same stuff found on esphome.io:

i2c:

bme68x_bsec2_i2c:
  address: 0x77
  model: bme680
  operating_age: 28d
  sample_rate: LP
  supply_voltage: 3.3V

sensor:
  - platform: bme68x_bsec2
    temperature:
      name: "BME68x Temperature"
    pressure:
      name: "BME68x Pressure"
    humidity:
      name: "BME68x Humidity"
    iaq:
      name: "BME68x IAQ"
      id: iaq
    co2_equivalent:
      name: "BME68x CO2 Equivalent"
    breath_voc_equivalent:
      name: "BME68x Breath VOC Equivalent"

text_sensor:
  - platform: bme68x_bsec2
    iaq_accuracy:
      name: "BME68x IAQ Accuracy"
  - platform: template
    name: "BME68x IAQ Classification"
    lambda: |-
      if ( int(id(iaq).state) <= 50) {
        return {"Excellent"};
      }
      else if (int(id(iaq).state) >= 51 && int(id(iaq).state) <= 100) {
        return {"Good"};
      }
      else if (int(id(iaq).state) >= 101 && int(id(iaq).state) <= 150) {
        return {"Lightly polluted"};
      }
      else if (int(id(iaq).state) >= 151 && int(id(iaq).state) <= 200) {
        return {"Moderately polluted"};
      }
      else if (int(id(iaq).state) >= 201 && int(id(iaq).state) <= 250) {
        return {"Heavily polluted"};
      }
      else if (int(id(iaq).state) >= 251 && int(id(iaq).state) <= 350) {
        return {"Severely polluted"};
      }
      else if (int(id(iaq).state) >= 351) {
        return {"Extremely polluted"};
      }
      else {
        return {"error"};
      }

Now we have to specify some instructions to the compiler, in order to make BSEC2 works with low memory boards like ESP8266.
Look at the beginning of your file for the section

esphome:

Under this section you have to add the following lines:

 platformio_options:
    build_flags:
      - -DPIO_FRAMEWORK_ARDUINO_MMU_CACHE16_IRAM48_SECHEAP_SHARED

This will instruct the compiler to create a correct firmware for the ESP32

If you don’t add these lines the board will not boot up and flashes its blue led multiple times in a reboot cycle

Now you are ready to flash the firmware to the board!!

But wait… Once you have flashed the board, in my case, the board lost the wifi configuration and I had to access the AP to reconfigure it to access my wifi network… and done!

You can also add these lines to the wifi configuration, in order to make it join the network automatically:

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

now you have your BME680 working with the latest Bosch library on the same ESP8266 hardware you were using before!

5 Likes

Thank you, you most likely saved me days and days of bug hunting.

1 Like

Hello,

I followed you steps but unfortunately I didn’t get it working
for many sensors are not getting updated even after 24h
I’m getting some readings only for temperature, humidity and pressure

image

it is even very strange that I got an update only after 24h
image

by the way the readings are completely wrong, we are in winter and it is not 36 degres in my house…

I enable the VERY_VERBOSE mode and collected the following logs

[21:29:56][I][app:100]: ESPHome version 2024.10.3 compiled on Nov 18 2024, 21:25:12
[21:29:56][C][wifi:600]: WiFi:
[21:29:56][C][wifi:428]:   Local MAC: XXXXXXXXXXXXX
[21:29:56][C][wifi:433]:   SSID: 'XXXXXXXXXXXXX'[redacted]
[21:29:56][C][wifi:436]:   IP Address: 192.168.1.XXX
[21:29:56][C][wifi:439]:   BSSID: XXXXXXXXXXXXX[redacted]
[21:29:56][C][wifi:441]:   Hostname: 'tvledlight'
[21:29:56][C][wifi:443]:   Signal strength: -49 dB ▂▄▆█
[21:29:56][V][wifi:445]:   Priority: 0.0
[21:29:56][C][wifi:447]:   Channel: 1
[21:29:56][C][wifi:448]:   Subnet: 255.255.255.0
[21:29:56][C][wifi:449]:   Gateway: 192.168.1.1
[21:29:56][C][wifi:450]:   DNS1: 192.168.1.1
[21:29:56][C][wifi:451]:   DNS2: 0.0.0.0
[21:29:56][C][logger:185]: Logger:
[21:29:56][C][logger:186]:   Level: VERY_VERBOSE
[21:29:56][C][logger:188]:   Log Baud Rate: 115200
[21:29:56][C][logger:189]:   Hardware UART: UART0
[21:29:56][C][i2c.arduino:071]: I2C Bus:
[21:29:56][C][i2c.arduino:072]:   SDA Pin: GPIO4
[21:29:56][C][i2c.arduino:073]:   SCL Pin: GPIO5
[21:29:56][C][i2c.arduino:074]:   Frequency: 50000 Hz
[21:29:56][C][i2c.arduino:086]:   Recovery: bus successfully recovered
[21:29:56][I][i2c.arduino:096]: Results from i2c bus scan:
[21:29:56][I][i2c.arduino:102]: Found i2c device at address 0x77
[21:29:56][C][bme68x_bsec2_i2c.sensor:029]:   Address: 0x77
[21:29:56][C][bme68x_bsec2.sensor:060]: BME68X via BSEC2:
[21:29:56][C][bme68x_bsec2.sensor:062]:   BSEC2 version: 2.5.0.2
[21:29:56][C][bme68x_bsec2.sensor:065]:   BSEC2 configuration blob:
[21:29:56][C][bme68x_bsec2.sensor:066]:     Configured: YES
[21:29:56][C][bme68x_bsec2.sensor:068]:     Size: 2063
[21:29:56][C][bme68x_bsec2.sensor:079]:   Operating age: 28 days
[21:29:56][C][bme68x_bsec2.sensor:080]:   Sample rate: LP
[21:29:56][C][bme68x_bsec2.sensor:081]:   Voltage: 3.3V
[21:29:56][C][bme68x_bsec2.sensor:082]:   State save interval: 21600000ms
[21:29:56][C][bme68x_bsec2.sensor:083]:   Temperature offset: 0.00
[21:29:56][C][bme68x_bsec2.sensor:086]:   Temperature 'LivingRoom_BME680_Temperature'
[21:29:56][C][bme68x_bsec2.sensor:086]:     Device Class: 'temperature'
[21:29:56][C][bme68x_bsec2.sensor:086]:     State Class: 'measurement'
[21:29:56][C][bme68x_bsec2.sensor:086]:     Unit of Measurement: '°C'
[21:29:56][C][bme68x_bsec2.sensor:086]:     Accuracy Decimals: 1
[21:29:56][C][bme68x_bsec2.sensor:086]:     Icon: 'mdi:thermometer'
[21:29:56][C][bme68x_bsec2.sensor:087]:     Sample rate: Default
[21:29:56][C][bme68x_bsec2.sensor:088]:   Pressure 'LivingRoom_BME680_Pressure'
[21:29:56][C][bme68x_bsec2.sensor:088]:     Device Class: 'atmospheric_pressure'
[21:29:56][C][bme68x_bsec2.sensor:088]:     State Class: 'measurement'
[21:29:56][C][bme68x_bsec2.sensor:088]:     Unit of Measurement: 'hPa'
[21:29:56][C][bme68x_bsec2.sensor:088]:     Accuracy Decimals: 1
[21:29:56][C][bme68x_bsec2.sensor:088]:     Icon: 'mdi:gauge'
[21:29:56][C][bme68x_bsec2.sensor:089]:     Sample rate: Default
[21:29:56][C][bme68x_bsec2.sensor:090]:   Humidity 'LivingRoom_BME680_Humidity'
[21:29:56][C][bme68x_bsec2.sensor:090]:     Device Class: 'humidity'
[21:29:56][C][bme68x_bsec2.sensor:090]:     State Class: 'measurement'
[21:29:56][C][bme68x_bsec2.sensor:090]:     Unit of Measurement: '%'
[21:29:56][C][bme68x_bsec2.sensor:090]:     Accuracy Decimals: 1
[21:29:56][C][bme68x_bsec2.sensor:090]:     Icon: 'mdi:water-percent'
[21:29:56][C][bme68x_bsec2.sensor:091]:     Sample rate: Default
[21:29:56][C][bme68x_bsec2.sensor:092]:   Gas resistance 'LivingRoom_BME680_Gas_Resistance'
[21:29:56][C][bme68x_bsec2.sensor:092]:     State Class: 'measurement'
[21:29:56][C][bme68x_bsec2.sensor:092]:     Unit of Measurement: 'Ω'
[21:29:56][C][bme68x_bsec2.sensor:092]:     Accuracy Decimals: 0
[21:29:56][C][bme68x_bsec2.sensor:092]:     Icon: 'mdi:gas-cylinder'
[21:29:56][C][bme68x_bsec2.sensor:093]:   CO2 equivalent 'LivingRoom_BME680_CO2_Equivalent'
[21:29:56][C][bme68x_bsec2.sensor:093]:     State Class: 'measurement'
[21:29:56][C][bme68x_bsec2.sensor:093]:     Unit of Measurement: 'ppm'
[21:29:56][C][bme68x_bsec2.sensor:093]:     Accuracy Decimals: 1
[21:29:56][C][bme68x_bsec2.sensor:093]:     Icon: 'mdi:test-tube'
[21:29:56][C][bme68x_bsec2.sensor:094]:   Breath VOC equivalent 'LivingRoom_BME680_Breath_VOC_Equivalent'
[21:29:56][C][bme68x_bsec2.sensor:094]:     State Class: 'measurement'
[21:29:56][C][bme68x_bsec2.sensor:094]:     Unit of Measurement: 'ppm'
[21:29:56][C][bme68x_bsec2.sensor:094]:     Accuracy Decimals: 1
[21:29:56][C][bme68x_bsec2.sensor:094]:     Icon: 'mdi:test-tube'
[21:29:56][C][bme68x_bsec2.sensor:095]:   IAQ 'LivingRoom_BME680_IAQ'
[21:29:56][C][bme68x_bsec2.sensor:095]:     State Class: 'measurement'
[21:29:56][C][bme68x_bsec2.sensor:095]:     Unit of Measurement: 'IAQ'
[21:29:56][C][bme68x_bsec2.sensor:095]:     Accuracy Decimals: 0
[21:29:56][C][bme68x_bsec2.sensor:095]:     Icon: 'mdi:gauge'
[21:29:57][D][api:103]: Accepted 192.168.1.200
[21:29:57][VV][api.socket:696]: 192.168.1.200: Handshake complete!
[21:29:57][W][component:237]: Component api took a long time for an operation (324 ms).
[21:29:57][W][component:238]: Components should block for at most 30 ms.
[21:29:57][C][status:034]: Status Binary Sensor 'TVLedLight_Status'
[21:29:57][C][status:034]:   Device Class: 'connectivity'
[21:29:57][C][restart:068]: Restart Switch 'TVLedLight Restart'
[21:29:57][C][restart:070]:   Icon: 'mdi:restart'
[21:29:57][C][restart:090]:   Restore Mode: always OFF
[21:29:57][C][mdns:116]: mDNS:
[21:29:57][C][mdns:117]:   Hostname: tvledlight
[21:29:57][V][mdns:118]:   Services:
[21:29:57][V][mdns:120]:   - esphomelib, tcp, 6053
[21:29:57][V][mdns:122]:     TXT: version = 2024.10.3
[21:29:57][V][mdns:122]:     TXT: mac = XXXXXXXXXXXXX
[21:29:57][V][mdns:122]:     TXT: platform = ESP8266
[21:29:57][V][mdns:122]:     TXT: board = d1_mini
[21:29:57][V][mdns:122]:     TXT: network = wifi
[21:29:57][V][mdns:122]:     TXT: api_encryption = Noise_NNpsk0_25519_ChaChaPoly_SHA256
[21:29:57][C][esphome.ota:073]: Over-The-Air updates:
[21:29:57][C][esphome.ota:074]:   Address: tvledlight.local:8266
[21:29:57][C][esphome.ota:075]:   Version: 2
[21:29:57][C][esphome.ota:078]:   Password configured
[21:29:57][C][safe_mode:018]: Safe Mode:
[21:29:57][C][safe_mode:019]:   Boot considered successful after 60 seconds
[21:29:57][C][safe_mode:021]:   Invoke after 10 boot attempts
[21:29:57][C][safe_mode:022]:   Remain in safe mode for 300 seconds
[21:29:57][C][api:140]: API Server:
[21:29:57][C][api:141]:   Address: tvledlight.local:6053
[21:29:57][C][api:143]:   Using noise encryption: YES
[21:29:57][C][wifi_signal.sensor:010]: WiFi Signal 'TVLedLight Wifi'
[21:29:57][C][wifi_signal.sensor:010]:   Device Class: 'signal_strength'
[21:29:57][C][wifi_signal.sensor:010]:   State Class: 'measurement'
[21:29:57][C][wifi_signal.sensor:010]:   Unit of Measurement: 'dBm'
[21:29:57][C][wifi_signal.sensor:010]:   Accuracy Decimals: 0
[21:29:57][V][wifi_signal.sensor:010]:   Unique ID: 'XXXXXXXXXXXXX-wifisignal'
[21:29:57][C][homeassistant.sensor:030]: Homeassistant Sensor 'id_kitchenled_percentage_from_ha'
[21:29:57][C][homeassistant.sensor:030]:   State Class: ''
[21:29:57][C][homeassistant.sensor:030]:   Unit of Measurement: ''
[21:29:57][C][homeassistant.sensor:030]:   Accuracy Decimals: 1
[21:29:57][C][homeassistant.sensor:031]:   Entity ID: 'sensor.percentage_light'
[21:29:57][C][debug:021]: Debug component:
[21:29:57][D][debug:035]: ESPHome version 2024.10.3
[21:29:57][D][debug:039]: Free Heap Size: 10808 bytes
[21:29:57][D][debug:041]: Flash Chip: Size=4096kB Speed=40MHz Mode=DOUT
[21:29:57][D][debug:050]: Chip ID: 0x0074A76B
[21:29:57][D][debug:051]: SDK Version: 2.2.2-dev(38a443e)
[21:29:57][D][debug:052]: Core Version: 3.1.2
[21:29:57][D][debug:053]: Boot Version=31 Mode=1
[21:29:57][D][debug:054]: CPU Frequency: 80
[21:29:57][D][debug:055]: Flash Chip ID=0x0016405E
[21:29:57][D][debug:056]: Reset Reason: Software/System restart
[21:29:57][D][debug:057]: Reset Info: Software/System restart
[21:29:59][V][bme68x_bsec2.sensor:214]: Performing sensor run
[21:29:59][VV][bme68x_bsec2_i2c.sensor:036]: read_bytes_wrapper: reg = 113
[21:29:59][VV][i2c.arduino:176]: 0x77 TX 71
[21:29:59][VV][i2c.arduino:202]: TX failed: not acknowledged: 2
[21:29:59][VV][bme68x_bsec2_i2c.sensor:036]: read_bytes_wrapper: reg = 116
[21:29:59][VV][i2c.arduino:176]: 0x77 TX 74
[21:29:59][VV][i2c.arduino:148]: 0x77 RX 00
[21:29:59][VV][bme68x_bsec2_i2c.sensor:036]: read_bytes_wrapper: reg = 116
[21:29:59][VV][i2c.arduino:176]: 0x77 TX 74
[21:29:59][VV][i2c.arduino:148]: 0x77 RX 00
[21:29:59][VV][bme68x_bsec2_i2c.sensor:036]: read_bytes_wrapper: reg = 113
[21:29:59][VV][i2c.arduino:176]: 0x77 TX 71
[21:29:59][VV][i2c.arduino:148]: 0x77 RX 0000000000
[21:29:59][VV][bme68x_bsec2_i2c.sensor:042]: write_bytes_wrapper: reg = 113
[21:29:59][VV][i2c.arduino:176]: 0x77 TX 71007201730074547520
[21:29:59][VV][bme68x_bsec2_i2c.sensor:036]: read_bytes_wrapper: reg = 116
[21:29:59][VV][i2c.arduino:176]: 0x77 TX 74
[21:29:59][VV][i2c.arduino:148]: 0x77 RX 54
[21:29:59][VV][bme68x_bsec2_i2c.sensor:042]: write_bytes_wrapper: reg = 116
[21:29:59][VV][i2c.arduino:176]: 0x77 TX 7455
[21:29:59][VV][bme68x_bsec2_i2c.sensor:036]: read_bytes_wrapper: reg = 116
[21:29:59][VV][i2c.arduino:176]: 0x77 TX 74
[21:29:59][VV][i2c.arduino:202]: TX failed: not acknowledged: 2
[21:29:59][VV][bme68x_bsec2_i2c.sensor:036]: read_bytes_wrapper: reg = 116
[21:29:59][VV][i2c.arduino:176]: 0x77 TX 74
[21:29:59][VV][i2c.arduino:148]: 0x77 RX 00
[21:29:59][VV][bme68x_bsec2_i2c.sensor:042]: write_bytes_wrapper: reg = 116
[21:29:59][VV][i2c.arduino:176]: 0x77 TX 7401
[21:29:59][V][bme68x_bsec2.sensor:243]: Using forced mode
[21:29:59][V][bme68x_bsec2.sensor:275]: Queueing read in 42590us
[21:29:59][VV][scheduler:032]: set_timeout(name='read', timeout=42)
[21:29:59][W][component:237]: Component bme68x_bsec2 took a long time for an operation (157 ms).
[21:29:59][W][component:238]: Components should block for at most 30 ms.
[21:29:59][VV][scheduler:225]: Running timeout 'read' with interval=42 last_execution=26803 (now=26846)
[21:29:59][V][bme68x_bsec2.sensor:284]: Reading data
[21:29:59][VV][bme68x_bsec2_i2c.sensor:036]: read_bytes_wrapper: reg = 116
[21:29:59][VV][i2c.arduino:176]: 0x77 TX 74
[21:29:59][VV][i2c.arduino:148]: 0x77 RX 00
[21:29:59][V][bme68x_bsec2.sensor:291]: Still in sleep mode, doing nothing
[21:29:59][VV][api.service:661]: on_hello_request: HelloRequest {
  client_info: 'Home Assistant 2024.11.2'
  api_version_major: 1
  api_version_minor: 10
}
[21:29:59][V][api.connection:1427]: Hello from client: 'Home Assistant 2024.11.2' | 192.168.1.200 | API Version 1.10
[21:29:59][VV][api.service:013]: send_hello_response: HelloResponse {
  api_version_major: 1
  api_version_minor: 10
  server_info: 'tvledlight (esphome v2024.10.3)'
  name: 'tvledlight'
}
[21:29:59][VV][api.service:670]: on_connect_request: ConnectRequest {
  password: ''
}
[21:29:59][D][api.connection:1446]: Home Assistant 2024.11.2 (192.168.1.200): Connected successfully
[21:29:59][VV][api.service:019]: send_connect_response: ConnectResponse {
  invalid_password: NO
}
[21:29:59][VV][api.service:715]: on_device_info_request: DeviceInfoRequest {}
[21:29:59][VV][api.service:049]: send_device_info_response: DeviceInfoResponse {
  uses_password: NO
  name: 'tvledlight'
  mac_address: '8C:AA:B5:74:A7:6B'
  esphome_version: '2024.10.3'
  compilation_time: 'Nov 18 2024, 21:25:12'
  model: 'd1_mini'
  has_deep_sleep: NO
  project_name: ''
  project_version: ''
  webserver_port: 0
  legacy_bluetooth_proxy_version: 0
  bluetooth_proxy_feature_flags: 0
  manufacturer: 'Espressif'
  friendly_name: ''
  legacy_voice_assistant_version
[21:29:59][VV][api.service:724]: on_list_entities_request: ListEntitiesRequest {}
[21:29:59][VV][api.service:062]: send_list_entities_binary_sensor_response: ListEntitiesBinarySensorResponse {
  object_id: 'tvledlight_status'
  key: 3763940279
  name: 'TVLedLight_Status'
  unique_id: 'tvledlightbinary_sensortvledlight_status'
  device_class: 'connectivity'
  is_status_binary_sensor: YES
  disabled_by_default: NO
  icon: ''
  entity_category: ENTITY_CATEGORY_DIAGNOSTIC
}
[21:29:59][VV][api.service:132]: send_list_entities_sensor_response: ListEntitiesSensorResponse {
  object_id: 'tvledlight_wifi'
  key: 806464930
  name: 'TVLedLight Wifi'
  unique_id: '8caab574a76b-wifisignal'
  icon: ''
  unit_of_measurement: 'dBm'
  accuracy_decimals: 0
  force_update: NO
  device_class: 'signal_strength'
  state_class: STATE_CLASS_MEASUREMENT
  legacy_last_reset_type: LAST_RESET_NONE
  disabled_by_default: NO
  entity_category: ENTITY_CATEGORY_DIAGNO
[21:29:59][VV][api.service:132]: send_list_entities_sensor_response: ListEntitiesSensorResponse {
  object_id: 'livingroom_bme680_temperature'
  key: 722483027
  name: 'LivingRoom_BME680_Temperature'
  unique_id: 'tvledlightsensorlivingroom_bme680_temperature'
  icon: 'mdi:thermometer'
  unit_of_measurement: '°C'
  accuracy_decimals: 1
  force_update: NO
  device_class: 'temperature'
  state_class: STATE_CLASS_MEASUREMENT
  legacy_last_reset_type: LAST_RESET_NONE
  disa
[21:29:59][VV][api.service:132]: send_list_entities_sensor_response: ListEntitiesSensorResponse {
  object_id: 'livingroom_bme680_pressure'
  key: 4136055770
  name: 'LivingRoom_BME680_Pressure'
  unique_id: 'tvledlightsensorlivingroom_bme680_pressure'
  icon: 'mdi:gauge'
  unit_of_measurement: 'hPa'
  accuracy_decimals: 1
  force_update: NO
  device_class: 'atmospheric_pressure'
  state_class: STATE_CLASS_MEASUREMENT
  legacy_last_reset_type: LAST_RESET_NONE
  disabled_
[21:29:59][VV][api.service:132]: send_list_entities_sensor_response: ListEntitiesSensorResponse {
  object_id: 'livingroom_bme680_humidity'
  key: 925142604
  name: 'LivingRoom_BME680_Humidity'
  unique_id: 'tvledlightsensorlivingroom_bme680_humidity'
  icon: 'mdi:water-percent'
  unit_of_measurement: '%'
  accuracy_decimals: 1
  force_update: NO
  device_class: 'humidity'
  state_class: STATE_CLASS_MEASUREMENT
  legacy_last_reset_type: LAST_RESET_NONE
  disabled_by_defa
[21:29:59][VV][api.service:132]: send_list_entities_sensor_response: ListEntitiesSensorResponse {
  object_id: 'livingroom_bme680_gas_resistance'
  key: 2542394750
  name: 'LivingRoom_BME680_Gas_Resistance'
  unique_id: 'tvledlightsensorlivingroom_bme680_gas_resistance'
  icon: 'mdi:gas-cylinder'
  unit_of_measurement: 'Ω'
  accuracy_decimals: 0
  force_update: NO
  device_class: ''
  state_class: STATE_CLASS_MEASUREMENT
  legacy_last_reset_type: LAST_RESET_NONE
  disab
[21:29:59][VV][api.service:132]: send_list_entities_sensor_response: ListEntitiesSensorResponse {
  object_id: 'livingroom_bme680_iaq'
  key: 2929189154
  name: 'LivingRoom_BME680_IAQ'
  unique_id: 'tvledlightsensorlivingroom_bme680_iaq'
  icon: 'mdi:gauge'
  unit_of_measurement: 'IAQ'
  accuracy_decimals: 0
  force_update: NO
  device_class: ''
  state_class: STATE_CLASS_MEASUREMENT
  legacy_last_reset_type: LAST_RESET_NONE
  disabled_by_default: NO
  entity_category: E
[21:30:00][VV][api.service:132]: send_list_entities_sensor_response: ListEntitiesSensorResponse {
  object_id: 'livingroom_bme680_co2_equivalent'
  key: 3781212468
  name: 'LivingRoom_BME680_CO2_Equivalent'
  unique_id: 'tvledlightsensorlivingroom_bme680_co2_equivalent'
  icon: 'mdi:test-tube'
  unit_of_measurement: 'ppm'
  accuracy_decimals: 1
  force_update: NO
  device_class: ''
  state_class: STATE_CLASS_MEASUREMENT
  legacy_last_reset_type: LAST_RESET_NONE
  disable
[21:30:00][VV][api.service:132]: send_list_entities_sensor_response: ListEntitiesSensorResponse {
  object_id: 'livingroom_bme680_breath_voc_equivalent'
  key: 3414626815
  name: 'LivingRoom_BME680_Breath_VOC_Equivalent'
  unique_id: 'tvledlightsensorlivingroom_bme680_breath_voc_equivalent'
  icon: 'mdi:test-tube'
  unit_of_measurement: 'ppm'
  accuracy_decimals: 1
  force_update: NO
  device_class: ''
  state_class: STATE_CLASS_MEASUREMENT
  legacy_last_reset_type: LAST
[21:30:00][VV][api.service:148]: send_list_entities_switch_response: ListEntitiesSwitchResponse {
  object_id: 'tvledlight_restart'
  key: 4076782158
  name: 'TVLedLight Restart'
  unique_id: 'tvledlightswitchtvledlight_restart'
  icon: 'mdi:restart'
  assumed_state: NO
  disabled_by_default: NO
  entity_category: ENTITY_CATEGORY_CONFIG
  device_class: ''
}
[21:30:00][VV][api.service:055]: send_list_entities_done_response: ListEntitiesDoneResponse {}
[21:30:00][VV][api.service:733]: on_subscribe_states_request: SubscribeStatesRequest {}
[21:30:00][VV][api.service:795]: on_subscribe_homeassistant_services_request: SubscribeHomeassistantServicesRequest {}
[21:30:00][VV][api.service:070]: send_binary_sensor_state_response: BinarySensorStateResponse {
  key: 3763940279
  state: YES
  missing_state: NO
}
[21:30:00][VV][api.service:822]: on_subscribe_home_assistant_states_request: SubscribeHomeAssistantStatesRequest {}
[21:30:00][VV][api.service:191]: send_subscribe_home_assistant_state_response: SubscribeHomeAssistantStateResponse {
  entity_id: 'sensor.percentage_light'
  attribute: ''
  once: NO
}
[21:30:00][VV][api.service:140]: send_sensor_state_response: SensorStateResponse {
  key: 806464930
  state: -48
  missing_state: NO
}
[21:30:00][VV][api.service:140]: send_sensor_state_response: SensorStateResponse {
  key: 722483027
  state: nan
  missing_state: YES
}
[21:30:00][VV][api.service:831]: on_home_assistant_state_response: HomeAssistantStateResponse {
  entity_id: 'sensor.percentage_light'
  state: '30.0'
  attribute: ''
}
[21:30:00][D][homeassistant.sensor:024]: 'sensor.percentage_light': Got state 30.00
[21:30:00][V][sensor:043]: 'id_kitchenled_percentage_from_ha': Received new state 30.000000
[21:30:00][D][sensor:093]: 'id_kitchenled_percentage_from_ha': Sending state 30.00000  with 1 decimals of accuracy
[21:30:00][VV][api.service:140]: send_sensor_state_response: SensorStateResponse {
  key: 4136055770
  state: nan
  missing_state: YES
}
[21:30:00][VV][api.service:140]: send_sensor_state_response: SensorStateResponse {
  key: 925142604
  state: nan
  missing_state: YES
}
[21:30:00][VV][api.service:140]: send_sensor_state_response: SensorStateResponse {
  key: 2542394750
  state: nan
  missing_state: YES
}
[21:30:00][VV][api.service:140]: send_sensor_state_response: SensorStateResponse {
  key: 2929189154
  state: nan
  missing_state: YES
}
[21:30:00][VV][api.service:140]: send_sensor_state_response: SensorStateResponse {
  key: 3781212468
  state: nan
  missing_state: YES
}
[21:30:00][VV][api.service:140]: send_sensor_state_response: SensorStateResponse {
  key: 3414626815
  state: nan
  missing_state: YES
}
[21:30:00][VV][api.service:156]: send_switch_state_response: SwitchStateResponse {
  key: 4076782158
  state: NO
}
[21:30:02][V][bme68x_bsec2.sensor:214]: Performing sensor run
[21:30:02][VV][bme68x_bsec2_i2c.sensor:036]: read_bytes_wrapper: reg = 113
[21:30:02][VV][i2c.arduino:176]: 0x77 TX 71
[21:30:02][VV][i2c.arduino:202]: TX failed: not acknowledged: 2
[21:30:02][VV][bme68x_bsec2_i2c.sensor:036]: read_bytes_wrapper: reg = 116
[21:30:02][VV][i2c.arduino:176]: 0x77 TX 74
[21:30:02][VV][i2c.arduino:148]: 0x77 RX 00
[21:30:02][VV][bme68x_bsec2_i2c.sensor:036]: read_bytes_wrapper: reg = 116
[21:30:02][VV][i2c.arduino:176]: 0x77 TX 74
[21:30:02][VV][i2c.arduino:148]: 0x77 RX 00
[21:30:02][VV][bme68x_bsec2_i2c.sensor:036]: read_bytes_wrapper: reg = 113
[21:30:02][VV][i2c.arduino:176]: 0x77 TX 71
[21:30:02][VV][i2c.arduino:148]: 0x77 RX 0000000000
[21:30:02][VV][bme68x_bsec2_i2c.sensor:042]: write_bytes_wrapper: reg = 113
[21:30:02][VV][i2c.arduino:176]: 0x77 TX 71007201730074547520
[21:30:02][VV][bme68x_bsec2_i2c.sensor:036]: read_bytes_wrapper: reg = 116
[21:30:02][VV][i2c.arduino:176]: 0x77 TX 74
[21:30:02][VV][i2c.arduino:148]: 0x77 RX 54
[21:30:02][VV][bme68x_bsec2_i2c.sensor:042]: write_bytes_wrapper: reg = 116
[21:30:02][VV][i2c.arduino:176]: 0x77 TX 7455
[21:30:02][VV][bme68x_bsec2_i2c.sensor:036]: read_bytes_wrapper: reg = 116
[21:30:02][VV][i2c.arduino:176]: 0x77 TX 74
[21:30:02][VV][i2c.arduino:202]: TX failed: not acknowledged: 2
[21:30:02][VV][bme68x_bsec2_i2c.sensor:036]: read_bytes_wrapper: reg = 116
[21:30:02][VV][i2c.arduino:176]: 0x77 TX 74
[21:30:02][VV][i2c.arduino:148]: 0x77 RX 00
[21:30:02][VV][bme68x_bsec2_i2c.sensor:042]: write_bytes_wrapper: reg = 116
[21:30:02][VV][i2c.arduino:176]: 0x77 TX 7401
[21:30:02][V][bme68x_bsec2.sensor:243]: Using forced mode
[21:30:02][V][bme68x_bsec2.sensor:275]: Queueing read in 42590us
[21:30:02][VV][scheduler:032]: set_timeout(name='read', timeout=42)
[21:30:02][W][component:237]: Component bme68x_bsec2 took a long time for an operation (155 ms).
[21:30:02][W][component:238]: Components should block for at most 30 ms.
[21:30:02][VV][scheduler:225]: Running timeout 'read' with interval=42 last_execution=29808 (now=29850)
[21:30:02][V][bme68x_bsec2.sensor:284]: Reading data
[21:30:02][VV][bme68x_bsec2_i2c.sensor:036]: read_bytes_wrapper: reg = 116
[21:30:02][VV][i2c.arduino:176]: 0x77 TX 74
[21:30:02][VV][i2c.arduino:148]: 0x77 RX 00
[21:30:02][V][bme68x_bsec2.sensor:291]: Still in sleep mode, doing nothing
[21:30:05][V][bme68x_bsec2.sensor:214]: Performing sensor run
[21:30:05][VV][bme68x_bsec2_i2c.sensor:036]: read_bytes_wrapper: reg = 113
[21:30:05][VV][i2c.arduino:176]: 0x77 TX 71
[21:30:05][VV][i2c.arduino:202]: TX failed: not acknowledged: 2
[21:30:05][VV][bme68x_bsec2_i2c.sensor:036]: read_bytes_wrapper: reg = 116
[21:30:05][VV][i2c.arduino:176]: 0x77 TX 74
[21:30:05][VV][i2c.arduino:148]: 0x77 RX 00
[21:30:05][VV][bme68x_bsec2_i2c.sensor:036]: read_bytes_wrapper: reg = 116
[21:30:05][VV][i2c.arduino:176]: 0x77 TX 74
[21:30:05][VV][i2c.arduino:148]: 0x77 RX 00
[21:30:05][VV][bme68x_bsec2_i2c.sensor:036]: read_bytes_wrapper: reg = 113
[21:30:05][VV][i2c.arduino:176]: 0x77 TX 71
[21:30:05][VV][i2c.arduino:148]: 0x77 RX 0000000000
[21:30:05][VV][bme68x_bsec2_i2c.sensor:042]: write_bytes_wrapper: reg = 113
[21:30:05][VV][i2c.arduino:176]: 0x77 TX 71007201730074547520
[21:30:05][VV][bme68x_bsec2_i2c.sensor:036]: read_bytes_wrapper: reg = 116
[21:30:05][VV][i2c.arduino:176]: 0x77 TX 74
[21:30:05][VV][i2c.arduino:148]: 0x77 RX 54
[21:30:05][VV][bme68x_bsec2_i2c.sensor:042]: write_bytes_wrapper: reg = 116
[21:30:05][VV][i2c.arduino:176]: 0x77 TX 7455
[21:30:05][VV][bme68x_bsec2_i2c.sensor:036]: read_bytes_wrapper: reg = 116
[21:30:05][VV][i2c.arduino:176]: 0x77 TX 74
[21:30:05][VV][i2c.arduino:202]: TX failed: not acknowledged: 2
[21:30:05][VV][bme68x_bsec2_i2c.sensor:036]: read_bytes_wrapper: reg = 116
[21:30:05][VV][i2c.arduino:176]: 0x77 TX 74
[21:30:05][VV][i2c.arduino:148]: 0x77 RX 00
[21:30:05][VV][bme68x_bsec2_i2c.sensor:042]: write_bytes_wrapper: reg = 116
[21:30:05][VV][i2c.arduino:176]: 0x77 TX 7401
[21:30:05][V][bme68x_bsec2.sensor:243]: Using forced mode
[21:30:05][V][bme68x_bsec2.sensor:275]: Queueing read in 42590us
[21:30:05][VV][scheduler:032]: set_timeout(name='read', timeout=42)
[21:30:05][W][component:237]: Component bme68x_bsec2 took a long time for an operation (157 ms).
[21:30:05][W][component:238]: Components should block for at most 30 ms.
[21:30:05][VV][scheduler:225]: Running timeout 'read' with interval=42 last_execution=32810 (now=32853)
[21:30:05][V][bme68x_bsec2.sensor:284]: Reading data
[21:30:05][VV][bme68x_bsec2_i2c.sensor:036]: read_bytes_wrapper: reg = 116
[21:30:05][VV][i2c.arduino:176]: 0x77 TX 74
[21:30:05][VV][i2c.arduino:148]: 0x77 RX 00
[21:30:05][V][bme68x_bsec2.sensor:291]: Still in sleep mode, doing nothing
[21:30:08][V][bme68x_bsec2.sensor:214]: Performing sensor run
[21:30:08][VV][bme68x_bsec2_i2c.sensor:036]: read_bytes_wrapper: reg = 113
[21:30:08][VV][i2c.arduino:176]: 0x77 TX 71
[21:30:08][VV][i2c.arduino:202]: TX failed: not acknowledged: 2
[21:30:08][VV][bme68x_bsec2_i2c.sensor:036]: read_bytes_wrapper: reg = 116
[21:30:08][VV][i2c.arduino:176]: 0x77 TX 74
[21:30:08][VV][i2c.arduino:148]: 0x77 RX 00
[21:30:08][VV][bme68x_bsec2_i2c.sensor:036]: read_bytes_wrapper: reg = 116
[21:30:08][VV][i2c.arduino:176]: 0x77 TX 74
[21:30:08][VV][i2c.arduino:148]: 0x77 RX 00
[21:30:08][VV][bme68x_bsec2_i2c.sensor:036]: read_bytes_wrapper: reg = 113
[21:30:08][VV][i2c.arduino:176]: 0x77 TX 71
[21:30:08][VV][i2c.arduino:148]: 0x77 RX 0000000000
[21:30:08][VV][bme68x_bsec2_i2c.sensor:042]: write_bytes_wrapper: reg = 113
[21:30:08][VV][i2c.arduino:176]: 0x77 TX 71007201730074547520
[21:30:08][VV][bme68x_bsec2_i2c.sensor:036]: read_bytes_wrapper: reg = 116
[21:30:08][VV][i2c.arduino:176]: 0x77 TX 74
[21:30:08][VV][i2c.arduino:148]: 0x77 RX 54
[21:30:08][VV][bme68x_bsec2_i2c.sensor:042]: write_bytes_wrapper: reg = 116
[21:30:08][VV][i2c.arduino:176]: 0x77 TX 7455
[21:30:08][VV][bme68x_bsec2_i2c.sensor:036]: read_bytes_wrapper: reg = 116
[21:30:08][VV][i2c.arduino:176]: 0x77 TX 74
[21:30:08][VV][i2c.arduino:202]: TX failed: not acknowledged: 2
[21:30:08][VV][bme68x_bsec2_i2c.sensor:036]: read_bytes_wrapper: reg = 116
[21:30:08][VV][i2c.arduino:176]: 0x77 TX 74
[21:30:08][VV][i2c.arduino:148]: 0x77 RX 00
[21:30:08][VV][bme68x_bsec2_i2c.sensor:042]: write_bytes_wrapper: reg = 116
[21:30:08][VV][i2c.arduino:176]: 0x77 TX 7401
[21:30:08][V][bme68x_bsec2.sensor:243]: Using forced mode
[21:30:08][V][bme68x_bsec2.sensor:275]: Queueing read in 42590us
[21:30:08][VV][scheduler:032]: set_timeout(name='read', timeout=42)

Any idea ?
where can I look for information ?

thank you

Hey, unfortunately I can’t help. Can you post the yaml you used? maybe there’s something wrong there.

After several weeks of use in my BME680 I can tell you that sometimes it stucks with a flat line of reading and after a while it reboots itself. I don’t know what’s happening, but it simply come back online. I think it’s because I haven’t connected the 2 missing pins, but I never managed to make it work with them connected.

BTW my readings are consistent with an IKEA sensor and 1 other temperature sensor (including an analog one). It’s possible you have a faulty component

Here is my YAML

it is basically a D1 mini 8266 that controls 2 LED Strips.
I have added the BME680

thank you for you time

esphome:
  name: tvledlight
  platform: ESP8266
  board: d1_mini
  platformio_options:
    build_flags:
      - -DPIO_FRAMEWORK_ARDUINO_MMU_CACHE16_IRAM48_SECHEAP_SHARED


wifi:
  ssid: "XXXXX"
  password: "XXXXX"

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "TV Led Light"
    password: "XXXXXX"

#web_server:
#  port: 80

#captive_portal:

# Enable logging
logger:
#  level: VERY_VERBOSE

debug:

# Enable Home Assistant API
api:
  encryption:
    key: XXXXXXXXXXXx

ota:
  - platform: esphome
    id: my_ota
    password: "XXXX"

i2c:
#    sda: GPIO5
#    scl: GPIO4
#    scan: True
#    frequency: 8khz

bme68x_bsec2_i2c:
  address: 0x77
  model: bme680
  operating_age: 28d
  sample_rate: LP
  supply_voltage: 3.3V
    
binary_sensor:
  - platform: status
    name: "TVLedLight_Status"

sensor:
  - platform: wifi_signal
    name: "TVLedLight Wifi"

  - platform: homeassistant
    id: "id_kitchenled_percentage_from_ha"
    entity_id: sensor.percentage_light

  - platform: bme68x_bsec2
    temperature:
      name: "LivingRoom_BME680_Temperature"
    pressure:
      name: "LivingRoom_BME680_Pressure"
    humidity:
      name: "LivingRoom_BME680_Humidity"
    iaq:
      name: "LivingRoom_BME680_IAQ"
    co2_equivalent:
      name: "LivingRoom_BME680_CO2_Equivalent"
    breath_voc_equivalent:
      name: "LivingRoom_BME680_Breath_VOC_Equivalent"
    gas_resistance:
      name: "LivingRoom_BME680_Gas_Resistance"

switch:
  - platform: restart
    name: "TVLedLight Restart"

light:
  - platform: neopixelbus
    type: GRB
    variant: WS2811
    pin: GPIO15
    num_leds: 212
    name: "TV Led Light"
    id: light_1
    effects:
      - addressable_rainbow:
      - addressable_rainbow:
          name: Rainbow Effect With Custom Values
          speed: 100
          width: 50
      - addressable_color_wipe:
      - addressable_color_wipe:
          name: Color Wipe Effect With Custom Values
          colors:
            - red: 100%
              green: 100%
              blue: 100%
              num_leds: 1
            - red: 0%
              green: 0%
              blue: 0%
              num_leds: 1
          add_led_interval: 100ms
          reverse: False
      - addressable_fireworks:
      - addressable_fireworks:
          name: Fireworks Effect With Custom Values
          update_interval: 32ms
          spark_probability: 10%
          use_random_color: false
          fade_out_rate: 120
      - addressable_scan:
      - addressable_scan:
          name: Scan Effect With Custom Values
          move_interval: 10ms
          scan_width: 10          
      - random:
      - random:
          name: Random Effect With Custom Values
          transition_length: 5s
          update_interval: 7s
      - strobe:
      - strobe:
          name: Strobe Effect With Custom Values
          colors:
            - state: True
              brightness: 100%
              red: 100%
              green: 90%
              blue: 0%
              duration: 500ms
            - state: False
              duration: 250ms
            - state: True
              brightness: 100%
              red: 0%
              green: 100%
              blue: 0%
              duration: 500ms
      - strobe:
          name: Strobe Red
          colors:
            - state: True
              brightness: 100%
              red: 100%
              green: 0%
              blue: 0%
              duration: 50ms
            - state: False
              duration: 50ms             
      - flicker:
      - flicker:
          name: Flicker Effect With Custom Values
          alpha: 95%
          intensity: 1.5%
      - addressable_twinkle:
      - addressable_twinkle:
          name: Twinkle Effect With Custom Values
          twinkle_probability: 5%
          progress_interval: 4ms
      - addressable_flicker:
      - addressable_flicker:
          name: Addressable Flicker Effect With Custom Values
          update_interval: 16ms
          intensity: 5%
      - addressable_lambda:
          name: "Christmas RedGreen"
          update_interval: 1000ms
          lambda: |-
            static int step = 0;
            
            if (step == 0){
              for (int i = 1; i <  it.size(); i+=2) {
                it[i] = light::ESPColor(255, 0, 18);
              }
              for (int i = 0; i <  it.size(); i+=2) {
                it[i] = light::ESPColor(0, 179, 44);
              }
              step = 1;
            } else {
              for (int i = 1; i <  it.size(); i+=2) {
                it[i] = light::ESPColor(0, 179, 44);
              }
              for (int i = 0; i <  it.size(); i+=2) {
                it[i] = light::ESPColor(255, 0, 18);
              }
              step = 0;              
            }
      - addressable_lambda:
          name: "Halloween"
          update_interval: 1000ms

          lambda: |-
            static int duration_on = 500;
            static int duration_off = 500;

            // Randomize durations between 100ms to 1000ms for ON and OFF states
            duration_on = random(100, 1000);
            duration_off = random(100, 1000);

            // Toggle light on and off with random durations
            if (id(light_1).current_values.is_on()) {
              id(light_1).turn_off();
              delay(duration_off);
            } else {
              id(light_1).turn_on().set_brightness(1.0).perform();
              //id(light_1).turn_on();
              //id(light_1).set_brightness(1.0);  // Set to full brightness
              //id(light_1).set_red(1.0);         // Set color to red
              delay(duration_on);
            }
      - addressable_lambda:
          name: "Fire"
          update_interval: 15ms
          lambda: |-
            int Cooling = 55;
            int Sparking = 110;
            static byte heat[188];
            int cooldown;

            // Step 1.  Cool down every cell a little
            for( int i = 0; i < it.size(); i++) {
              cooldown = random(0, ((Cooling * 10) / it.size()) + 2);
        
              if(cooldown>heat[i]) {
                heat[i]=0;
              } else {
                heat[i]=heat[i]-cooldown;
              }
            }
        
            // Step 2.  Heat from each cell drifts 'up' and diffuses a little
            for( int k= it.size() - 1; k >= 2; k--) {
              heat[k] = (heat[k - 1] + heat[k - 2] + heat[k - 2]) / 3;
            }
        
            // Step 3.  Randomly ignite new 'sparks' near the bottom
            if( random(255) < Sparking ) {
              int y = random(7);
              heat[y] = heat[y] + random(160,255);
            }
        
            // Step 4.  Convert heat to LED colors
            for( int Pixel = 0; Pixel < it.size(); Pixel++) {
              // Scale 'heat' down from 0-255 to 0-191
              byte t192 = round((heat[Pixel]/255.0)*191);
        
              // calculate ramp up from
              byte heatramp = t192 & 0x3F; // 0..63
              heatramp <<= 2; // scale up to 0..252
        
              // figure out which third of the spectrum we're in:
              //this is where you can reverse the effect by switching the commented out lines in all 3 places.
              if( t192 > 0x80) {                     // hottest
                //it[it.size() - Pixel - 1] = ESPColor(255, 255, heatramp);
                it[Pixel] = ESPColor(255, 255, heatramp);
              } else if( t192 > 0x40 ) {             // middle
                //it[it.size() - Pixel - 1] = ESPColor(255, heatramp, 0);
                it[Pixel] = ESPColor(255, heatramp, 0);
              } else {                               // coolest
                //it[it.size() - Pixel - 1] = ESPColor(heatramp, 0, 0);
                it[Pixel] = ESPColor(heatramp, 0, 0);
              }
            }            
      - addressable_lambda:
          name: "percentage level"
          lambda: |-
           const int leds_to_use=it.size();  // you can change that if you don't want all the leds to be used

            float percentage = id(id_kitchenled_percentage_from_ha).state;
            if (isnan(percentage)) {
              percentage = 0;
            }
            // number of leds that are drawn with full brightness
            int full_leds = int(leds_to_use*percentage/100.0);
            // set those leds to the current_color of the light
            it.range(0, full_leds) = current_color;

            // if full_leds is not the last led, render a remaining fraction of a led dimmed
            if (full_leds < leds_to_use) {
              it[full_leds] = current_color*((leds_to_use*percentage/100.0-full_leds)*255);
            }

            // set the remaing leds to black
            if (full_leds+1 < leds_to_use) {
              it.range(full_leds+1, leds_to_use) = ESPColor::BLACK; // change the color to something else if you want
            }

  - platform: partition
    name: "Section1"
    segments:
      - id: light_1
        from: 0
        to: 49
    effects:
      - addressable_rainbow:
          name: Rainbow
      - addressable_twinkle:

  - platform: partition
    name: "Section2"
    segments:
      - id: light_1
        from: 50
        to: 106
    effects:
      - addressable_rainbow:
          name: Rainbow
      - addressable_twinkle:


  - platform: partition
    name: "Section3"
    segments:
      - id: light_1
        from: 107
        to: 154
    effects:
      - addressable_rainbow:
          name: Rainbow
      - addressable_twinkle:


  - platform: partition
    name: "Section4"
    segments:
      - id: light_1
        from: 155
        to: 211
    effects:
      - addressable_rainbow:
          name: Rainbow
      - addressable_twinkle:

  - platform: neopixelbus
    type: GRB
    variant: WS2811
    pin: GPIO2
    num_leds: 69
    name: "TV Led Light Bottom"
    effects:
      - addressable_rainbow:
      - addressable_rainbow:
          name: Rainbow Effect With Custom Values
          speed: 100
          width: 50
      - addressable_color_wipe:
      - addressable_color_wipe:
          name: Color Wipe Effect With Custom Values
          colors:
            - red: 100%
              green: 100%
              blue: 100%
              num_leds: 1
            - red: 0%
              green: 0%
              blue: 0%
              num_leds: 1
          add_led_interval: 100ms
          reverse: False
      - addressable_fireworks:
      - addressable_fireworks:
          name: Fireworks Effect With Custom Values
          update_interval: 32ms
          spark_probability: 10%
          use_random_color: false
          fade_out_rate: 120
      - addressable_scan:
      - addressable_scan:
          name: Scan Effect With Custom Values
          move_interval: 10ms
          scan_width: 10          
      - random:
      - random:
          name: Random Effect With Custom Values
          transition_length: 5s
          update_interval: 7s
      - strobe:
      - strobe:
          name: Strobe Effect With Custom Values
          colors:
            - state: True
              brightness: 100%
              red: 100%
              green: 90%
              blue: 0%
              duration: 500ms
            - state: False
              duration: 250ms
            - state: True
              brightness: 100%
              red: 0%
              green: 100%
              blue: 0%
              duration: 500ms
      - strobe:
          name: Strobe Red
          colors:
            - state: True
              brightness: 100%
              red: 100%
              green: 0%
              blue: 0%
              duration: 50ms
            - state: False
              duration: 50ms             
      - flicker:
      - flicker:
          name: Flicker Effect With Custom Values
          alpha: 95%
          intensity: 1.5%
      - addressable_twinkle:
      - addressable_twinkle:
          name: Twinkle Effect With Custom Values
          twinkle_probability: 5%
          progress_interval: 4ms
      - addressable_flicker:
      - addressable_flicker:
          name: Addressable Flicker Effect With Custom Values
          update_interval: 16ms
          intensity: 5%
      - addressable_lambda:
          name: "Christmas RedGreen"
          update_interval: 1000ms
          lambda: |-
            static int step = 0;
            
            if (step == 0){
              for (int i = 1; i <  it.size(); i+=2) {
                it[i] = light::ESPColor(255, 0, 18);
              }
              for (int i = 0; i <  it.size(); i+=2) {
                it[i] = light::ESPColor(0, 179, 44);
              }
              step = 1;
            } else {
              for (int i = 1; i <  it.size(); i+=2) {
                it[i] = light::ESPColor(0, 179, 44);
              }
              for (int i = 0; i <  it.size(); i+=2) {
                it[i] = light::ESPColor(255, 0, 18);
              }
              step = 0;              
            }
      - addressable_lambda:
          name: "Fire"
          update_interval: 15ms
          lambda: |-
            int Cooling = 55;
            int Sparking = 110;
            static byte heat[188];
            int cooldown;

            // Step 1.  Cool down every cell a little
            for( int i = 0; i < it.size(); i++) {
              cooldown = random(0, ((Cooling * 10) / it.size()) + 2);
        
              if(cooldown>heat[i]) {
                heat[i]=0;
              } else {
                heat[i]=heat[i]-cooldown;
              }
            }
        
            // Step 2.  Heat from each cell drifts 'up' and diffuses a little
            for( int k= it.size() - 1; k >= 2; k--) {
              heat[k] = (heat[k - 1] + heat[k - 2] + heat[k - 2]) / 3;
            }
        
            // Step 3.  Randomly ignite new 'sparks' near the bottom
            if( random(255) < Sparking ) {
              int y = random(7);
              heat[y] = heat[y] + random(160,255);
            }
        
            // Step 4.  Convert heat to LED colors
            for( int Pixel = 0; Pixel < it.size(); Pixel++) {
              // Scale 'heat' down from 0-255 to 0-191
              byte t192 = round((heat[Pixel]/255.0)*191);
        
              // calculate ramp up from
              byte heatramp = t192 & 0x3F; // 0..63
              heatramp <<= 2; // scale up to 0..252
        
              // figure out which third of the spectrum we're in:
              //this is where you can reverse the effect by switching the commented out lines in all 3 places.
              if( t192 > 0x80) {                     // hottest
                //it[it.size() - Pixel - 1] = ESPColor(255, 255, heatramp);
                it[Pixel] = ESPColor(255, 255, heatramp);
              } else if( t192 > 0x40 ) {             // middle
                //it[it.size() - Pixel - 1] = ESPColor(255, heatramp, 0);
                it[Pixel] = ESPColor(255, heatramp, 0);
              } else {                               // coolest
                //it[it.size() - Pixel - 1] = ESPColor(heatramp, 0, 0);
                it[Pixel] = ESPColor(heatramp, 0, 0);
              }
            }            
      - addressable_lambda:
          name: "percentage level"
          lambda: |-
           const int leds_to_use=it.size();  // you can change that if you don't want all the leds to be used

            float percentage = id(id_kitchenled_percentage_from_ha).state;
            if (isnan(percentage)) {
              percentage = 0;
            }
            // number of leds that are drawn with full brightness
            int full_leds = int(leds_to_use*percentage/100.0);
            // set those leds to the current_color of the light
            it.range(0, full_leds) = current_color;

            // if full_leds is not the last led, render a remaining fraction of a led dimmed
            if (full_leds < leds_to_use) {
              it[full_leds] = current_color*((leds_to_use*percentage/100.0-full_leds)*255);
            }

            // set the remaing leds to black
            if (full_leds+1 < leds_to_use) {
              it.range(full_leds+1, leds_to_use) = ESPColor::BLACK; // change the color to something else if you want
            }