M5Dial with ENV IV Unit does not work

I have the ENV IV unit from M5 which i want to connect to the M5DIal, when configured with scan true, the i2c bus reports the presence of 2 devices on address 0x76 and 0x44, but i do not get any readings. I have connected the ENV IV to port A.

[09:14:32][I][i2c.arduino:096]: Results from i2c bus scan:
[09:14:32][I][i2c.arduino:102]: Found i2c device at address 0x44
[09:14:32][I][i2c.arduino:102]: Found i2c device at address 0x76

The yaml i use can be found here

The additional configuration i have made is this:

i2c:
  - id: bus_a
    sda: GPIO13
    scl: GPIO15
    scan: True #False does not make a difference

sensor:
  - platform: bmp280_i2c
    i2c_id: bus_a
    temperature:
      name: "Temperature"
      oversampling: 16x
    pressure:
      name: "Pressure"
    address: 0x76
    update_interval: 60s

  - platform: sht4x
    i2c_id: bus_a
    temperature:
      name: "SHT Temperature"
    humidity:
      name: "Relative Humidity"
    address: 0x44

The problem with the bmp280_i2c is that i get the error Platform not found: 'sensor.bmp280_i2c'. Just for trying i had used the bmp280 which does not work also, but at least it compiles.

I also tried to implement it like this

But then i get Invalid pin number: 42 (must be 0-23). esp32-s3-devkitc-1 :man_facepalming:

If i leave out the bmp280 the sht40 does not work.

What am i doing wrong? What do i need to do to get this sensor to work?

First: update, i was on 2024.08 for esphome, now on 2024.10 and with that bmp280_i2c works

Second: The problem of the sensor not functioning persists

[09:40:23][E][bmp280.sensor:135]: Communication with BMP280 failed!
[09:40:23][C][bmp280.sensor:144]:   IIR Filter: OFF
[09:40:23][C][bmp280.sensor:145]:   Update Interval: 60.0s
[09:40:23][C][bmp280.sensor:147]:   Temperature 'Temperature'
[09:40:23][C][bmp280.sensor:147]:     Device Class: 'temperature'
[09:40:23][C][bmp280.sensor:147]:     State Class: 'measurement'
[09:40:23][C][bmp280.sensor:147]:     Unit of Measurement: '°C'
[09:40:23][C][bmp280.sensor:147]:     Accuracy Decimals: 1
[09:40:23][C][bmp280.sensor:148]:     Oversampling: 16x
[09:40:23][C][bmp280.sensor:149]:   Pressure 'Pressure'
[09:40:23][C][bmp280.sensor:149]:     Device Class: 'pressure'
[09:40:23][C][bmp280.sensor:149]:     State Class: 'measurement'
[09:40:23][C][bmp280.sensor:149]:     Unit of Measurement: 'hPa'
[09:40:23][C][bmp280.sensor:149]:     Accuracy Decimals: 1
[09:40:23][C][bmp280.sensor:150]:     Oversampling: 16x
[09:40:23][E][component:082]:   Component bmp280_base is marked FAILED

Same for sht4x

[09:40:44][W][component:237]: Component sht4x.sensor took a long time for an operation (1000 ms).
[09:40:44][W][component:238]: Components should block for at most 30 ms.
[09:40:45][D][sht4x:080]: Sensor read failed

To test if the M5Dial or the sensor maybe broke, I created test with the arduino IDE which delivered me this

image

The example used was

    if (!sht4.begin(&Wire, SHT40_I2C_ADDR_44, 13, 15, 400000U)) {
        Serial.println("Couldn't find SHT4x");
        while (1) delay(1);
    }
    else {
      Serial.println("Found SHT4x");
    }

   [snip]

    if (!bmp.begin(&Wire, BMP280_I2C_ADDR, 13, 15, 400000U)) {
        Serial.println("Couldn't find BMP280");
        while (1) delay(1);
    }

