I have 2 AirGradient units (Basic 3.0 Units : The AirGradient DIY Air Quality Sensor (Basic Version PCB Version 3.0))
Previously, both units were running with ESPHome 2023.8.2 and working properly. However, yesterday I upgraded to 2023.9.2 and wirelessly reflashed both units and the temperature sensor results instantly jumped +2.5c
I had initially set them both up with a Temperature Offset of -2.0 as their readings were +2c above actual.
sensor:
- platform: sht3xd
temperature:
id: temp
name: "Temperature"
filters:
- offset: -2.0
The local unit (Unit1) would not respond to a new “- offset: -4.5” and I finally got it to report the correct temperature using “lambda”
sensor:
- platform: sht3xd
temperature:
id: temp
name: "Temperature"
filters:
- lambda: return (x - 4.5);
Unit2 (8,000 miles away - seriously), would not report the correct temperature no matter what I tried. An offset of -4.5 dropped the result -2c below normal. A lambda of (x - 4.5) did the same. Finally after reverting back to a offset of -2.0 it reported the correct temperature, again:
sensor:
- platform: sht3xd
temperature:
id: temp
name: "Temperature"
filters:
- offset: -2.0
Until just an hour ago. Then Temperature reading on Unit2 instantly jumped +2.0c for no apparent reason. I had not updated any software in HA, including ESPHome. It just jumped.
So I tried lambda (x - 4.5) (same as Unit1 code):
sensor:
- platform: sht3xd
temperature:
id: temp
name: "Temperature"
filters:
- lambda: return (x - 4.5);
And it caused the reading to drop -2.5 below actual. I tried doing a physical Power Cycle (using a remote controlled Tasmota socket) with no change.
I feel like I’m chasing my tail with this and really hesitant to keep flashing new firmware on Unit2 as its so far away with no-one on site to do a local flash if the wireless one fails (its failed before). So I’m hoping someone can point me in right direction as to watch to change/examine/look.
esphome:
name: "air-gradient-2"
platform: ESP8266
board: d1_mini
friendly_name: "air-gradient-2"
project:
name: ajfriesen.ESPHome-AirGradient
version: "1.0"
# Enable logging
logger:
# Enable Home Assistant API
api:
# encryption:
# key: Redacted
ota:
# Create a switch for safe_mode in order to flash the device
# Solution from this thread:
# https://community.home-assistant.io/t/esphome-flashing-over-wifi-does-not-work/357352/1
switch:
- platform: safe_mode
id: AirGradient2_safe_mode
name: "Flash Mode (Safe Mode)"
- platform: restart
id: AirGradient2_restart
name: "Air Gradient2 Restart"
button:
- platform: template
name: "Flash mode"
id: flash_button
icon: "mdi:cellphone-arrow-down"
on_press:
then:
- switch.toggle: AirGradient2_safe_mode
dashboard_import:
# package_import_url: github://esphome/esphome-project-template/project-template-esp32.yaml@v6
package_import_url: github://ajfriesen/ESPHome-AirGradient/main/air-gradient.yaml
wifi:
# Redacted
captive_portal:
i2c:
sda: D2
scl: D1
frequency: 800kHz
font:
- file: "fonts/monofont.ttf"
id: opensans
size: 20
display:
- platform: ssd1306_i2c
id: oled
model: "SSD1306 64x48"
flip_x: False
flip_y: False
pages:
- id: page1
lambda: |-
it.printf(0, 0, id(opensans), "Temp:");
it.printf(0, 20, id(opensans), "%.1fC", id(temp).state);
- id: page2
lambda: |-
it.printf(0, 0, id(opensans), "Humidity");
it.printf(0, 20, id(opensans), "%.1f%%", id(humidity).state);
- id: page3
lambda: |-
it.printf(0, 0, id(opensans), "CO2 ppm");
it.printf(0, 20, id(opensans), "%.0f", id(co2).state);
- id: page4
lambda: |-
it.printf(0, 0, id(opensans), "PM1.0");
it.printf(0, 20, id(opensans), "%.0f", id(pm10).state);
- id: page5
lambda: |-
it.printf(0, 0, id(opensans), "PM2.5");
it.printf(0, 20, id(opensans), "%.0f", id(pm25).state);
- id: page6
lambda: |-
it.printf(0, 0, id(opensans), "PM10.0");
it.printf(0, 20, id(opensans), "%.0f", id(pm100).state);
interval:
- interval: 3s
then:
- display.page.show_next: oled
- component.update: oled
uart:
- rx_pin: D5
tx_pin: D6
baud_rate: 9600
id: uart_1
- rx_pin: D4
tx_pin: D3
baud_rate: 9600
id: uart_2
sensor:
- platform: sht3xd
temperature:
id: temp
name: "Temperature"
filters:
- lambda: return (x - 4.5);
humidity:
id: humidity
name: "Humidity"
address: 0x44
update_interval: 60s
- platform: pmsx003
# type can be PMSX003, PMS5003S, PMS5003T, PMS5003ST
# https://esphome.io/components/sensor/pmsx003.html
type: PMSX003
uart_id: uart_1
pm_1_0:
id: pm10
name: "Particulate Matter <1.0µm Concentration"
pm_2_5:
id: pm25
name: "Particulate Matter <2.5µm Concentration"
pm_10_0:
id: pm100
name: "Particulate Matter <10.0µm Concentration"
# formaldehyde:
# id: hcho
# name: "Formaldehyde (HCHO) concentration in µg per cubic meter"
- platform: senseair
uart_id: uart_2
co2:
id: co2
name: "SenseAir CO2 Value"
update_interval: 60s
The ESPHome yaml logs for that Unit2 show no errors.
Any ideas?