Having trouble connecting ESP32 to TSL2591 Light Sensor "tsl2591.sensor is marked FAILED: unspecified"

Hello All.

I’ve been using a combo of the TSL Light Sensor and a SHT? Temp/Humidity Sensor. It has been a number of months since I have connected these up and used them with HA. I see now that the Temp Sensor stopped working(no green light), but I only need the Light Sensor(The reason I say I cannot connect to the other sensor is that I’m not sure if it’s just the Light Sensor that has issues, and I haven’t tried any other sensor). I keep getting this error that it cannot communicate with the Light sensor. I have had this issue in the past, and I’m not sure how I got rid of it, but I tried swapping out a new TSL sensor the other day and the issue still persists, even with the new, known working, TSL.

I’m not sure if I may be incorrectly configured or something is wrong, especially since I just updated my ESPHome/HA after many months, so I’m not sure if there is new configs or what(I read a few times about a “UART” part added in some configs, but not sure if that is something I need or not). I also tried to do a fresh install on my ESP32 device and I was given an error that it cannot connect and I need to click reset/boot on the device while trying again, on ESPHOME, so I’m not sure what happened there and if I can fix it… I know from the past that I don’t think that actually works(Holding Boot/etc), so I didn’t try it, but if I should I can go try it.

Overall I’m pretty new to all of this, and don’t have much HA experience in general(I come from a software background though), so I might have done something wrong.

Here are my logs and config.

Note, I changed the Frequency and Timeout manually, because another thread said that can help with another temp sensor, so I thought maybe it could help me out, but it didn’t.

Note2: While editing this, I did notice this

[10:43:00.367][C][i2c.idf:114]: Results from bus scan:
[10:43:00.369][C][i2c.idf:116]: Found no devices

It makes me wonder if maybe my ESP Device has an issue, or maybe something is wrong? I don’t see why 2 of the same sensors would not work, but from reading another thread

It mentions that it’s not even seeing the device? So is that the issue? It’s showing power(green light) but maybe one of the wires isn’t working?

Also to note, I use an Adafruit ESP32 Feather, I believe V2, and connect the
sensors with the “STEMMAQT” connectors, not soldering connectors or anything.

Logs:

[10:43:00.335][I][app:215]: ESPHome version 2026.2.1 compiled on 2026-03-15 10:29:52 -0400
[10:43:00.339][I][app:222]: ESP32 Chip: ESP32 rev3.0, 2 core(s)
[10:43:00.339][W][app:231]: Set minimum_chip_revision: "3.0" to reduce binary size
[10:43:00.340][C][logger:237]: Logger:
[10:43:00.340][C][logger:237]:   Max Level: DEBUG
[10:43:00.340][C][logger:237]:   Initial Level: DEBUG
[10:43:00.340][C][logger:244]:   Log Baud Rate: 115200
[10:43:00.340][C][logger:244]:   Hardware UART: UART0
[10:43:00.340][C][logger:254]:   Task Log Buffer Size: 768 bytes
[10:43:00.356][C][i2c.idf:093]: I2C Bus:
[10:43:00.356][C][i2c.idf:094]:   SDA Pin: GPIO21
[10:43:00.356][C][i2c.idf:094]:   SCL Pin: GPIO22
[10:58:57.176][C][i2c.idf:094]:   Frequency: 50000 Hz
[10:58:57.176][C][i2c.idf:104]:   Recovery: bus successfully recovered
**[10:43:00.367][C][i2c.idf:114]: Results from bus scan:**
**[10:43:00.369][C][i2c.idf:116]: Found no devices**
[10:43:00.377][C][switch.gpio:092]: GPIO Switch 'poweron'
[10:43:00.377][C][switch.gpio:092]:   Restore Mode: always ON
[10:43:00.390][C][switch.gpio:152]:   Pin: GPIO2
[**10:43:00.390][C][tsl2591.sensor:082]: TSL2591:**
**[10:43:00.390][C][tsl2591.sensor:083]:   Address: 0x29**
**[10:43:00.390][E][tsl2591.sensor:086]: Communication failed**
**[10:43:00.390][E][component:255]:   tsl2591.sensor is marked FAILED: unspecified**
[10:43:00.424][C][captive_portal:134]: Captive Portal:
[10:43:00.424][C][wifi:1450]: WiFi:
[10:43:00.424][C][wifi:1450]:   Local MAC:  (REDACTED)
[10:43:00.424][C][wifi:1450]:   Connected: YES
[10:43:00.424][C][wifi:1202]:   IP Address: (REDACTED)
[10:43:00.430][C][wifi:1213]:   SSID: [redacted]
[10:43:00.430][C][wifi:1213]:   BSSID: [redacted]
[10:43:00.430][C][wifi:1213]:   Hostname: 'esphome-web-962998'
[10:43:00.430][C][wifi:1213]:   Signal strength: -67 dB ▂▄▆█
[10:43:00.430][C][wifi:1213]:   Channel: 6
[10:43:00.430][C][wifi:1213]:   Subnet: (REDACTED)
[10:43:00.430][C][wifi:1213]:   Gateway: (REDACTED)
[10:43:00.430][C][wifi:1213]:   DNS1: (REDACTED)
[10:43:00.430][C][wifi:1213]:   DNS2: 0.0.0.0
[10:43:00.448][C][esphome.ota:075]: Over-The-Air updates:
[10:43:00.448][C][esphome.ota:075]:   Address: esphome-web-962998.local:3232
[10:43:00.448][C][esphome.ota:075]:   Version: 2
[10:43:00.449][C][safe_mode:022]: Safe Mode:
[10:43:00.449][C][safe_mode:022]:   Successful after: 60s
[10:43:00.449][C][safe_mode:022]:   Invoke after: 10 attempts
[10:43:00.449][C][safe_mode:022]:   Duration: 300s
[10:43:00.461][C][safe_mode:039]:   Bootloader rollback: supported
[10:43:00.469][C][web_server.ota:238]: Web Server OTA
[10:43:00.469][C][api:237]: Server:
[10:43:00.469][C][api:237]:   Address: esphome-web-962998.local:6053
[10:43:00.469][C][api:237]:   Listen backlog: 4
[10:43:00.469][C][api:237]:   Max connections: 8
[10:43:00.481][C][api:244]:   Noise encryption: YES
[10:43:00.824][C][mdns:177]: mDNS:
[10:43:00.824][C][mdns:177]:   Hostname: esphome-web-962998

