
The rendering engine is always first specify the x coordinate and then the y coordinate. X always represents the horizontal axis (width) and y the vertical axis (height). Also, all points in this coordinate systemĪre a pair of integers like 50, 50 which represent the shift to the right and shift downwards. The top left is always the origin of the pixel coordinate system. This already highlights one of the things you must learn before diving into writing your own custom display code:

Rotation: option to rotate the display to your liking) Line which starts at the top left and goes a few pixels down at a 45° angle. If you compile and upload the configuration above, you should see a black (or white, depending on the display) Otherwise you will be greeted by a long error message at the compilation stage. Lambdas are essentially just a lightly modified version of C++. Lambdas are additionally passed a variable called it which represents the rendering engine object. In the lambda, you can write code like in any lambda in ESPHome. This behavior by setting auto_clear_enabled: false. In each cycle, the display is automatically cleared before the lambda is executed. Option called lambda: which will be called every time ESPHome wants to re-render the display. So, first a few basics: When setting up a display platform in ESPHome there will be a configuration Please note that this only applies to displays that can control each pixel

In this section we will be discussing how to use ESPHome’s display rendering engine from ESPHomeĪnd some basic commands. So when you want to write some text or sensor values to the screen you will be writing in C++ codeīe simple and to be used without programming experienceīut also be flexible enough to work with more complex tasks like displaying an analog clock. To achieve all this flexibility displays tie in directly into ESPHome’s lambda system.


Many things like draw some basic shapes, print text with any font you want, or even show images. Text based displays like 7-Segment displays orĭisplays like the Nextion TFT LCD Display that have their own processors for rendering.īinary displays which can toggle ON/OFF any pixel, like E-Paper displays orįor the last type, ESPHome has a powerful rendering engine that can do Fundamentally, there are these types of displays: The display component houses ESPHome’s powerful rendering and displayĮngine.
