OT: I’m not sure if you’re being serious, or completely unaware of how helpful others have been to you. koying posted 19 replies within 3 days to your 38 40 messages to help you. Posting a complaint after 4 minutes of not receiving an answer is not going to encourage anyone to help you.
back to the issue:
Post your full yaml after the last changes, so we can check on it.
annyway… I think im on to something now… I completely diddn’t think about chatgpt… Asked gpt:hi i want to get an dht22 sensor reading humidity and temperature on an oled display: this is the code i have in the yaml: esphome:
here is the code… `esphome:
name: temp_and_hum_sensor
platform: ESP32
board: seeed_xiao_esp32c3
I wouldn’t say that, chatgpt is not perfect, does alot of mistakes, but if you use it correctly it can be a gift from above :
But i have not got it yet…
(from all i have learned from haos and esp last weeks, I’m 90 percent sure something wont work this time either, waiting for an error, but who knows…
/config/esphome/hemmis.yaml: In lambda function:
/config/esphome/hemmis.yaml:67:64: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings]
return {std::sprintf(“%.1f°C”, id(temperature_sensor).state)};
^
/config/esphome/hemmis.yaml:67:59: error: cannot convert ‘float’ to ‘const char*’
return {std::sprintf(“%.1f°C”, id(temperature_sensor).state)}; ^
In file included from /data/cache/platformio/packages/toolchain-riscv32-esp/riscv32-esp-elf/include/c++/8.4.0/cstdio:42,
from /data/cache/platformio/packages/toolchain-riscv32-esp/riscv32-esp-elf/include/c++/8.4.0/ext/string_conversions.h:43,
from /data/cache/platformio/packages/toolchain-riscv32-esp/riscv32-esp-elf/include/c++/8.4.0/bits/basic_string.h:6400,
from /data/cache/platformio/packages/toolchain-riscv32-esp/riscv32-esp-elf/include/c++/8.4.0/string:52,
from /data/cache/platformio/packages/toolchain-riscv32-esp/riscv32-esp-elf/include/c++/8.4.0/stdexcept:39,
from /data/cache/platformio/packages/toolchain-riscv32-esp/riscv32-esp-elf/include/c++/8.4.0/array:39,
from src/esphome/components/api/api_noise_context.h:3,
from src/esphome/components/api/api_frame_helper.h:13,
from src/esphome/components/api/api_connection.h:3,
from src/esphome.h:3,
from src/main.cpp:3:
/data/cache/platformio/packages/toolchain-riscv32-esp/riscv32-esp-elf/sys-include/stdio.h:244:32: note: initializing argument 2 of ‘int sprintf(char*, const char*, …)’
int sprintf (char *__restrict, const char *__restrict, …)
^~
/config/esphome/hemmis.yaml:67:65: error: could not convert ‘{}’ from ‘’ to ‘esphome::optional<std::__cxx11::basic_string >’
return {std::sprintf(“%.1f°C”, id(temperature_sensor).state)};
^
/config/esphome/hemmis.yaml: In lambda function:
/config/esphome/hemmis.yaml:73:60: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings]
return {std::sprintf(“%.1f%%”, id(humidity_sensor).state)};
^
/config/esphome/hemmis.yaml:73:55: error: cannot convert ‘float’ to ‘const char*’
return {std::sprintf(“%.1f%%”, id(humidity_sensor).state)};
~^
In file included from /data/cache/platformio/packages/toolchain-riscv32-esp/riscv32-esp-elf/include/c++/8.4.0/cstdio:42,
from /data/cache/platformio/packages/toolchain-riscv32-esp/riscv32-esp-elf/include/c++/8.4.0/ext/string_conversions.h:43,
from /data/cache/platformio/packages/toolchain-riscv32-esp/riscv32-esp-elf/include/c++/8.4.0/bits/basic_string.h:6400,
from /data/cache/platformio/packages/toolchain-riscv32-esp/riscv32-esp-elf/include/c++/8.4.0/string:52,
from /data/cache/platformio/packages/toolchain-riscv32-esp/riscv32-esp-elf/include/c++/8.4.0/stdexcept:39,
from /data/cache/platformio/packages/toolchain-riscv32-esp/riscv32-esp-elf/include/c++/8.4.0/array:39,
from src/esphome/components/api/api_noise_context.h:3,
from src/esphome/components/api/api_frame_helper.h:13,
from src/esphome/components/api/api_connection.h:3,
from src/esphome.h:3,
from src/main.cpp:3:
/data/cache/platformio/packages/toolchain-riscv32-esp/riscv32-esp-elf/sys-include/stdio.h:244:32: note: initializing argument 2 of ‘int sprintf(char*, const char*, …)’
int sprintf (char *__restrict, const char *__restrict, …)
^~
/config/esphome/hemmis.yaml:73:61: error: could not convert ‘{}’ from ‘’ to ‘esphome::optional<std::__cxx11::basic_string >’
return {std::sprintf(“%.1f%%”, id(humidity_sensor).state)};
^
/config/esphome/hemmis.yaml: In lambda function:
/config/esphome/hemmis.yaml:80:7: error: ‘it’ was not declared in this scope
it = id(oled_display).get_text_draw(0);
^
/config/esphome/hemmis.yaml:80:7: note: suggested alternative: ‘int’
it = id(oled_display).get_text_draw(0);
^
int
/config/esphome/hemmis.yaml:80:26: error: ‘class esphome::ssd1306_i2c::I2CSSD1306’ has no member named ‘get_text_draw’; did you mean ‘get_text_bounds’?
it = id(oled_display).get_text_draw(0);
^~~~~
get_text_bounds
/config/esphome/hemmis.yaml:83:21: error: ‘class esphome::ssd1306_i2c::I2CSSD1306’ has no member named ‘async_display’; did you mean ‘display’?
id(oled_display).async_display();
^~~~~~~~~~~~~
display
*** [.pioenvs/hemmis/src/main.o] Error 1
========================= [FAILED] Took 111.50 seconds =========================
now i get : /config/esphome/hemmis.yaml: In lambda function: /config/esphome/hemmis.yaml:80:33: error: 'class esphome::ssd1306_i2c::I2CSSD1306' has no member named 'get_preparer'; did you mean 'set_writer'? auto draw = id(oled_display).get_preparer(); ^~~~~~~~~~~~ set_writer /config/esphome/hemmis.yaml:81:38: error: 'OLED_COLOR_BLACK' was not declared in this scope draw->fill_rect(0, 0, 128, 64, OLED_COLOR_BLACK); ^~~~~~~~~~~~~~~~ /config/esphome/hemmis.yaml:81:38: note: suggested alternative: 'LOG_COLOR_BLACK' draw->fill_rect(0, 0, 128, 64, OLED_COLOR_BLACK); ^~~~~~~~~~~~~~~~ LOG_COLOR_BLACK /config/esphome/hemmis.yaml:82:27: error: 'FONT_FACE' was not declared in this scope draw->set_text_font(FONT_FACE("Roboto-Regular.ttf", 12)); ^~~~~~~~~ /config/esphome/hemmis.yaml:83:28: error: 'OLED_COLOR_WHITE' was not declared in this scope draw->set_text_color(OLED_COLOR_WHITE); ^~~~~~~~~~~~~~~~ /config/esphome/hemmis.yaml:83:28: note: suggested alternative: 'LOG_COLOR_I' draw->set_text_color(OLED_COLOR_WHITE); ^~~~~~~~~~~~~~~~ LOG_COLOR_I *** [.pioenvs/hemmis/src/main.o] Error 1