I’m quite new to the ESPhome but I think I’ve pretty much understood its working principles thanks to the excellent tutorials and guides. Now I was trying to make a simple environmental sensing station using a Wemos D1 mini lite, a BME280 and a MAX44009 light sensor.
I wired them to the D1 and D2 pins and everything seemed to work, I was getting good values and the sensors were responding to external stimuli. I turned off the PC and came back after an hour.
Well, I don’t know what happened during my absence but now both the I2C sensors are not working. Here the error:
[C][bme280.sensor:081]: Setting up BME280...
[20:11:38][W][i2c:070]: Received NACK on transmit of address 0x76
[20:11:38][E][component:092]: Component was marked as failed.
the resulting values for the BME are all nan while the light intensity is 0.000.
Running an I2C scanner sketch on the Wemos I can see the sensors at 0x76 and 0x4A, as in the code.
Here is the code, should be correct as it was taken from the official guide
i2c:
sda: 4
scl: 5
scan: true
sensor:
- platform: custom
lambda: |-
auto lux_sensor = new MAX44009Sensor();
App.register_component(lux_sensor);
return {lux_sensor};
sensors:
name: "Ambient Light"
id: max44009
state_topic: ${device_name}/feeds/light
unit_of_measurement: 'lux'
accuracy_decimals: 1
- platform: bme280
address: 0x76
temperature:
name: "Temperature"
id: bme280_temperature
state_topic: ${device_name}/feeds/temperature
unit_of_measurement: '°C'
discovery: True
filters: []
pressure:
name: "Pressure"
id: bme280_pressure
state_topic: ${device_name}/feeds/pressure
unit_of_measurement: 'hPa'
discovery: True
filters: []
humidity:
name: "Relative Humidity"
id: bme280_humidity
state_topic: ${device_name}/feeds/rel_humidity
unit_of_measurement: '%'
discovery: True
filters: []
update_interval: ${update_interval}