I can use my SDC30 sensor with the standard I2C pins, but not with the commented-out pin numbers of the following configuration because then I get the “Results from i2c bus scan: Found no i2c devices!” error. Why?
Pin 3 on both ESP8266 and ESP32 is not the first choice to use - as it can do interesting things at boot time, which may be confusing your I2C device. Google “esp what pins to use” for some tables showing reason why some pins are last choice to use on devices.
@mondalaci the ESP32 pin link that @Lakini gave you is quite good. Reading the link, for ESP32 i2c you can reassign different pins other than the default 21 / 22 (as referred to in the ESPHome link), but you will read that the two you chose, 4 is not good because it is meant to be high on boot. Different variations make different pins available, so needs a bit of reading. I do a spreadsheet of all the sensors I wish to use, before I assemble and test. Good luck
ah, forgot one detail: i dont have much experience with i2c, but just in the last days I was going crazy figuring out an SPI issue. Although it is supported to reassign other pins than the standard ones, at least for SPI that can result in less performance and stability. So if you can somehow arrange it, I would definitely go with the default pins, just to rule that out as a source of trouble