Hello Folks ;
Posting here for the first time ever, so please excuse me for any mistakes done and guide me to do a better job in the future.
I bought those esp32’s with integrated OLED on them aliexpress esp32
I’m aiming to create a bread proofing box, where I can read the temp and humidity from the box and control a heating element for bulk fermentation. up to know the project is just about programming as I’m waiting for the heating element and the DHT sensors to arrive. All is going well except I have the first column on the screen has some characters on it and I don’t know where its coming from and i do not know how to correct it.
Im sharing my code below and posting pictures of the characters on the OLED screen.(very first coloumn)
Thank you in advance
esphome:
name: doughlene
friendly_name: Doughlene
esp32:
board: esp32dev
framework:
type: esp-idf
# Enable logging
logger:
# Enable Home Assistant API
api:
encryption:
key: "sPPJnnBlTG3N2jZFpRqTP5Tl/+gtswZXxjitC4cO8+s="
ota:
- platform: esphome
password: "5bd64b0225592942d83b49d749b706ae"
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Optional manual IP
manual_ip:
static_ip: 192.168.0.220
gateway: 192.168.0.1
subnet: 255.255.255.0
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Doughlene Fallback Hotspot"
password: "9LTr2wl5WC6H"
captive_portal:
# Example configuration entry
web_server:
port: 80
# Example configuration entry
# Example configuration entry
switch:
- platform: gpio
pin: GPIO14
name: "Heater"
id: heater
on_turn_on:
- component.update: my_display
on_turn_off:
- component.update: my_display
time:
- platform: homeassistant
id: esptime
font:
- file: "gfonts://Silkscreen"
id: small
size: 10
- file: "gfonts://Roboto"
id: large
size: 24
- file: "gfonts://Silkscreen"
id: medium
size: 15
i2c:
sda: GPIO5
scl: GPIO4
scan: false
# manually setting the frequency to a higher rate may avoid long component updates
# frequency: 300kHz
sensor:
- platform: homeassistant
name: "Inside Temp"
entity_id: sensor.sensenode2_office_temperature
accuracy_decimals: 1
id: inside_temperature
- platform: homeassistant
name: "Outside Temp"
entity_id: weather.home
attribute: temperature
accuracy_decimals: 1
id: outside_temperature
text_sensor:
- platform: homeassistant
id: outside_temperature_unit
entity_id: weather.home
attribute: temperature_unit
- platform: homeassistant
id: inside_temperature_unit
entity_id: sensor.sensenode2_office_temperature
attribute: unit_of_measurement
display:
- platform: ssd1306_i2c
model: "SH1106 128x64"
id: my_display
address: 0x3C
update_interval: 3s
pages:
- id: page1
lambda: |-
it.printf(0, 0, id(small), TextAlign::TOP_LEFT, "Time and Temp");
//it.printf(0, 12, id(small), TextAlign::TOP_LEFT, "Temperature");
// Print time in HH:MM format
it.strftime(0, 60, id(large), TextAlign::BASELINE_LEFT, "%H:%M", id(esptime).now());
// Print inside temperature (from homeassistant sensor)
if (id(inside_temperature).has_state()) {
it.printf(127, 23, id(medium), TextAlign::TOP_RIGHT , "%.1f%s",
id(inside_temperature).state, id(inside_temperature_unit).state.c_str());
}
// Print outside temperature (from homeassistant weather)
if (id(outside_temperature).has_state()) {
it.printf(127, 60, id(medium), TextAlign::BASELINE_RIGHT , "%.1f%s",
id(outside_temperature).state, id(outside_temperature_unit).state.c_str());
}
- id: page2
lambda: |-
//State gpio output
//it.rectangle(0, 0, 126, 64);
it.printf(0, 0, id(large), TextAlign::TOP, "Relays");
it.printf(0, 30, id(medium), "Heater: %s", id(heater).state ? "ON" : "OFF");
interval:
- interval: 10s
then:
- display.page.show_next: my_display
- component.update: my_display

