EverythingSmartHome / everything-presence-one

Official Repo for the Everything Presence One sensor!
390 stars 71 forks source link

Reading BH1750 data failed #150

Closed wpte closed 6 months ago

wpte commented 6 months ago

Hi,

I've bought 4 everything presence one sensors from you but one seems to have a little issue I wasn't aware of for a long time. On one of the devices I frequently get the message [bh1750.sensor:102]: Reading BH1750 data failed. The light sensor does read sometimes, but there's also times it doesn't. In short the logging then looks like this:

[13:39:26][W][bh1750.sensor:102]: Reading BH1750 data failed
[13:39:26][D][sensor:094]: 'Illuminance': Sending state nan lx with 1 decimals of accuracy
[13:39:26][W][component:214]: Component bh1750.sensor took a long time for an operation (1.01 s).
[13:39:26][W][component:215]: Components should block for at most 20-30ms.

and then a bit later:

[13:40:56][D][bh1750.sensor:159]: 'Illuminance': Got illuminance=202.2lx
[13:40:56][D][sensor:094]: 'Illuminance': Sending state 202.15549 lx with 1 decimals of accuracy

I'm running ESPHome 2023.12.9 and using project version 1.1.10

What is an obvious difference between the 1 "faulty" one and the others that work properly is that all sensors report 2 i2c devices on address 0x23 and 0x70, but the faulty one reports 2 devices on 0x5C and 0x70. Other than that the logging is the same. What can I do to fix the light sensor?

wpte commented 6 months ago

It seems that after flashing with the ESPHome flasher rather than through wifi it works a whole lot better. Who knew that formatting flash could have such an impact.