How to get temp and hum on an oled Home Assistant?

What’s the actual error?

I get it to work, with only the display, or only the dht22, but dropping the dht22 is no an option, since that is the goal with the project… so i think i don’t have enough ram, and i’m trying to shorten the code as much as i can, but still to large…

ill post it here when i get it :slight_smile: error 9 if i remember correct

now i get this: *** [.pioenvs/dht22/src/esphome/components/captive_portal/captive_portal.o] Source src/esphome/components/captive_portal/captive_portal.cpp' not found, needed by target .pioenvs/dht22/src/esphome/components/captive_portal/captive_portal.o’.

I have an unused arduino uno laying around, you think that one can run all this?
web_server paragraf uses ALOT of ram i found out…

Well, yeah. You removed captive_portal, but there is still references to it.
Do a clean build

I thought clean build was only to erase the text and start over xD now i have done it, i will come back with how it went…

Now i’m trying everything you told me and will start compiling and come back to you with the results :slight_smile: I appreciate you’re help :stuck_out_tongue:
one question… if i only change one line or one letter in the yaml, i chose the install, it takes so long time, like 45 min or more… like 1000 compilings that takes for ever, even if I change just one letter or the whole code.

Compiling esphome on, e.g., a rpi will always take ages.
ESPHome is best hosted on a decently powerful PC/server, but that’s an endeavor for another day :wink:

Okok, thank you, just what i thought, I run it on an rasberry pie 3, and I calculated a little on this, and if my calculation are correct, my pi is actually on the “line” of being supported for haos, Haos can barely be run on it, i will install it on an old laptop i have when i’m successful with the dht sensor code…

something is wrong :S
Now i got all the way to finish without error with the SAME code i used, only with “clean build” but now nothing works!
The only differents is i changed: esp32: board: seeed_xiao_esp32c3 variant: ESP32C3 framework: type: esp-idf
from: esp32: board: esp32-c3-devkitm-1 variant: esp32c3 framework: type: esp-idf

since it is the right one… I have the Xiao esp32c3 not the dev kit

I will try with the dev kit settings again, only prob is every time i want to change like i said only a letter, i have to wait 4820 seconds! going to take me like a month to get haos to work xD

Ok? wtf??? Now it working!!! i only did an firmware update and everything just clicked for some reason… Now all i have to be able to do is: Get the temperature and the humidity on the oled display…

esphome:
  name: hemmis
  friendly_name: hemmis

esp32:
  board: seeed_xiao_esp32c3
  variant: ESP32C3
  framework:
    type: esp-idf

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: "6Q6KlUXNo/sFmWFl95FQ9w+xrD0wGvPkI9nhIRYOKbo="

ota:
  password: "3e0cf106f66397e5c25b617030953960"

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

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

captive_portal:
web_server:
sensor:
  - platform: dht
    model: AUTO_DETECT
    pin: 2
    temperature:
      name: "Temperature"
    humidity:
      name: "Humidity"
    update_interval: 15s
i2c:
  sda: GPIO6
  scl: GPIO7
  scan: False

display:
  - platform: ssd1306_i2c
    model: "SSD1306 128x64"
    address: 0x3C
    lambda: |-
      it.print(0, 0, id(font1), "Hello World!");
font:
  - file: 'Roboto-Regular.ttf'
    id: font1
    size: 12
    
sensor:
  - platform: dht
    id: dht_sensor
    lambda: |-
        it.printf(0, 0, id(font1), TextAlign::TOP_LEFT, "%.1f°", id(dht_sensor).state);

I have never been on a new system that is this troubling… get errors no matter what changes, do one change new error another and so on…

Now i have: /config/esphome/hemmis.yaml: In lambda function:
/config/esphome/hemmis.yaml:52:67: error: expected primary-expression before ‘-’ token
it.printf(0, 0, id(font1), TextAlign::TOP_LEFT, “%.1f°”, id(dht-sensor).state);
^
/config/esphome/hemmis.yaml:52:74: error: expected primary-expression before ‘)’ token
it.printf(0, 0, id(font1), TextAlign::TOP_LEFT, “%.1f°”, id(dht-sensor).state);
^
*** [.pioenvs/hemmis/src/main.o] Error 1
========================= [FAILED] Took 116.88 seconds =========================

I’m biting myself in the tongue here, trying to be as patience i can be, but it’s really frustrating, when someone tell me about this great haos system that makes everything easier , and all i want, is to show the temp and hum on an oled xD
And even that takes like 20 people trying on 4 different forums, 100 different errors, and still havent got this to work… and i have like 15 more project i wanted to do, jesus …

/config/esphome/hemmis.yaml: In lambda function:
/config/esphome/hemmis.yaml:53:73: error: ‘class esphome::dht::DHT’ has no member named ‘state’; did you mean ‘update’?
it.printf(0, 0, id(font1), TextAlign::TOP_LEFT, “%.1f°”, id(dht_sensor).state);
^~~~~
update

I couldn’t use dht_sensor for some strange haos reason… i just changed it to dhtt and id dhtt and now im compiling xD frustrating…

new error … no member names state did you mean update? xD