SCD30 "Measurement Initialization failed!"

I am trying to get an SCD30 sensor to work with ESPHome, but I’m always getting the message “Measurement Initialization failed!”. I got the sensor to work with an Arduino sketch with the same wiring.

Here’s my configuration:

esphome:
  name: scd30
  platform: ESP32
  board: node32s

wifi:
  ssid: "My_SSID"
  password: "My_Password"

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Scd30 Fallback Hotspot"
    password: "GMmhyt6x9z6d"

captive_portal:

# Enable logging
logger:

# Enable Home Assistant API
api:
  password: "some_password"

ota:
  password: "some_password"
  
i2c:
  id: bus_a
  sda: GPIO21
  scl: GPIO22
  scan: True
  frequency: 50kHz

sensor:
  - platform: scd30
    address: 0x61
    i2c_id: bus_a
    automatic_self_calibration: true
    co2:
      name: "Workshop CO2"
      accuracy_decimals: 1
    temperature:
      name: "Workshop Temperature"
      accuracy_decimals: 2
    humidity:
      name: "Workshop Humidity"
      accuracy_decimals: 1
    temperature_offset: 1.5 °C
    update_interval: 5s

Does anyone have an idea what I might be doing wrong?

The same thing happened to me and with this code it worked for me. It really looks the same but this one works.
with voltage at 3.3v

i2c:
  scl: GPIO17
  sda: GPIO16
  scan: True
  id: bus_a

sensor:
  - platform: scd30
    co2:
      name: "SCD30 CO2"
      accuracy_decimals: 1
    temperature:
      name: "SCD30 Temperature"
      accuracy_decimals: 1
    humidity:
      name: "SCD30 Humidity"
      accuracy_decimals: 1
    address: 0x61
    update_interval: 5s

Did you ever get this to work with an ESP32? I doesn’t work for me, only on the 8266.

Did you ever get this to work with an ESP32?

I did, but honestly I don’t remember what I did differently than before. It seemed to just suddenly work.
Anyway, here’s my working yaml (I’m using an ESP32 NodeMCU):

esphome:
  name: climate
  platform: ESP32
  board: node32s

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_pw

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Scd30 Fallback Hotspot"
    password: "GMmhyt6x9z6d"

captive_portal:

# Enable logging
logger:
  level: VERY_VERBOSE

# Enable Home Assistant API
api:
  password: !secret esp_api_pw

ota:
  password: !secret esp_ota_pw
  
i2c:
  id: bus_a
  sda: GPIO21
  scl: GPIO22
  scan: True
  frequency: 50kHz

sensor:
  - platform: scd30
    address: 0x61
    i2c_id: bus_a
    automatic_self_calibration: true
    co2:
      name: "CO2"
      accuracy_decimals: 1
    temperature:
      name: "Temperature"
      accuracy_decimals: 2
    humidity:
      name: "Humidity"
      accuracy_decimals: 1
    temperature_offset: 1.5 °C
    update_interval: 10s

As I remember it, it worked after I changed the log level to VERY_VERBOSE, but that doesn’t make any sense, so I must have changed something else.

Hm, ok… Thanks for the input!

same problem

I’m using ESP32 NodeMCU

i2c:
  id: bus_a
  sda: GPIO21
  scl: GPIO22
  scan: True
  frequency: 50kHz
 - platform: scd30
    address: 0x61
    i2c_id: bus_a
    automatic_self_calibration: true
    co2:
      name: "CO2"
      accuracy_decimals: 1
    temperature:
      name: "Temperature"
      accuracy_decimals: 2
    humidity:
      name: "Humidity"
      accuracy_decimals: 1
    temperature_offset: 1.5 °C
    update_interval: 10s

I have this error :

[I][i2c:033]: Scanning i2c bus for active devices...
[I][i2c:040]: Found i2c device at address 0x61
[W][scd30:089]: Measurement Initialization failed!

After search :

i2c:
  id: bus_a
  scan: True
- platform: scd30
    automatic_self_calibration: true

And it work !!

Problem is :

temperature_offset: 1.5 °C

Dont have solution to conserve this parameter…

Now my yaml :

i2c:
  id: bus_a
  scan: True
  - platform: scd30
    automatic_self_calibration: true
    co2:
      name: "co2"
      accuracy_decimals: 1
    temperature:
      name: "temperature"
      accuracy_decimals: 2
    humidity:
      name: "humidity"
      accuracy_decimals: 1
#     temperature_offset: 1.5 °C
    update_interval: 300s

For those who’d run into the same issue - as I did - IDK whether temperature_offset is supported at all, or erroneously present in the docs, but there is another way around.
SCD30 component is based on the sensor platform which provides a generic way to post-process values - Sensor Filter.
This works like a charm and my config looks like this now:

sensor:
  - platform: scd30
    i2c_id: bus_a
    co2:
      name: "Basement CO2"
      accuracy_decimals: 1
    temperature:
      name: "Basement Temperature"
      accuracy_decimals: 2
      filters:
        - offset: -3.0
    humidity:
      name: "Basement Humidity"
      accuracy_decimals: 1
    update_interval: 60s

I don’t know from which version of HA, but this issue (temperature_offset breaking SCD30) is now fixed. Putting in an offset lowers the temperature reading from the sensor.

I don’t know why it would be any better than just using the offset filter as suggested above though, so this sensor specific setting seems pretty redundant?