I have a self-made temperature/humidty sensor (Si7021) with an display (SH1106) attached to it in a small case.
Because I want to get rit of MQTT, I have “re-written” the code with ESPHome.
However, before the “code converversion” I had a temperature offset of -1.3 degree in comparision to my reference sensor and after it’s -5.2 degree.
Which leads me to the conclusion that the ESPHome-Code needs optimization.
esphome:
name: sh1106_si7021
platform: ESP8266
board: nodemcuv2
api:
wifi:
ssid: 'myWIFI'
password: 'mySecret'
manual_ip:
static_ip: 192.168.1.41
gateway: 192.168.1.1
subnet: 255.255.255.0
power_save_mode: high
# Enable logging
logger:
level: none
i2c:
ota:
spi:
clk_pin: 14
mosi_pin: 13
sensor:
- platform: wifi_signal
name: "SH1106 Si7021 - RSSI"
filters:
- delta: 2.0
- platform: htu21d
temperature:
filters:
- delta: 0.4
- offset: -5.2
name: "SH1106 Si7021 - Temperature"
unit_of_measurement: "°C"
id: temperature
humidity:
filters:
- delta: 1.2
- offset: 6.0
name: "SH1106 Si7021 - Humidity"
accuracy_decimals: 1
unit_of_measurement: "%"
id: humidity
update_interval: 60s
time:
- platform: homeassistant
id: time_hass
font:
- file: "sh1106_si7021_dependencies/arial.ttf"
id: arial_14
size: 14
- file: "sh1106_si7021_dependencies/Logisoso.ttf"
id: logisoso_42
size: 62
- file: "sh1106_si7021_dependencies/Logisoso.ttf"
id: logisoso_26
size: 39
display:
- platform: ssd1306_spi
model: "SH1106 128x64"
cs_pin: 15
dc_pin: 0
reset_pin: 2
id: my_display
pages:
- id: page1
lambda: |-
it.printf(15, 23, id(logisoso_42), "%.1f", id(temperature).state);
it.line(0, 46, 127, 46);
it.print(13, 48, id(arial_14), "Temperature (°C)");
- id: page2
lambda: |-
it.printf(15, 23, id(logisoso_42), "%.1f", id(humidity).state);
it.line(0, 46, 127, 46);
it.print(16, 48, id(arial_14), "Humidity (%)");
- id: page3
lambda: |-
it.strftime(2, 5, id(logisoso_26), "%H:%M:%S", id(time_hass).now());
it.line(0, 46, 127, 46);
it.strftime(27, 48, id(arial_14), "%d.%m.%Y", id(time_hass).now());
interval:
- interval: 3s
then:
- display.page.show_next: my_display
- component.update: my_display
Do you have any suggestion?