tringler
(Tom)
November 23, 2021, 3:39pm
1
Hello,
I’m struggling to get data from HomeAssistant native API and present on my e-paper display - What I’m doing wrong here?
It results in compile error: error: no matching function for call to 'esphome::display::DisplayBuffer::print(int, int, esphome::display::Font*&, std::__cxx11::string&)'
display:
- platform: waveshare_epaper
rotation: 90
cs_pin: GPIO26
dc_pin: GPIO25
busy_pin: GPIO27
reset_pin: GPIO33
model: 2.90inv2
full_update_every: 30
lambda: |-
it.print(30, 10, id(my_font), "Klingelschild");
it.print(10, 60, id(my_font_small), id(outdoor_bell_additional_info_top));
it.print(10, 80, id(my_font_small), "Bitte Paket abstellen!");
it.print(10, 80, id(my_font_small), "Zusatzinfo");
text_sensor:
- platform: homeassistant
name: "outdoor_bell_additional_info_top"
entity_id: input_text.outdoor_bell_additional_info_top
id: outdoor_bell_additional_info_top
jsuanet
(Jos)
November 23, 2021, 4:05pm
2
You have to add “.state”
it.print(10, 60, id(my_font_small), id(outdoor_bell_additional_info_top).state);
tringler
(Tom)
November 23, 2021, 4:08pm
3
I also tried that. That produces:
/config/esphome/outdoor-bell.yaml: In lambda function:
/config/esphome/outdoor-bell.yaml:58:78: error: no matching function for call to 'esphome::display::DisplayBuffer::print(int, int, esphome::display::Font*&, std::__cxx11::string&)'
it.print(10, 60, id(my_font_small), id(outdoor_bell_additional_info_top).state);
jsuanet
(Jos)
November 23, 2021, 4:10pm
4
Can you post your complete yaml file.
tringler
(Tom)
November 23, 2021, 4:14pm
5
esphome:
name: outdoor_bell
platform: ESP32
board: esp32dev
wifi:
ssid: "TRUDI_IOT"
password: "censored"
manual_ip:
# Set this to the IP of the ESP
static_ip: 192.168.2.65
# Set this to the IP address of the router. Often ends with .1
gateway: 192.168.2.1
# The subnet of the network. 255.255.255.0 works for most home networks.
subnet: 255.255.255.0
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Outdoor Bell Fallback Hotspot"
password: "censored"
captive_portal:
# Enable logging
logger:
# Enable Home Assistant API
api:
password: "censored"
ota:
password: "censored"
spi:
clk_pin: GPIO18
mosi_pin: GPIO23
font:
- file: "fonts/BreeSerif-Regular.ttf"
id: my_font
size: 35
- file: "fonts/BreeSerif-Regular.ttf"
id: my_font_small
size: 18
display:
- platform: waveshare_epaper
rotation: 90
cs_pin: GPIO26
dc_pin: GPIO25
busy_pin: GPIO27
reset_pin: GPIO33
model: 2.90inv2
full_update_every: 30
lambda: |-
it.print(30, 10, id(my_font), "Klingelschild");
it.print(10, 60, id(my_font_small), id(outdoor_bell_additional_info_top).state);
it.print(10, 80, id(my_font_small), "Bitte Paket abstellen!");
it.print(10, 80, id(my_font_small), "Zusatzinfo");
text_sensor:
- platform: homeassistant
name: "outdoor_bell_additional_info_top"
entity_id: input_text.outdoor_bell_additional_info_top
id: outdoor_bell_additional_info_top
jsuanet
(Jos)
November 23, 2021, 4:26pm
6
Enter also a ".c_str() after “.state”
tringler
(Tom)
November 24, 2021, 10:59pm
7
Thanks so much! It’s working