Another update, after removing all but the i2c bus configuration and the 2 sensors, esphome properly reports the sensor values. Now i have to build it up to see which component kills the sensors.

[13:21:52][D][sensor:094]: 'SHT Temperature': Sending state 21.52590 °C with 2 decimals of accuracy
[13:21:52][D][sensor:094]: 'Relative Humidity': Sending state 64.98497 % with 2 decimals of accuracy
[13:22:05][D][bmp280.sensor:182]: Got temperature=20.9°C pressure=1034.1hPa
[13:22:05][D][sensor:094]: 'Temperature': Sending state 20.89211 °C with 1 decimals of accuracy
[13:22:05][D][sensor:094]: 'Pressure': Sending state 1034.10229 hPa with 1 decimals of accuracy

There, i solved it. Here is the complete yaml. I should have used the esphome al along. I only needed to update the platform: pcf8563 with the correct i2c id

esphome:
  name: m5dial
  friendly_name: M5Dial
  includes:
    - hfiles/m5dial.h
  on_boot:
    then:
      - pcf8563.read_time:
  platformio_options:
    board_build.flash_mode: dio

esp32:
  board: esp32-s3-devkitc-1
  framework:
    type: esp-idf

logger:
  level: DEBUG

api:
  encryption:
    key: !secret m5dial_encryption_key

ota:
  - platform: esphome
    password: !secret m5dial_ota_password

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

  manual_ip:
    static_ip: !secret m5dial_static_ip
    gateway: !secret wifi_gateway
    subnet: !secret wifi_subnet

  ap:
    ssid: "M5Dial Fallback Hotspot"
    password: !secret m5dial_ap_password

captive_portal:

web_server:

i2c:
  - id: bus_a
    sda: GPIO13
    scl: GPIO15
    scan: False
  - id: internal_i2c
    sda: GPIO11
    scl: GPIO12

switch:
  - platform: restart
    id: m5_dial_restart_switch
    name: "M5 Dial Restart"

rc522_i2c:
  - id: nfc_reader
    i2c_id: internal_i2c
    address: 0x28

output:
  - platform: ledc
    pin: GPIO3
    id: buzzer
  - platform: ledc
    pin: GPIO9
    id: backlight_output

rtttl:
  output: buzzer

time:
  # RTC
  - platform: pcf8563
    i2c_id: internal_i2c
    id: rtctime
    address: 0x51
    update_interval: never
  - platform: homeassistant
    id: esptime
    on_time_sync:
      then:
        - pcf8563.write_time:

binary_sensor:
  - platform: gpio
    name: Button
    id: front_button
    pin: GPIO42

  - platform: gpio
    name: Hold Button
    pin: GPIO46

spi:
  id: spi_bus
  mosi_pin: GPIO5
  clk_pin: GPIO6

display:
  - platform: ili9xxx
    id: round_display
    model: GC9A01A
    cs_pin: GPIO7
    reset_pin: GPIO8
    dc_pin: GPIO4
    auto_clear_enabled: False
    update_interval: never
    invert_colors: true
    dimensions:
      height: 240
      width: 240

touchscreen:
  - platform: ft5x06
    id: touch
    i2c_id: internal_i2c
    address: 0x38
    # interrupt_pin: GPIO14  # not supported by this component

light:
  - platform: monochromatic
    name: "Backlight"
    output: backlight_output
    id: display_backlight
    default_transition_length: 0s

sensor:
  - platform: rotary_encoder
    id: encoder
    pin_a: GPIO40
    pin_b: GPIO41

  - platform: bmp280_i2c
    i2c_id: bus_a
    temperature:
      name: "Temperature"
      oversampling: 16x
    pressure:
      name: "Pressure"
    address: 0x76
    update_interval: 60s

  - platform: sht4x
    i2c_id: bus_a
    temperature:
      name: "SHT Temperature"
    humidity:
      name: "Relative Humidity"
    address: 0x44