esphome / issues

Issue Tracker for ESPHome
https://esphome.io/
294 stars 38 forks source link

sht3xd not connecting after latest update #5294

Open deanfourie1 opened 11 months ago

deanfourie1 commented 11 months ago

The problem

The sht3xd I2C sensor no longer works on my weather station. This was as a direct result of the latest esphome update.

The sht3xd still shows in the I2C scan.

Which version of ESPHome has the issue?

2023.12.5

What type of installation are you using?

Home Assistant Add-on

Which version of Home Assistant has the issue?

2023.12.3

What platform are you using?

ESP32

Board

ESP32MiniKit

Component causing the issue

sht3xd

Example YAML snippet

esphome:
  name: weather-station
  friendly_name: weather-station

esp32:
  board: esp32dev
  framework:
    type: arduino

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key:

ota:
  password:

i2c:
  sda: 21
  scl: 22
  scan: True

sun:
  latitude:
  longitude:

wifi:
  networks:
  - ssid: !secret wifi_ssid
    password: !secret wifi_password
    bssid: 
  fast_connect: true

  # Optional manual IP
  manual_ip:
    static_ip:
    gateway: 
    subnet: 

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

sensor:

####Wifi Signal Start####
  - platform: wifi_signal # Reports the WiFi signal strength/RSSI in dB
    name: "WiFi Signal dB"
    id: wifi_signal_db
    update_interval: 60s
    entity_category: "diagnostic"

  - platform: copy # Reports the WiFi signal strength in %
    source_id: wifi_signal_db
    name: "WiFi Signal Percent"
    filters:
      - lambda: return min(max(2 * (x + 100.0), 0.0), 100.0);
    unit_of_measurement: "Signal %"
    entity_category: "diagnostic"
####Wifi Signal END###

####Tempreature & Humidity Start####
  - platform: sht3xd
    temperature:
      name: "Temperature"
    humidity:
      name: "Humidity"
    address: 0x44
    update_interval: 60s
####Tempreature & Humidity END####

####Rainfall Start####
  - platform: pulse_counter
    pin:
      # Don't forget to add a pulling resistor, see README
      number: GPIO32
      mode: INPUT
    unit_of_measurement: 'mm'
    name: "${friendly_name} rain gauge"
    icon: 'mdi:weather-rainy'
    id: rain_gauge
    internal: true
    count_mode:
      rising_edge: DISABLE
      falling_edge: INCREMENT
    internal_filter: 13us
    update_interval: 10s
    filters:
      # Each 0.011" (0.2794mm) of rain causes one momentary contact closure
      - multiply: 0.2
    accuracy_decimals: 4

  - platform: integration
    name: "${friendly_name} rainfall per min"
    id: rain_per_min
    time_unit: min
    unit_of_measurement: 'mm'
    icon: 'mdi:weather-rainy'
    sensor: rain_gauge

  - platform: total_daily_energy
    name: "${friendly_name} total daily rain"
    power_id: rain_gauge
    unit_of_measurement: 'mm'
    icon: 'mdi:weather-rainy'
    # x60 To convert to aggregated rain amount
    filters:
      - multiply: 60
####Rainfall End####

####Sun Start####
  - platform: sun
    name: "Sun elevation"
    type: elevation
    update_interval: 120s

  - platform: sun
    name: "Sun azimuth"
    type: azimuth
    update_interval: 120s
####Sun End####

####Wind Speed Start####
  - platform: pulse_meter
    pin:
      number: GPIO33
      mode: INPUT
    id: wind_speed
    unit_of_measurement: 'm/s'
    name: "${friendly_name} wind speed"
    icon: 'mdi:weather-windy'
    internal_filter: 13us
    timeout: 5s
    filters:
      - multiply: 0.005560619
      - sliding_window_moving_average:
          window_size: 5
          send_every: 5
