Help ESPHome Oled darksky sensor (SOLVED)

Hi, I wanted to know what was the formula to make a text sensor appear on an oled screen, as far as numeric sensors are concerned no problem, but I don’t know what formula to use for sensor.darksky_summary

1 Like

Thanks, I had already read it, in fact I can easily extract a numeric value from the sensor if it shows a numeric value, but I can’t extract a string of characters and make it appear on the screen if the sensor reports a non-numeric value!

I’ll have a play.

Actually this cookbook example seems to deal with it…

Thank you very much, this will be the article on which I had based my project, but I had missed the part at the bottom.

I tried but now it returns this error

src/main.cpp:778:85: error: request for member ‘c_str’ in ‘meteo_oggi->esphome::homeassistant::HomeassistantSensor::.esphome::sensor::Sensor::state’, which is of non-class type ‘float’

this is the code

it.printf(0, 32, id(font4), TextAlign::TOP_CENTER, “Meteo: %s”, id(meteo_oggi).state.c_str());

SOLVED

changed
sensor:
to
text_sensor:

Thanks nickrout

I also same problem, If you have afford to open your code, can I see your full yaml file ?

I solved it, I wrote wrong Character, thx for your information nickrout and echopage

1 Like