grabowski 7498c34340 Add retry logic for NC read and better logging
- Retry NC read up to 3 times with delays
- Log product name detection
- Check if SEN66 is detected

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-01 11:22:29 +07:00

ESPHome SEN6x Component

ESPHome external component for Sensirion SEN66 environmental sensor with support for PM, VOC, NOx, CO2, Temperature, and Humidity.

Features

  • Particulate Matter: PM1.0, PM2.5, PM4.0, PM10 (differential values per size range)
  • Number Concentration: Particle counts for 0.5µm, 1µm, 2.5µm, 4µm, 10µm
  • VOC Index: With algorithm tuning support
  • NOx Index: With algorithm tuning support
  • CO2: Carbon dioxide measurement (SEN66 feature)
  • Temperature & Humidity: Built-in environmental monitoring
  • Actions: Start/stop measurement, fan cleaning

Installation

Add to your ESPHome configuration:

external_components:
  - source:
      type: git
      url: https://github.com/YOUR_USERNAME/esphome-sen6x
      ref: main
    components: [sen6x]

Usage

i2c:
  sda: GPIO33
  scl: GPIO5

sensor:
  - platform: sen6x
    id: sen66
    address: 0x6B
    update_interval: 10s

    pm_1_0:
      name: "PM 1.0"
    pm_2_5:
      name: "PM 2.5"
    pm_4_0:
      name: "PM 4.0"
    pm_10_0:
      name: "PM 10"

    temperature:
      name: "Temperature"
    humidity:
      name: "Humidity"

    voc:
      name: "VOC Index"
      algorithm_tuning:
        index_offset: 100
        learning_time_offset_hours: 12
        learning_time_gain_hours: 12
        gating_max_duration_minutes: 180
        std_initial: 50
        gain_factor: 230

    nox:
      name: "NOx Index"

    co2:
      name: "CO2"

    # Optional: Number concentration sensors
    number_concentration_0_5:
      name: "Particles ≤0.5µm"
    number_concentration_1_0:
      name: "Particles ≤1µm"
    number_concentration_2_5:
      name: "Particles ≤2.5µm"
    number_concentration_4_0:
      name: "Particles ≤4µm"
    number_concentration_10_0:
      name: "Particles ≤10µm"

Actions

Start/Stop Measurement

button:
  - platform: template
    name: "Stop Measurement"
    on_press:
      - sen6x.stop_measurement: sen66

  - platform: template
    name: "Start Measurement"
    on_press:
      - sen6x.start_measurement: sen66

Fan Cleaning

button:
  - platform: template
    name: "Fan Cleaning"
    on_press:
      - sen6x.stop_measurement: sen66
      - delay: 1.5s
      - sen6x.start_fan_cleaning: sen66
      - delay: 30s
      - sen6x.start_measurement: sen66

Configuration Variables

Main Configuration

  • id (Optional, ID): Component ID for reference in automations
  • address (Optional, int): I2C address. Default: 0x6B
  • update_interval (Optional, Time): Sensor update interval. Default: 60s
  • store_baseline (Optional, boolean): Store VOC baseline to flash. Default: true

Sensor Configuration

All sensors are optional. Each sensor supports standard ESPHome sensor options.

PM Sensors

  • pm_1_0: PM1.0 concentration (µg/m³)
  • pm_2_5: PM2.5 concentration (µg/m³)
  • pm_4_0: PM4.0 concentration (µg/m³)
  • pm_10_0: PM10 concentration (µg/m³)

Number Concentration Sensors

  • number_concentration_0_5: Particles ≤0.5µm (p/cm³)
  • number_concentration_1_0: Particles ≤1.0µm (p/cm³)
  • number_concentration_2_5: Particles ≤2.5µm (p/cm³)
  • number_concentration_4_0: Particles ≤4.0µm (p/cm³)
  • number_concentration_10_0: Particles ≤10µm (p/cm³)

Gas Sensors

  • voc: VOC Index (1-500)
  • nox: NOx Index (1-500)
  • co2: CO2 concentration (ppm)

Environmental Sensors

  • temperature: Temperature (°C)
  • humidity: Relative humidity (%)

Algorithm Tuning (VOC/NOx)

algorithm_tuning:
  index_offset: 100          # 1-250, default: 100
  learning_time_offset_hours: 12  # 1-1000, default: 12
  learning_time_gain_hours: 12    # 1-1000, default: 12
  gating_max_duration_minutes: 720  # 0-3000, default: 720
  std_initial: 50            # default: 50
  gain_factor: 230           # 1-1000, default: 230

Supported Sensors

Sensor PM VOC NOx CO2 T/H
SEN66

License

MIT License - Based on work by @martgras

Description
No description provided
Readme 70 KiB
Languages
C++ 68.5%
Python 31.5%