Hi
Is it that you want to know how the printf works.
You need to tell printf what to print out. You need a string with an marker that tells you where to write the id(level).state.
it.printf(100, 20, id(font2), TextAlign::TOP_RIGHT , "%.1f" ,id(level).state);
This is how I used it for a project.
it.printf(100, 20, id(font2), "%.1f" ,id(level).state);
This should print out the value with one decimal. I you want more change it to 2 for two decimals or 0 for no decimals.
@birchman you are perfectly correct, however I don’t think level is actually what he wants to print. He surely wants to print the calculated value from the template sensor.
However that sensor seems to be wrongly configured. Pretty hard to see the code when the advice to format it properly isn’t taken, but entity_id: does not seem to be an option for a template sensor in esphome. In fact it looks more like a home assistant template sensor than an esphome template sensor.