My d1mini air quality meters stop working after some time but great after restart for a while

Hello…

My esphome group of devices is growing and after having 2 d1 mini based air quality sensors now, i experience that those do stop working after some time and do not respond anymore until i power cycle them.
How can i troubleshoot them when i cannot get the logs off them when they did fail?

Would like to sort that issue out asap…
P.s.
Esphome is updated, code for devices follows in a minute

esphome:
  name: iaqmonitor2
  friendly_name: IAQmonitor2
  platform: ESP8266
  board: d1_mini

# Disable logging over UART (required)
logger:
  baud_rate: 0

# Enable Home Assistant API
api:
  encryption:
    Key="

ota:
  password: "2a17beda57d69"

wifi:
  networks:
    - ssid: given
      password: !secret wifi_password
      manual_ip:
    # Set this to the IP of the ESP
        static_ip: 192.168.given
    # Set this to the IP address of the router. Often ends with .1
        gateway: 192.168.given
    # The subnet of the network. 255.255.255.0 works for most home networks.
        subnet: 255.255.255.0  
    - ssid: 
      password: !secret wifi_password
      manual_ip:
    # Set this to the IP of the ESP
        static_ip: 192.168.given
    # Set this to the IP address of the router. Often ends with .1
        gateway: 192.168.given
    # The subnet of the network. 255.255.255.0 works for most home networks.
        subnet: 255.255.255.0

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Iaqmonitor2 Fallback Hotspot"
    password: ""

captive_portal:

# Enable Web server.
web_server:
  port: 80
  
time:
  - platform: homeassistant
    id: homeassistant_time

# Text sensors with general information.
text_sensor:
  # Expose ESPHome version as sensor.
  - platform: version
    name: ESPHome Version
  # Expose WiFi information as sensors.
  - platform: wifi_info
    ip_address:
      name: AirQuali2 IP
    mac_address:
      name: AirQuali2 MAC
    ssid:
      name: AirQuali2 SSID

# Sensors with general information.
sensor:
  # Uptime sensor.
  - platform: uptime
    name: AirQuali2 Uptime
    filters:
      - lambda: return x / 60.0;
    unit_of_measurement: minutes
    
  # WiFi Signal sensor.
  - platform: wifi_signal
    name: AirQuali2 WiFi Signal
    update_interval: 60s   
     
  - platform: pmsx003
    type: PMSX003
    uart_id: uart_1
    pm_1_0:
      id: pm10
      name: "Fein Partikel <1.0µm: "
    pm_2_5:
      id: pm25
      name: "Fein Partikel <2.5µm: "
    pm_10_0:
      id: pm100
      name: "Fein Partikel <10.0µm: "
  - platform: scd30
    co2:
      id: co2
      name: "CO2"
      accuracy_decimals: 1
    temperature:
      id: temp
      name: "Temperature"
      accuracy_decimals: 2
    humidity:
      id: humidity
      name: "Humidity"
      accuracy_decimals: 1
    temperature_offset: 1.5 °C
    address: 0x61
    i2c_id: bus_a
    update_interval: 5s

i2c:
   - id: bus_a
     sda: D1
     scl: D2
     scan: true
#   - id: bus_b
#     sda: D7
#     scl: D8
#     scan: true

uart:
  - rx_pin: D6
    tx_pin: D5
    baud_rate: 9600
    id: uart_1

font:
  - file: "monofont.ttf"
    id: opensans
    size: 10

display:
  - platform: ssd1306_i2c
    address: 0x3C
    i2c_id: bus_a
    id: oled
    model: "SSD1306 64x48"
    pages:
      - id: page1
        lambda: |-
          it.printf(0, 0, id(opensans), "CO2: %.0fppm", id(co2).state);
          it.printf(0, 10, id(opensans), "PM10 : %.0f", id(pm10).state);
          it.printf(0, 20, id(opensans), "PM25 : %.0f", id(pm25).state);
          it.printf(0, 30, id(opensans), "PM100: %.0f", id(pm100).state);
      - id: page2
        lambda: |-
          it.printf(0, 20, id(opensans), "Hmdty: %.0f", id(humidity).state);
          it.printf(0, 30, id(opensans), "Temp: %.0fC", id(temp).state);

interval:
  - interval: 5s
    then:
      - display.page.show_next: oled
      - component.update: oled
  - interval: 120s
    then:
      - switch.turn_on: pms_set
      - delay: 20s
      - switch.turn_off: pms_set

switch:
  - platform: gpio
    pin: 
      number: D3
    id: pms_set
    name: "Start measuring"

number:
  - platform: template
    name: "CO2 calibration value"
    optimistic: true
    min_value: 350
    max_value: 4500
    step: 1
    id: co2_cal
    icon: "mdi:molecule-co2"
    entity_category: "config"

button:
  - platform: template
    name: "SCD30 Force manual calibration"
    entity_category: "config"
    on_press:
      then:
        - scd30.force_recalibration_with_reference:
            value: !lambda 'return id(co2_cal).state;'

When I have had things go wrong; to debug I have split out sensors onto different ESPnodes until I have a working solution. Perhaps power supply perhaps firmware update perhaps Wi-Fi. Have you done a network scan to see if the device IP is still on line?

I didnt ping it, but eebif was down…will def take time next occasion and ping.
The co2 blinky is going and the fine particle fan as well.
Will keep u posted…thx for reaching out

1 Like