####Wind Speed END####

  - platform: copy
    name: '${friendly_name} wind speed average'
    icon: 'mdi:weather-windy'
    id: wind_speed_avg
    source_id: wind_speed
    unit_of_measurement: 'm/s'
    filters:
      - throttle_average: 5s

  - platform: copy
    name: '${friendly_name} wind speed (km/h)'
    id: wind_speed_kmh
    source_id: wind_speed
    unit_of_measurement: 'km/h'
    icon: 'mdi:weather-windy'
    filters:
      - multiply: 3.6

  - platform: copy
    name: '${friendly_name} wind speed average (km/h)'
    icon: 'mdi:weather-windy'
    id: wind_speed_kmh_avg
    source_id: wind_speed_avg
    unit_of_measurement: 'km/h'
    filters:
      - multiply: 3.6
    on_value:
      lambda: |-
        if (x < 1) {
          id(wind_scale_code).publish_state("0");
          id(wind_scale).publish_state("Calm");
        } else if (x >= 1 && x < 6) {
          id(wind_scale_code).publish_state("1");
          id(wind_scale).publish_state("Light Air");
        } else if (x >= 6 && x < 12) {
          id(wind_scale_code).publish_state("2");
          id(wind_scale).publish_state("Light Breeze");
        } else if (x >= 12 && x < 20) {
          id(wind_scale_code).publish_state("3");
          id(wind_scale).publish_state("Gentle Breeze");
        } else if (x >= 20 && x < 29) {
          id(wind_scale_code).publish_state("4");
          id(wind_scale).publish_state("Moderate Breeze");
        } else if (x >= 29 && x < 39) {
          id(wind_scale_code).publish_state("5");
          id(wind_scale).publish_state("Fresh Breeze");
        } else if (x >= 39 && x < 50) {
          id(wind_scale_code).publish_state("6");
          id(wind_scale).publish_state("Strong Breeze");
        } else if (x >= 50 && x < 62) {
          id(wind_scale_code).publish_state("7");
          id(wind_scale).publish_state("Near Gale");
        } else if (x >= 62 && x < 75) {
          id(wind_scale_code).publish_state("8");
          id(wind_scale).publish_state("Gale");
        } else if (x >= 75 && x < 89) {
          id(wind_scale_code).publish_state("9");
          id(wind_scale).publish_state("Severe Gale");
        } else if (x >= 89 && x < 103) {
          id(wind_scale_code).publish_state("10");
          id(wind_scale).publish_state("Storm");
        } else if (x >= 103 && x < 118) {
          id(wind_scale_code).publish_state("11");
          id(wind_scale).publish_state("Violent Storm");
        } else if (x >= 118) {
          id(wind_scale_code).publish_state("12");
          id(wind_scale).publish_state("Hurricane Force");
        } else {
          ESP_LOGD("main", "It shouldn't happen (wind_speed_kmh_avg: %f)", x);
        }

####Wind Direction Start####
  - platform: mlx90393
    address: 0x0c
    id: mlx
    x_axis:
      name: "mlx_x"
      id: "mlx_x"
    y_axis:
      name: "mlx_y"
      id: "mlx_y"
    z_axis:
      name: "mlx_z"
    update_interval: 2s

  - platform: template
    id: 'wind_direction'
    name: 'Wind Direction'
    update_interval: 2s
    lambda: |-
      float w1 = id(mlx_x).state;  // magnetometer X
      float w0 = id(mlx_y).state;  // magnetometer Y
      float w = atan2(w0, w1);     // arctangent2 = radians
      w = (w * 180) / M_PI;    // radians to degrees
      w += 19.50;              // magnetic declination
      w += 68.00;              // seems to be off by 90
      if ( w < 0 ) w += 360.0; // adjust for negatives
      return w;
####END Wind Direction####

####FAN Switch Start####
switch:
  - platform: gpio
    pin: 25
    name: "Fan"
    inverted: True
####Fan Switch END####

####Status LED Start####
light:
  - platform: neopixelbus
    type: GRB
    variant: WS2811
    pin: GPIO23
    num_leds: 1
    name: "Status LED"
####Status LED END####

####Rain Reset Timer Start####
interval:
  - interval: 60s
    then:
      - sensor.integration.reset: rain_per_min
####Rain Reset Timer END####

####Time Start####
time:
  - platform: homeassistant
####Time End####

text_sensor:
  - platform: sun
    name: Sun Next Sunrise
    type: sunrise
  - platform: sun
    name: Sun Next Sunset
    type: sunset

  - platform: template
    name: '${friendly_name} Beaufort wind scale code'
    icon: 'mdi:tailwind'
    id: wind_scale_code

  - platform: template
    name: '${friendly_name} Beaufort wind scale'
    icon: 'mdi:tailwind'
    id: wind_scale
    update_interval: never

Anything in the logs that might be useful for us?

[21:58:36][E][sht3xd:036]: Communication with SHT3xD failed!