CONFIG

esphome:
  name: esphome-web-962998
  friendly_name: Tent
  min_version: 2024.11.0
  name_add_mac_suffix: false

esp32:
  board: esp32dev
  framework:
    type: esp-idf




# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: (REDACTED)

# Allow Over-The-Air updates

ota:
- platform: esphome


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

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "esphome-web-962998"
    password: (REDACTED)

captive_portal:


i2c:
  sda: 21
  scl: 22
  scan: true
 # frequency: 100kHz
 # timeout: 10ms
 
switch:
 -  platform: gpio
    pin: GPIO2
    name: "poweron"
    restore_mode: ALWAYS_ON


#-   platform: sht4x
 #   temperature:
  #    name: "Temperature"
   # humidity:
    #  name: "Humidity"
    #update_interval: 1s
  
sensor:
  - platform: tsl2591
    name: "This little light of mine"
    id: "my_tls2591"
    address: 0x29
    update_interval: 60s
    gain: auto
    device_factor: 53
    glass_attenuation_factor: 14.4
    visible:
      name: "TSL2591 visible light"
    infrared:
      name: "TSL2591 infrared light"
    full_spectrum:
      name: "TSL2591 full spectrum light"
    calculated_lux:
      id: i_lux
      name: "TSL2591 Lux"
    actual_gain:
      id: "actual_gain"
      name: "TSL2591 actual gain"


There always seems to be some sort of issue that I have to figure out, and while I mostly seem to get things working by editing my yaml file and recompiling, this time there’s nothing working, and I cannot even reinstall the device, so I’m not sure what’s going on.

EDIT: I want to say I did switch the STEMMAQT connectors and I’m still getting this issue.

Any help is appreciated with trying to figure this out, thank you!

Use triple backtics to enclose your code and log segments to make them legible.

The log section that says this:

[10:43:00.367][C][i2c.idf:114]: Results from bus scan:
[10:43:00.369][C][i2c.idf:116]: Found no devices

Is your clue. It literally means what it said. It searched for devices but heard from none. That frequently indicates a wiring and/or hardware error.

i2c devices have 4 wires: power, ground, data, clock
Possibly the other device (sht) has gone bad and is blocking all communication or your wiring is not good enough.

Thank you.

I edited the above.

I tried a different STEMMAQT wire, and nothing, so maybe it’s the device itself… Shame, I’ve gone through a few of these already. I’ll have to see if i have any others that will work.

It makes me wonder if this might be why I cannot even get the Device to do a fresh install… At the same time, it seems like the device is seen in HA.

I’ll switch ESP Controllers and report back, because I cannot see 2 Sensors not working. I’ll try another sensor as well.

Pictures would probably help. i2c is a bus. You have two things on it. If you changed one of them twice, that means the other one (sht) is still the same and could be the problem.

Also, are you sure about the pins you are using?

Try them one by one disconnecting completely another. Observe your esphome logs for devices found.

I feel extremely foolish. I have a bunch of old instances and It seems I copied one with the wrong info…

sda: 22
scl: 20

Is the correct config… I can’t believe how silly that was… I should have looked at that sooner.

I don’t know where the other config came from, as I’ve been using the same setup the entire time… Actually, I think I used another Feather one with stacking pins, so that might have been it…

I really appreciate your help with this, Thank you!

EDIT: I realized after a number of hours that even though I initially thought I was very foolish, I thought about it now and thought I had already used this config which is why I didn’t think anything of it. I thought this instance already worked, so maybe I accidentally copied the SDA/SCL code again and that messsed up, because this config/ESP-Instance was definitely used months ago, I didn’t create a new one… Weird.

1 Like