NodeMCU: No sensor values from Si7021 (i2c appears to work)

Hello guys,

I am stuck with my Si7021 i2c sensor on my NodeMCU V3 (“LoLin new NodeMcu V3”) as the i2c connection appears to work but there are no sensor values coming.

3.3V – Connected to 3v on nodemcu
GND – Connected to GND pin on nodemcu
SDA – Connected to D2 on nodemcu
SCL – Connected to D1 on nodemcu

esphome:
  name: test-si7021

esp8266:
  board: nodemcuv2

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: "***"

ota:
  password: "***"

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

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Test-Si7021 Fallback Hotspot"
    password: "***"

captive_portal:

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

sensor:
  - platform: htu21d
    i2c_id: htu_21d
    temperature:
      name: "sensor.temperatur.test"
    humidity:
      name: "sensor.feuchtigkeit.test"
    update_interval: 60s

This is what I keep getting. I replaced the Si7021 as well as the NodeMCU and the error remains the same. What is strange to me is that the i2c scan finds the device so that I am not sure whether the sensor is the issue or it is rather the nodemcu. The cable length is about 15cm (standard jumper wires).

[20:39:25][C][logger:277]:   Log Baud Rate: 115200
[20:39:25][C][logger:278]:   Hardware UART: UART0
[20:39:25][C][i2c.arduino:038]: I2C Bus:
[20:39:25][C][i2c.arduino:039]:   SDA Pin: GPIO4
[20:39:25][C][i2c.arduino:040]:   SCL Pin: GPIO5
[20:39:25][C][i2c.arduino:041]:   Frequency: 50000 Hz
[20:39:25][C][i2c.arduino:044]:   Recovery: bus successfully recovered
[20:39:25][I][i2c.arduino:054]: Results from i2c bus scan:
[20:39:25][I][i2c.arduino:060]: Found i2c device at address 0x40
[20:39:25][C][htu21d:028]: HTU21D:
[20:39:25][C][htu21d:029]:   Address: 0x40
[20:39:25][C][htu21d:033]:   Update Interval: 60.0s
[20:39:25][C][htu21d:034]:   Temperature 'sensor.temperatur'
[20:39:25][C][htu21d:034]:     Device Class: 'temperature'
[20:39:25][C][htu21d:034]:     State Class: 'measurement'
[20:39:25][C][htu21d:034]:     Unit of Measurement: '°C'
[20:39:25][C][htu21d:034]:     Accuracy Decimals: 1
[20:39:25][C][htu21d:035]:   Humidity 'sensor.feuchtigkeit'
[20:39:25][C][htu21d:035]:     Device Class: 'humidity'
[20:39:25][C][htu21d:035]:     State Class: 'measurement'
[20:39:25][C][htu21d:035]:     Unit of Measurement: '%'
[20:39:25][C][htu21d:035]:     Accuracy Decimals: 1
[20:39:26][C][captive_portal:088]: Captive Portal:
[20:39:26][C][mdns:094]: mDNS:
[20:39:26][C][mdns:095]:   Hostname: sensor-multi-buero
[20:39:26][C][ota:089]: Over-The-Air Updates:
[20:39:26][C][ota:090]:   Address: 10.10.50.91:8266
[20:39:26][C][ota:093]:   Using Password.
[20:39:26][C][api:138]: API Server:
[20:39:26][C][api:139]:   Address: 10.10.50.91:6053
[20:39:26][C][api:141]:   Using noise encryption: YES
[20:39:39][D][api:102]: Accepted 10.10.10.30
[20:39:39][D][api.connection:861]: Home Assistant 2022.9.6 (10.10.10.30): Connected successfully

Any ideas? :frowning:

Anyone having an idea? :sweat_smile: It’s not „NaN“ or Null, there is literally nothing being sent…

Good day! I have the same problem. c-platform: htu21d.
The sensor is clearly present but there is no indication. I tried with different models of HTU21D, Si7021 and SHT21 sensors, a very unpleasant problem, since everything worked before. does anyone know the reason?

I am having this same issue with 2 different HTU21D devices. i2c device is detected, but no activity. Did you ever get this figured out?

Долго разбирался с этим. В итоге проблема заключается в ошибках в коде. К сожалению это не лечится исправлением, так как при компиляции происходит замена правленного файла.
Решение было следующим.
Установил сторонние библиотеки для датчика и всё заработало. В ближайшие дни выложу видео с подробным исправлением проблемы.

do you have instructions for what you did? I get an error with a sht21 and esp32. i2cRead returned Error 263

Little late to the party, but I had the same problem. I2C seems fine but no values or errors in the logs.

I’m using an HTU21D sensor from aliexpress and it says SI7021, HTU21D, SHT21, SHT20 and HDC1080 in the back.
When I used HDC1080 as platform it works and I get Temperature and Humidity in Home Assistant
(except for the heater, but maybe thats not even there)

  - platform: hdc1080
    i2c_id: bus_a
    address: 0x40
    temperature:
      name: "HTU21 Temp"
    humidity:
        name: "HTU21 Hum"
#    heater:
#        name: "HTU21 Heater"
    update_interval: 10s