Hello, I’m desperate!
I’ve tried and learned so many things now.
I have an Oled display ssd1351 on an ESP32, which also runs. I also see a DHT22 and its values.
How do I get this sensor data on the display?
I suspect the sensor outputs need to be converted to float. But no matter what I try, it doesn’t work.
captive_portal:
sensor:
- platform: dht
model: DHT22
pin: GPIO26
temperature:
id: "temp"
name: "dhttemp"
# update_interval: 5s
spi:
clk_pin: GPIO18
mosi_pin: GPIO23
color:
- id: farbe
red: 3%
green: 100%
blue: 5%
font:
- file: "gfonts://Roboto"
id: form
size: 20
display:
- platform: ssd1351_spi
model: "SSD1351 128x128"
reset_pin: GPIO0
cs_pin: GPIO5
dc_pin: GPIO15
lambda: |-
it.printf(10, 10, id(farbe), id(temp).state);
# it.print(20, 10, id(form), id(farbe), "!!TEST!!");
# it.rectangle(0, 0, it.get_width(), it.get_height(), id(farbe));
output
/config/esphome/esphome-web-916f2c.yaml: In lambda function:
/config/esphome/esphome-web-916f2c.yaml:63:43: error: no matching function for call to 'esphome::display::Display::printf(int, int, esphome::Color&, float&)'
it.printf(10, 10, id(farbe), id(temp).state);
^
In file included from src/esphome.h:18,
from src/main.cpp:3:
src/esphome/components/display/display.h:256:8: note: candidate: 'void esphome::display::Display::printf(int, int, esphome::display::BaseFont*, esphome::Color, esphome::display::TextAlign, const char*, ...)'
void printf(int x, int y, BaseFont *font, Color color, TextAlign align, const char *format, ...)
^~~~~~
src/esphome/components/display/display.h:256:8: note: candidate expects 6 arguments, 4 provided
src/esphome/components/display/display.h:268:8: note: candidate: 'void esphome::display::Display::printf(int, int, esphome::display::BaseFont*, esphome::Color, const char*, ...)'
void printf(int x, int y, BaseFont *font, Color color, const char *format, ...) __attribute__((format(printf, 6, 7)));
^~~~~~
src/esphome/components/display/display.h:268:8: note: candidate expects 5 arguments, 4 provided
src/esphome/components/display/display.h:279:8: note: candidate: 'void esphome::display::Display::printf(int, int, esphome::display::BaseFont*, esphome::display::TextAlign, const char*, ...)'
void printf(int x, int y, BaseFont *font, TextAlign align, const char *format, ...)
^~~~~~
src/esphome/components/display/display.h:279:8: note: candidate expects 5 arguments, 4 provided
src/esphome/components/display/display.h:290:8: note: candidate: 'void esphome::display::Display::printf(int, int, esphome::display::BaseFont*, const char*, ...)'
void printf(int x, int y, BaseFont *font, const char *format, ...) __attribute__((format(printf, 5, 6)));
^~~~~~
src/esphome/components/display/display.h:290:8: note: no known conversion for argument 3 from 'esphome::Color' to 'esphome::display::BaseFont*'
*** [.pioenvs/esphome-web-916f2c/src/main.cpp.o] Error 1