INFO ESPHome 2023.12.5
INFO Reading configuration /config/esphome/weather-station.yaml...
INFO Detected timezone 
INFO Starting log output from using esphome API
INFO Successfully connected to weather-station @  in 0.111s
INFO Successful handshake with weather-station @  in 0.107s
[22:02:17][I][app:102]: ESPHome version 2023.12.5 compiled on Dec 26 2023, 21:04:23
[22:02:17][C][wifi:573]: WiFi:
[22:02:17][C][wifi:405]:   Local MAC:
[22:02:17][C][wifi:410]:   SSID: [redacted]
[22:02:17][C][wifi:411]:   IP Address: 
[22:02:17][C][wifi:413]:   BSSID: [redacted]
[22:02:17][C][wifi:414]:   Hostname: 'weather-station'
[22:02:17][C][wifi:416]:   Signal strength: -71 dB ▂▄▆█
[22:02:17][C][wifi:420]:   Channel: 6
[22:02:17][C][wifi:421]:   Subnet: 
[22:02:17][C][wifi:422]:   Gateway: 
[22:02:17][C][wifi:423]:   DNS1: 0.0.0.0
[22:02:17][C][wifi:424]:   DNS2: 0.0.0.0
[22:02:17][C][logger:443]: Logger:
[22:02:17][C][logger:444]:   Level: DEBUG
[22:02:17][C][logger:445]:   Log Baud Rate: 115200
[22:02:17][C][logger:447]:   Hardware UART: UART0
[22:02:17][C][i2c.arduino:053]: I2C Bus:
[22:02:17][C][i2c.arduino:054]:   SDA Pin: GPIO21
[22:02:17][C][i2c.arduino:055]:   SCL Pin: GPIO22
[22:02:17][C][i2c.arduino:056]:   Frequency: 50000 Hz
[22:02:17][C][i2c.arduino:059]:   Recovery: bus successfully recovered
[22:02:17][I][i2c.arduino:069]: Results from i2c bus scan:
[22:02:17][I][i2c.arduino:075]: Found i2c device at address 0x0C
[22:02:17][I][i2c.arduino:075]: Found i2c device at address 0x40
[22:02:17][I][i2c.arduino:075]: Found i2c device at address 0x44
[22:02:17][C][template.sensor:022]: Template Sensor 'Wind Direction'
[22:02:17][C][template.sensor:022]:   State Class: ''
[22:02:17][C][template.sensor:022]:   Unit of Measurement: ''
[22:02:17][C][template.sensor:022]:   Accuracy Decimals: 1
[22:02:17][C][template.sensor:023]:   Update Interval: 2.0s
[22:02:17][C][switch.gpio:068]: GPIO Switch 'Fan'
[22:02:17][C][switch.gpio:076]:   Inverted: YES
[22:02:17][C][switch.gpio:091]:   Restore Mode: always OFF
[22:02:17][C][switch.gpio:031]:   Pin: GPIO25
[22:02:17][C][template.text_sensor:020]: Template Sensor '${friendly_name} Beaufort wind scale code'
[22:02:17][C][template.text_sensor:020]:   Icon: 'mdi:tailwind'
[22:02:17][C][template.text_sensor:020]: Template Sensor '${friendly_name} Beaufort wind scale'
[22:02:17][C][template.text_sensor:020]:   Icon: 'mdi:tailwind'
[22:02:18][C][light:103]: Light 'Status LED'
[22:02:18][C][light:105]:   Default Transition Length: 1.0s
[22:02:18][C][light:106]:   Gamma Correct: 2.80
[22:02:18][C][copy.sensor:015]: Copy Sensor 'WiFi Signal Percent'
[22:02:18][C][copy.sensor:015]:   Device Class: 'signal_strength'
[22:02:18][C][copy.sensor:015]:   State Class: 'measurement'
[22:02:18][C][copy.sensor:015]:   Unit of Measurement: 'Signal %'
[22:02:18][C][copy.sensor:015]:   Accuracy Decimals: 0
[22:02:18][C][sht3xd:033]: SHT3xD:
[22:02:18][C][sht3xd:034]:   Address: 0x44
[22:02:18][E][sht3xd:036]: Communication with SHT3xD failed!
[22:02:18][C][sht3xd:038]:   Update Interval: 60.0s
[22:02:18][C][sht3xd:040]:   Temperature 'Temperature'
[22:02:18][C][sht3xd:040]:     Device Class: 'temperature'
[22:02:18][C][sht3xd:040]:     State Class: 'measurement'
[22:02:18][C][sht3xd:040]:     Unit of Measurement: '°C'
[22:02:18][C][sht3xd:040]:     Accuracy Decimals: 1
[22:02:18][C][sht3xd:041]:   Humidity 'Humidity'
[22:02:18][C][sht3xd:041]:     Device Class: 'humidity'
[22:02:18][C][sht3xd:041]:     State Class: 'measurement'
[22:02:18][C][sht3xd:041]:     Unit of Measurement: '%'
[22:02:18][C][sht3xd:041]:     Accuracy Decimals: 1
[22:02:18][C][pulse_counter:160]: Pulse Counter '${friendly_name} rain gauge'
[22:02:18][C][pulse_counter:160]:   State Class: 'measurement'
[22:02:18][C][pulse_counter:160]:   Unit of Measurement: 'mm'
[22:02:18][C][pulse_counter:160]:   Accuracy Decimals: 4
[22:02:18][C][pulse_counter:160]:   Icon: 'mdi:weather-rainy'
[22:02:18][C][pulse_counter:161]:   Pin: GPIO32
[22:02:18][C][pulse_counter:162]:   Rising Edge: DISABLE
[22:02:18][C][pulse_counter:163]:   Falling Edge: INCREMENT
[22:02:18][C][pulse_counter:164]:   Filtering pulses shorter than 13 µs
[22:02:18][C][pulse_counter:165]:   Update Interval: 10.0s
[22:02:18][C][integration:024]: Integration Sensor '${friendly_name} rainfall per min'
[22:02:18][C][integration:024]:   State Class: ''
[22:02:18][C][integration:024]:   Unit of Measurement: 'mm'
[22:02:18][C][integration:024]:   Accuracy Decimals: 6
[22:02:18][C][integration:024]:   Icon: 'mdi:weather-rainy'
[22:02:18][C][total_daily_energy:023]: Total Daily Energy '${friendly_name} total daily rain'
[22:02:18][C][total_daily_energy:023]:   Device Class: 'energy'
[22:02:18][C][total_daily_energy:023]:   State Class: 'total_increasing'
[22:02:18][C][total_daily_energy:023]:   Unit of Measurement: 'mm'
[22:02:18][C][total_daily_energy:023]:   Accuracy Decimals: 6
[22:02:18][C][total_daily_energy:023]:   Icon: 'mdi:weather-rainy'
[22:02:18][C][sun.sensor:009]: Sun Sensor 'Sun elevation'
[22:02:18][C][sun.sensor:009]:   State Class: ''
[22:02:18][C][sun.sensor:009]:   Unit of Measurement: '°'
[22:02:18][C][sun.sensor:009]:   Accuracy Decimals: 1
[22:02:18][C][sun.sensor:009]:   Icon: 'mdi:weather-sunset'
[22:02:18][C][sun.sensor:009]: Sun Sensor 'Sun azimuth'
[22:02:18][C][sun.sensor:009]:   State Class: ''
[22:02:18][C][sun.sensor:009]:   Unit of Measurement: '°'
[22:02:18][C][sun.sensor:009]:   Accuracy Decimals: 1
[22:02:18][C][sun.sensor:009]:   Icon: 'mdi:weather-sunset'
[22:02:18][C][pulse_meter:090]: Pulse Meter '${friendly_name} wind speed'
[22:02:18][C][pulse_meter:090]:   State Class: 'measurement'
[22:02:18][C][pulse_meter:090]:   Unit of Measurement: 'm/s'
[22:02:18][C][pulse_meter:090]:   Accuracy Decimals: 2
[22:02:18][C][pulse_meter:090]:   Icon: 'mdi:weather-windy'
[22:02:18][C][pulse_meter:091]:   Pin: GPIO33
[22:02:18][C][pulse_meter:093]:   Filtering rising edges less than 13 µs apart
[22:02:18][C][pulse_meter:098]:   Assuming 0 pulses/min after not receiving a pulse for 5s
[22:02:18][C][copy.sensor:015]: Copy Sensor '${friendly_name} wind speed average'
[22:02:18][C][copy.sensor:015]:   State Class: 'measurement'
[22:02:18][C][copy.sensor:015]:   Unit of Measurement: 'm/s'
[22:02:18][C][copy.sensor:015]:   Accuracy Decimals: 2
[22:02:18][C][copy.sensor:015]:   Icon: 'mdi:weather-windy'
[22:02:18][C][copy.sensor:015]: Copy Sensor '${friendly_name} wind speed (km/h)'
[22:02:18][C][copy.sensor:015]:   State Class: 'measurement'
[22:02:18][C][copy.sensor:015]:   Unit of Measurement: 'km/h'
[22:02:18][C][copy.sensor:015]:   Accuracy Decimals: 2
[22:02:18][C][copy.sensor:015]:   Icon: 'mdi:weather-windy'
[22:02:18][C][mlx90393:049]: MLX90393:
[22:02:18][C][mlx90393:050]:   Address: 0x0C
[22:02:18][C][mlx90393:056]:   Update Interval: 2.0s
[22:02:18][C][mlx90393:058]:   X Axis 'mlx_x'
[22:02:18][C][mlx90393:058]:     State Class: 'measurement'
[22:02:18][C][mlx90393:058]:     Unit of Measurement: 'µT'
[22:02:18][C][mlx90393:058]:     Accuracy Decimals: 0
[22:02:18][C][mlx90393:058]:     Icon: 'mdi:magnet'
[22:02:18][C][mlx90393:059]:   Y Axis 'mlx_y'
[22:02:18][C][mlx90393:059]:     State Class: 'measurement'
[22:02:18][C][mlx90393:059]:     Unit of Measurement: 'µT'
[22:02:18][C][mlx90393:059]:     Accuracy Decimals: 0
[22:02:18][C][mlx90393:059]:     Icon: 'mdi:magnet'
[22:02:18][C][mlx90393:060]:   Z Axis 'mlx_z'
[22:02:18][C][mlx90393:060]:     State Class: 'measurement'
[22:02:18][C][mlx90393:060]:     Unit of Measurement: 'µT'
[22:02:18][C][mlx90393:060]:     Accuracy Decimals: 0
[22:02:18][C][mlx90393:060]:     Icon: 'mdi:magnet'
[22:02:18][C][homeassistant.time:010]: Home Assistant Time:
[22:02:18][C][homeassistant.time:011]:   Timezone: 'NZST-12NZDT,M9.5.0,M4.1.0/3'
[22:02:18][C][sun.text_sensor:009]: Sun Text Sensor 'Sun Next Sunrise'
[22:02:18][C][sun.text_sensor:009]:   Icon: 'mdi:weather-sunset-up'
[22:02:18][C][sun.text_sensor:009]: Sun Text Sensor 'Sun Next Sunset'
[22:02:18][C][sun.text_sensor:009]:   Icon: 'mdi:weather-sunset-down'
[22:02:18][C][copy.sensor:015]: Copy Sensor '${friendly_name} wind speed average (km/h)'
[22:02:18][C][copy.sensor:015]:   State Class: 'measurement'
[22:02:18][C][copy.sensor:015]:   Unit of Measurement: 'km/h'
[22:02:18][C][copy.sensor:015]:   Accuracy Decimals: 2
[22:02:18][C][copy.sensor:015]:   Icon: 'mdi:weather-windy'
[22:02:18][C][mdns:115]: mDNS:
[22:02:18][C][mdns:116]:   Hostname: weather-station
[22:02:18][C][ota:097]: Over-The-Air Updates:
[22:02:18][C][ota:098]:   Address: 
[22:02:18][C][ota:101]:   Using Password.
[22:02:18][C][api:139]: API Server:
[22:02:18][C][api:140]:   Address: 
[22:02:18][C][api:142]:   Using noise encryption: YES
[22:02:18][C][wifi_signal.sensor:009]: WiFi Signal 'WiFi Signal dB'
[22:02:18][C][wifi_signal.sensor:009]:   Device Class: 'signal_strength'
[22:02:18][C][wifi_signal.sensor:009]:   State Class: 'measurement'
[22:02:18][C][wifi_signal.sensor:009]:   Unit of Measurement: 'dBm'
[22:02:18][C][wifi_signal.sensor:009]:   Accuracy Decimals: 0
[22:02:19][E][mlx90393:085]: failed to read data
[22:02:19][W][component:214]: Component mlx90393.sensor took a long time for an operation (0.14 s).
[22:02:19][W][component:215]: Components should block for at most 20-30ms.
[22:02:19][D][sensor:094]: '${friendly_name} wind speed average': Sending state nan m/s with 2 decimals of accuracy
[22:02:19][D][sensor:094]: '${friendly_name} wind speed average (km/h)': Sending state nan km/h with 2 decimals of accuracy
[22:02:19][D][main:216]: It shouldn't happen (wind_speed_kmh_avg: nan)
[22:02:19][D][sensor:094]: 'Wind Direction': Sending state 264.00397  with 1 decimals of accuracy
[22:02:21][D][mlx90393:070]: received -3569.649902 219.519989 -13732.570312
[22:02:21][D][sensor:094]: 'mlx_x': Sending state -3569.64990 µT with 0 decimals of accuracy
[22:02:21][D][sensor:094]: 'mlx_y': Sending state 219.51999 µT with 0 decimals of accuracy
[22:02:21][D][sensor:094]: 'mlx_z': Sending state -13732.57031 µT with 0 decimals of accuracy
[22:02:21][W][component:214]: Component mlx90393.sensor took a long time for an operation (0.17 s).
[22:02:21][W][component:215]: Components should block for at most 20-30ms.
[22:02:21][D][sensor:094]: 'Wind Direction': Sending state 263.98096  with 1 decimals of accuracy
[22:02:21][D][text_sensor:064]: 'Sun Next Sunset': Sending state '00:50:27'
[22:02:22][D][esp32.preferences:114]: Saving 1 preferences to flash...
[22:02:22][D][esp32.preferences:143]: Saving 1 preferences to flash: 1 cached, 0 written, 0 failed
[22:02:23][E][mlx90393:085]: failed to read data
[22:02:23][W][component:214]: Component mlx90393.sensor took a long time for an operation (0.14 s).
[22:02:23][W][component:215]: Components should block for at most 20-30ms.
[22:02:23][D][sensor:094]: 'Wind Direction': Sending state 263.98096  with 1 decimals of accuracy
[22:02:24][D][sensor:094]: '${friendly_name} wind speed average': Sending state nan m/s with 2 decimals of accuracy
[22:02:24][D][sensor:094]: '${friendly_name} wind speed average (km/h)': Sending state nan km/h with 2 decimals of accuracy
[22:02:24][D][main:216]: It shouldn't happen (wind_speed_kmh_avg: nan)
[22:02:25][D][mlx90393:070]: received -3569.649902 217.069992 -13653.570312
[22:02:25][D][sensor:094]: 'mlx_x': Sending state -3569.64990 µT with 0 decimals of accuracy
[22:02:25][D][sensor:094]: 'mlx_y': Sending state 217.06999 µT with 0 decimals of accuracy
[22:02:25][D][sensor:094]: 'mlx_z': Sending state -13653.57031 µT with 0 decimals of accuracy
[22:02:25][W][component:214]: Component mlx90393.sensor took a long time for an operation (0.18 s).
[22:02:25][W][component:215]: Components should block for at most 20-30ms.
[22:02:25][D][sensor:094]: 'Wind Direction': Sending state 264.02014  with 1 decimals of accuracy
[22:02:27][E][mlx90393:085]: failed to read data
[22:02:27][W][component:214]: Component mlx90393.sensor took a long time for an operation (0.14 s).
[22:02:27][W][component:215]: Components should block for at most 20-30ms.
[22:02:27][D][pulse_counter:174]: '${friendly_name} rain gauge': Retrieved counter: 0.00 pulses/min
[22:02:27][D][sensor:094]: '${friendly_name} rain gauge': Sending state 0.00000 mm with 4 decimals of accuracy
[22:02:27][D][sensor:094]: '${friendly_name} rainfall per min': Sending state 0.00000 mm with 6 decimals of accuracy
[22:02:27][D][sensor:094]: '${friendly_name} total daily rain': Sending state 17.20008 mm with 6 decimals of accuracy
[22:02:27][D][sensor:094]: 'Wind Direction': Sending state 264.02014  with 1 decimals of accuracy
[22:02:29][E][mlx90393:085]: failed to read data
[22:02:29][W][component:214]: Component mlx90393.sensor took a long time for an operation (0.14 s).
[22:02:29][W][component:215]: Components should block for at most 20-30ms.
[22:02:29][D][sensor:094]: '${friendly_name} wind speed average': Sending state nan m/s with 2 decimals of accuracy
[22:02:29][D][sensor:094]: '${friendly_name} wind speed average (km/h)': Sending state nan km/h with 2 decimals of accuracy
[22:02:29][D][main:216]: It shouldn't happen (wind_speed_kmh_avg: nan)
[22:02:29][D][sensor:094]: 'Wind Direction': Sending state 264.02014  with 1 decimals of accuracy
[22:02:31][D][mlx90393:070]: received -3570.629883 219.519989 -13554.820312
[22:02:31][D][sensor:094]: 'mlx_x': Sending state -3570.62988 µT with 0 decimals of accuracy
[22:02:31][D][sensor:094]: 'mlx_y': Sending state 219.51999 µT with 0 decimals of accuracy
[22:02:31][D][sensor:094]: 'mlx_z': Sending state -13554.82031 µT with 0 decimals of accuracy
[22:02:31][W][component:214]: Component mlx90393.sensor took a long time for an operation (0.17 s).
[22:02:31][W][component:215]: Components should block for at most 20-30ms.
[22:02:31][D][text_sensor:064]: 'Sun Next Sunrise': Sending state '15:12:28'
[22:02:31][D][sensor:094]: 'Wind Direction': Sending state 263.98193  with 1 decimals of accuracy
[22:02:32][D][pulse_meter:077]: No pulse detected for 5s, assuming 0 pulses/min
[22:02:33][D][mlx90393:070]: received -3570.629883 217.559982 -13807.621094
[22:02:33][D][sensor:094]: 'mlx_x': Sending state -3570.62988 µT with 0 decimals of accuracy
[22:02:33][D][sensor:094]: 'mlx_y': Sending state 217.55998 µT with 0 decimals of accuracy
[22:02:33][D][sensor:094]: 'mlx_z': Sending state -13807.62109 µT with 0 decimals of accuracy
[22:02:33][W][component:214]: Component mlx90393.sensor took a long time for an operation (0.17 s).
[22:02:33][W][component:215]: Components should block for at most 20-30ms.
[22:02:33][D][sensor:094]: 'Wind Direction': Sending state 264.01324  with 1 decimals of accuracy
[22:02:33][D][sensor:094]: 'Sun elevation': Sending state 23.34587 ° with 1 decimals of accuracy
[22:02:34][D][sensor:094]: '${friendly_name} wind speed average': Sending state nan m/s with 2 decimals of accuracy
[22:02:34][D][sensor:094]: '${friendly_name} wind speed average (km/h)': Sending state nan km/h with 2 decimals of accuracy
[22:02:34][D][main:216]: It shouldn't happen (wind_speed_kmh_avg: nan)
[22:02:35][E][mlx90393:085]: failed to read data
[22:02:35][W][component:214]: Component mlx90393.sensor took a long time for an operation (0.14 s).
[22:02:35][W][component:215]: Components should block for at most 20-30ms.
[22:02:35][D][sensor:094]: 'Wind Direction': Sending state 264.01324  with 1 decimals of accuracy
[22:02:35][D][sensor:094]: 'WiFi Signal dB': Sending state -76.00000 dBm with 0 decimals of accuracy
[22:02:35][D][sensor:094]: 'WiFi Signal Percent': Sending state 48.00000 Signal % with 0 decimals of accuracy
[22:02:37][D][mlx90393:070]: received -3569.159912 217.069992 -13811.571289
[22:02:37][D][sensor:094]: 'mlx_x': Sending state -3569.15991 µT with 0 decimals of accuracy
[22:02:37][D][sensor:094]: 'mlx_y': Sending state 217.06999 µT with 0 decimals of accuracy
[22:02:37][D][sensor:094]: 'mlx_z': Sending state -13811.57129 µT with 0 decimals of accuracy
[22:02:37][W][component:214]: Component mlx90393.sensor took a long time for an operation (0.17 s).
[22:02:37][W][component:215]: Components should block for at most 20-30ms.
[22:02:37][D][pulse_counter:174]: '${friendly_name} rain gauge': Retrieved counter: 0.00 pulses/min
[22:02:37][D][sensor:094]: '${friendly_name} rain gauge': Sending state 0.00000 mm with 4 decimals of accuracy
[22:02:37][D][sensor:094]: '${friendly_name} rainfall per min': Sending state 0.00000 mm with 6 decimals of accuracy
[22:02:37][D][sensor:094]: '${friendly_name} total daily rain': Sending state 17.20008 mm with 6 decimals of accuracy
[22:02:37][D][sensor:094]: 'Wind Direction': Sending state 264.01965  with 1 decimals of accuracy
[22:02:38][D][sensor:094]: '${friendly_name} wind speed': Sending state 0.28102 m/s with 2 decimals of accuracy
[22:02:38][D][sensor:094]: '${friendly_name} wind speed (km/h)': Sending state 1.01166 km/h with 2 decimals of accuracy
[22:02:39][D][mlx90393:070]: received -3569.159912 219.029999 -13625.919922
[22:02:39][D][sensor:094]: 'mlx_x': Sending state -3569.15991 µT with 0 decimals of accuracy
[22:02:39][D][sensor:094]: 'mlx_y': Sending state 219.03000 µT with 0 decimals of accuracy
[22:02:39][D][sensor:094]: 'mlx_z': Sending state -13625.91992 µT with 0 decimals of accuracy
[22:02:39][W][component:214]: Component mlx90393.sensor took a long time for an operation (0.17 s).
[22:02:39][W][component:215]: Components should block for at most 20-30ms.
[22:02:39][D][sensor:094]: '${friendly_name} wind speed average': Sending state 0.28102 m/s with 2 decimals of accuracy
[22:02:39][D][sensor:094]: '${friendly_name} wind speed average (km/h)': Sending state 1.01166 km/h with 2 decimals of accuracy
[22:02:39][D][text_sensor:064]: '${friendly_name} Beaufort wind scale code': Sending state '1'
[22:02:39][D][text_sensor:064]: '${friendly_name} Beaufort wind scale': Sending state 'Light Air'
[22:02:39][D][sensor:094]: 'Wind Direction': Sending state 263.98831  with 1 decimals of accuracy
[22:02:39][D][sensor:094]: '${friendly_name} wind speed': Sending state 2.45861 m/s with 2 decimals of accuracy
[22:02:39][D][sensor:094]: '${friendly_name} wind speed (km/h)': Sending state 8.85101 km/h with 2 decimals of accuracy
[22:02:40][D][sensor:094]: '${friendly_name} wind speed': Sending state 1.66766 m/s with 2 decimals of accuracy
[22:02:40][D][sensor:094]: '${friendly_name} wind speed (km/h)': Sending state 6.00359 km/h with 2 decimals of accuracy
[22:02:41][E][mlx90393:085]: failed to read data
[22:02:41][W][component:214]: Component mlx90393.sensor took a long time for an operation (0.14 s).
[22:02:41][W][component:215]: Components should block for at most 20-30ms.

