Hi all,
yesterday I configured a board d1_mini_pro with ens160 sensor, this is my code from the dashboard of esphome:
esphome:
name: “qualita-dell-aria”
friendly_name: Sensore Qualità Ariaesp8266:
board: d1_mini_proEnable logging
logger:
level: VERY_VERBOSEEnable Home Assistant API
api:
encryption:
key: “lcS5D6qO4TxHxrgeXwMr19s4dcYUxpzTIMAaEFu0fHI=”ota:
- platform: esphome
i2c:
sda: D2
scl: D1
scan: true
id: bus_awifi:
ssid: !secret wifi_ssid
password: !secret wifi_passwordEnable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: “Esphome-Web-F03134”
password: “AxfnQkPNtPSj”captive_portal:
Example configuration entry I2C
sensor:
- platform: ens160_i2c
eco2:
name: “ENS160 eCO2”
tvoc:
name: “ENS160 Total Volatile Organic Compounds”
aqi:
id: ens160_air_quality_index
name: “ENS160 Air Quality Index”
update_interval: 60s
address: 0x52
#compensation:
#temperature: id_temperature_sensor
#humidity: id_humidity_sensor
everything seems work fine, this is the log:
> `INFO ESPHome 2024.8.1`
> `INFO Reading configuration /config/sensore-qualita-dellaria.yaml...`
> `INFO Starting log output from qualita-dell-aria.local using esphome API`
> `INFO Successfully connected to qualita-dell-aria @` [10.147.1.224](http://10.147.1.224/) `in 0.119s`
> `INFO Successful handshake with qualita-dell-aria @` [10.147.1.224](http://10.147.1.224/) `in 2.995s`
> `[11:03:09][I][app:100]: ESPHome version 2024.8.1 compiled on Dec 28 2024, 00:21:43`
> `[11:03:09][C][wifi:600]: WiFi:`
> `[11:03:09][C][wifi:428]: Local MAC: 34:5F:45:40:E3:19`
> `[11:03:09][C][wifi:433]: SSID: [redacted]`
> `[11:03:09][C][wifi:436]: IP Address:` [10.147.1.224](http://10.147.1.224/)
> `[11:03:09][C][wifi:439]: BSSID: [redacted]`
> `[11:03:09][C][wifi:441]: Hostname: 'qualita-dell-aria'`
> `[11:03:09][C][wifi:443]: Signal strength: -50 dB ▂▄▆█`
> `[11:03:09][C][wifi:447]: Channel: 4`
> `[11:03:09][C][wifi:448]: Subnet:` [255.255.255.0](http://255.255.255.0/)
> `[11:03:09][C][wifi:449]: Gateway:` [10.147.1.1](http://10.147.1.1/)
> `[11:03:09][C][wifi:450]: DNS1:` [10.147.1.1](http://10.147.1.1/)
> `[11:03:09][C][wifi:451]: DNS2:` [0.0.0.0](http://0.0.0.0/)
> `[11:03:09][C][logger:185]: Logger:`
> `[11:03:09][C][logger:186]: Level: DEBUG`
> `[11:03:09][C][logger:188]: Log Baud Rate: 115200`
> `[11:03:09][C][logger:189]: Hardware UART: UART0`
> `[11:03:09][C][i2c.arduino:071]: I2C Bus:`
> `[11:03:09][C][i2c.arduino:072]: SDA Pin: GPIO4`
> `[11:03:09][C][i2c.arduino:073]: SCL Pin: GPIO5`
> `[11:03:09][C][i2c.arduino:074]: Frequency: 50000 Hz`
> `[11:03:09][C][i2c.arduino:086]: Recovery: bus successfully recovered`
> `[11:03:09][I][i2c.arduino:096]: Results from i2c bus scan:`
> `[11:03:09][I][i2c.arduino:102]: Found i2c device at address 0x52`
> `[11:03:09][C][ens160:278]: ENS160:`
> `[11:03:09][D][ens160:300]: Setup successful`
> `[11:03:09][I][ens160:303]: Firmware Version: 5.4.6`
> `[11:03:09][C][ens160:306]: Update Interval: 60.0s`
> `[11:03:09][C][ens160:307]: CO2 Sensor: 'ENS160 eCO2'`
> `[11:03:09][C][ens160:307]: Device Class: 'carbon_dioxide'`
> `[11:03:09][C][ens160:307]: State Class: 'measurement'`
> `[11:03:09][C][ens160:307]: Unit of Measurement: 'ppm'`
> `[11:03:09][C][ens160:307]: Accuracy Decimals: 0`
> `[11:03:09][C][ens160:307]: Icon: 'mdi:molecule-co2'`
> `[11:03:09][C][ens160:308]: TVOC Sensor: 'ENS160 Total Volatile Organic Compounds'`
> `[11:03:09][C][ens160:308]: Device Class: 'volatile_organic_compounds_parts'`
> `[11:03:09][C][ens160:308]: State Class: 'measurement'`
> `[11:03:09][C][ens160:308]: Unit of Measurement: 'ppb'`
> `[11:03:09][C][ens160:308]: Accuracy Decimals: 0`
> `[11:03:09][C][ens160:308]: Icon: 'mdi:radiator'`
> `[11:03:09][C][ens160:309]: AQI Sensor: 'ENS160 Air Quality Index'`
> `[11:03:09][C][ens160:309]: Device Class: 'aqi'`
> `[11:03:09][C][ens160:309]: State Class: 'measurement'`
> `[11:03:09][C][ens160:309]: Unit of Measurement: ''`
> `[11:03:09][C][ens160:309]: Accuracy Decimals: 0`
> `[11:03:09][C][ens160:309]: Icon: 'mdi:chemical-weapon'`
> `[11:03:09][C][ens160:315]: Compensation: Not configured`
> `[11:03:09][C][ens160_i2c.sensor:028]: Address: 0x52`
> `[11:03:09][C][captive_portal:088]: Captive Portal:`
> `[11:03:09][C][mdns:116]: mDNS:`
> `[11:03:09][C][mdns:117]: Hostname: qualita-dell-aria`
> `[11:03:09][C][esphome.ota:073]: Over-The-Air updates:`
> `[11:03:09][C][esphome.ota:074]: Address: qualita-dell-aria.local:8266`
> `[11:03:09][C][esphome.ota:075]: Version: 2`
> `[11:03:09][C][safe_mode:018]: Safe Mode:`
> `[11:03:09][C][safe_mode:019]: Boot considered successful after 60 seconds`
> `[11:03:09][C][safe_mode:021]: Invoke after 10 boot attempts`
> `[11:03:09][C][safe_mode:022]: Remain in safe mode for 300 seconds`
> `[11:03:09][C][api:139]: API Server:`
> `[11:03:09][C][api:140]: Address: qualita-dell-aria.local:6053`
> `[11:03:09][C][api:142]: Using noise encryption: YES`
> `[11:04:05][D][ens160:172]: ENS160 readings unavailable - Normal Operation but readings not ready`
I turn on the sensor yesterday night, 5v5. If necessary I update an image of the wiring.