Additional information

No response

alexruffell commented 11 months ago

It appears I have the same issue (communication failure with sensor) but only if frequency of the i2c bus is anything faster than the default 50kHz. Before this update (or one of the previous ones these last couple months) it was running at 400kHz without issues.

deanfourie1 commented 11 months ago

I fixed this issue by removing the sensor from my config, saving and uploading.

Then re adding the config for the sht3xd and saving and uploading again.

This solved the issue for me. Very strange.

alexruffell commented 11 months ago

@deanfourie1 I opened another issue as in my case whether the SHT3XD with an i2c frequency of 400khz works or not depends on the framework. With arduino I can set the frequency to 400khz (did not try anything higher) while with esp-idf I cannot exceed 50 to 150khz depending on node I test it on.

https://github.com/esphome/issues/issues/5303

j-stahlhut commented 7 months ago

As @deanfourie1 wrote:

I fixed this issue by removing the sensor from my config, saving and uploading. Then re adding the config for the sht3xd and saving and uploading again.

I just have the same issue after upgrade to ESPHome 2024.4.0 - 17th April 2024 Thanx for the solutions

tymscar commented 7 months ago

Same issue here on 2024.4.0, with this error:

[21:02:51][E][sht3xd:040]:   Communication with SHT3xD failed!
[21:02:51][E][component:082]:   Component sht3xd.sensor is marked FAILE

Removing, flashing, re-adding, flashing does not fix the issue for me. Any ideas?

EDIT: What ended up working was following @mrtoy-me's suggestion in https://github.com/esphome/issues/issues/5710 and adding the following to the top of my yaml:

external_components:
  - source:
      type: git
      url: https://github.com/mrtoy-me/esphome-my-components
      ref: main
    components: [ sht3xd ]
mrtoy-me commented 7 months ago

External link I suggested in issue#5710 is now part of release 2024.4.2

tymscar commented 7 months ago

It is an I can confirm it's working