tasmota lcd display free sample
The display driver is able to display predefined setups of text or user defined text. To display text using DisplayText set DisplayMode to 0, or set DisplayMode to 1 for the HT16K33 dot-matrix display.
To use the seven-segment-specific TM1637, TM1638 and MAX7219 Display- commands, set DisplayMode to 0. Parameter LCD Display OLED Display TFT Display 7-segment Display (TM163x and MAX7219) 0 DisplayText DisplayText DisplayText All TM163x Display- functions
The DisplayText command is used to display text as well as graphics and graphs on LCD, OLED and e-Paper displays (EPD). The command argument is a string that is printed on the display at the current position. The string can be prefixed by embedded control commands enclosed in brackets [].
In order to use the DisplayText command the DisplayMode must be set to 0 (or optional 1 on LCD displays) or other modes must be disabled before compilation with #undef USE_DISPLAY_MODES1TO5.
In the list below p stands for parameter and may be a number from 1 to n digits. On monochrome graphic displays things are drawn into a local frame buffer and sent to the display either via the d command or automatically at the end of the command.
Pfilename: = display an rgb 16-bit color (or jpg on ESP32) image when file system is present, Scripteditor contains a converter to convert jpg to special RGB16 pictures See ScriptEditor Ffilename: = load RAM font file when file system is present. the font is selected with font Nr. 5, these fonts are special binary versions of GFX fonts of any type. they end with .fnt. an initial collection is found in Folder BinFonts
Draw up to 16 GFX buttons to switch real Tasmota devices such as relays or draw Sliders to dimm e.g. a lamp Button number + 256 - a virtual touch toggle button is created (MQTT => TBT)
When a file system is present you may define displaytext batch files. If a file named "display.bat" is present in the file system this batch file is executed. The file may contain any number of diplaytext cmds, one at a line. You may have comment lines beginning with a ;
E-Paper displays have 2 operating modes: full update and partial update. While full update delivers a clean and sharp picture, it has the disadvantage of taking several seconds for the screen update and shows severe flickering during update. Partial update is quite fast (300 ms) with no flickering but there is the possibility that erased content is still slightly visible. It is therefore useful to perform a full update in regular intervals (e.g., each hour) to fully refresh the display.
The data sheets of the TFT and OLED displays mention burn-in effects when a static display is shown for extended periods of time. You may want to consider turning on the display on demand only.
The EPD font contains 95 characters starting from code 32, while the classic GFX font contains 256 characters ranging from 0 to 255. Custom characters above 127 can be displayed. To display these characters, you must specify an escape sequence (standard octal escapes do not work). The ~character followed by a hex byte can define any character code.
The I2C address must be specified using DisplayAddress XX, e.g., 60. The model must be specified with DisplayModel, e.g., 2 for SSD1306. To permanently turn the display on set DisplayDimmer 100. Display rotation can be permanently set using DisplayRotate X (x = 0..3).
E-Paper displays are connected via software 3-wire SPI (CS, SCLK, MOSI). DC should be connected to GND , Reset to 3.3 V and busy may be left unconnected. The jumper on the circuit board of the display must be set to 3-wire SPI.
Waveshare has two kinds of display controllers: with partial update and without partial update. The 2.9 inch driver is for partial update and should also support other Waveshare partial update models with modified WIDTH and HEIGHT parameters. The 4.2 inch driver is a hack which makes the full update display behave like a partial update and should probably work with other full update displays.
In black and white displays, a local RAM buffer must be allocated before calling the driver. This must be set to zero on character or TFT color displays.
Universal Display Driver or uDisplay is a way to define your display settings using a simple text file and easily add it to Tasmota. uDisplay is DisplayModel 17. It supports I2C and hardware or software SPI (3 or 4 wire).
Initial register setup for the display controller. (IC marks that the controller is using command mode even with command parameters) All values are in hex. On SPI the first value is the command, then the number of arguments and the the arguments itself. Bi7 7 on the number of arguments set indicate a wait of 150 ms. On I2C all hex values are sent to I2C.
bit 2: enable async DMA, 0 wait for DMA to complete before returning, 4 run DMA async in the background. This later mode is only valid if the SPI bus is not shared between the display and any other SPI device like SD Card Reader.
# Scripter is the nost convenient way to edit and develop a uDisplay driver. On every scripter save the display is reinitialized and you immediately see results of your changes.
There are also many variants of each display available and not all variants may be supported. #define directive Description USE_DISPLAY Enable display support. Also requires at least one of the following compilation directives
Tasmota is an open source firmware for the ESP8266 and ESP32. It is mostly used for home automation devices, but can also be loaded on any other ESP device. It comes with support for a wide range of peripherals "out of the box" and makes interacting with sensors via WiFi extremely easy as a result.
Download the ESP32 bootloader files from https://github.com/arendst/Tasmota-firmware/tree/main/static/esp32, the latest Tasmota firmware file, and then run:
Configure MQTT. Set the host as mqtt, port as 1883, topic as the device name, and the prefix as tasmota/%topic%/. The mqtt hostname resolves to the MQTT server and the IoT router allows MQTT traffic on port 1883 to leave the network to this server.
Rules are sets of commands that should run when a specific condition is met. They are a way to program user defined behaviors to Tasmota without needing to write real code and requiring a recompile. The ability to write rules allow for interesting behaviors between events, sensors, and peripherals, such as updating an attached display when sensor values change, or turning a light on when a specific condition is met.
Rules are defined within a rule set which allows similar rules to be grouped togoether. Out of the box, Tasmota has 3 rule sets called rule1, rule2, and rule3. Any number of rules can be placed in each set (though in actuality, it"s limited by the device"s memory. Tasmota"s documentation says each rule set can hold least 1000 bytes worth of rules). Each of the 3 rule sets can be enabled or disabled. When a rule set is enabled, all rules within it will be active and vice versa. The ability to toggle on or off entire sets of rules allows for some interesting behaviors which we will explore later on.
Frequently, we want to do something with a sensor reading. In the case of a CO2 monitor, we may want to update a display when the PPM value changes. To do this, we create a new rule within the rule1 set by the following command:
Tasmota supports the following comparison operators. Aside from the string based equality operators, I haven"t come across any of the other string operators in any rule examples yet.
To apply these rules, copy and paste the entire rule set and paste it as a command into Tasmota"s console. This multi-line rule set will be converted into a single line and compressed in memory by Tasmota.
There are a different set of supported peripherals out of the box depending on which Tasmota build you used. Refer to the BUILDS page at https://github.com/arendst/Tasmota/blob/development/BUILDS.md to determine if a particular feature is enabled. If it isn"t, you will need to compile Tasmota with the desired feature enabled using the users_config_override.h file placed in the Tasmota source directory.
All supported displays can be found at https://tasmota.github.io/docs/Displays/#supported-displays. You may need to tweak the Tasmota compile options and rebuild a firmware file for your particular display. Once Tasmota is able to see your display, you should be able to draw or write text to it using the common display commands that are included in Tasmota.
The SSD1306 is an OLED display that comes in various sizes. These displays use I2C. The Wemos D1 OLED module is one such device with a screen size of 64x48. Tasmota supports this display through the tasmota-displays.bin image or you may compile support in by creating a user_config_override.h file with:
After flashing Tasmota with the proper peripheral support, attach the display to the ESP8266 via I2C (GPIOs 4 and 5 for SDA/SCL on the ESP8266, or GPIOs 21 and 22 for SDA/SCL on the ESP32). Once connected, running i2cscan on the console should return the display device at address 0x3c.
The HD44780 family of LCD displays, which includes the 1602 LCD display, can be interfaced using a i2c adapter. After connecting the adapter to Tasmota via the i2c bus, you should be able to start drawing text to the display using the Displaytext command.
To get started, use the display Tasmotao firmware or compile Tasmota with USE_I2C, USE_DISPLAY options. Configure the display with the following commands:
You may have noticed that there are some letters in square brackets passed to the Displaytext command. These are options that control the behavior of where and how the text should be drawn and can control the font size and location of the text. For example, to print "Hello World" across two separate lines, we write hello on line 1 column 1 (l1c1) and world on line 2 column 1 (l2c1):
There are many other parameters which can be found at: https://tasmota.github.io/docs/Displays/#displaytext-use. The most important ones you should know are listed below. You may chain any number of these together and they will run in the order they appear. Eg. [zl1c1f0s1]Hello would clear, then write the world Hello in the smallest font on line 1 column 1.Command/parameter
With the power of Tasmota rules, we can trigger text to be written when a state changes. In the case of a CO2 monitor, we can create the following rule which clears and prints the PPM value on the first line of the display whenever the value changes.
Configure the GPIO pins for I2C as usual. If everything is working, Tasmota should being reporting the read voltage and current from the INA219 in the telemetry messages in addition to it being displayed on the web page. If no values are being reported, run i2cscan and confirm whether the device shows up on the bus and recheck wiring and the I2C GPIO pin configuration.
For my INA219 monitoring board, I also have a SSD1306 display. I use the following rules to show the values on the display. A button is also used to optionally turn the display on temporarily.
The INA219 can be adjusted to measure higher currents by changing the shunt resistor. The shunt resistor value can be defined by setting the value to Sensor13 (see: https://github.com/arendst/Tasmota/pull/7803).
To increase the range of the INA219 from the default 3.2A to 6.4A, we could add an additional 0.1Ω resistor in parallel to the existing one which would effectively halve the resistance to 0.05Ω. Update the resistance value in Tasmota by running Sensor13 51. This should automatically save to flash and reboot.
The ADC input pins can detect a voltage and convert it into a digital value. Tasmota has the option to read a ADC pin and convert the value into a luminance value measured in Lux.
On the hardware side, connect your LED to your ESP on PWM capable output pins. On Tasmota, configure the pin as "PWM" or "PWM_i" with each pin on a separate channel (1 as red, 2 as green, 3 as blue). You should use PWM if your pins will be sourcing current (for common-cathode lights) and PWM_i if your pins will be sinking current (for common-anode lights). Ensure that SetOption68 is disabled so that all 3 channels are treated as a single light.
Compile instructions are available at https://tasmota.github.io/docs/Compile-your-build/. The simplest way for me was to use their Docker image which uses platform.io to do the builds. To get started, run:
What you want to build is controlled by the environment (provided by the -e option). A list of all available environments can be found in the platformio.ini file. By default, if no environment is specified, it will build everything for you. For a standard Tasmota firmware, use the tasmota environment.
To include additional drivers (like displays, sensors, etc), edit the tasmota/my_user_config.h file and uncomment (to add) or comment out (to remove) each feature as desired. Be aware that Tasmota groups features together and you may need to enable an entire group of features (eg. displays, power monitoring) for a specific feature to become included.
Problem: The LCD 2004 or LCD 1602 Display, for which the Tasmota LCD driver was written, uses a different wiring between the i2c expander (PCF8574) and the HD44780 Display.
I uses a PCF8574A where the address lines are set to 0, so I also have to patch the LCD_ADDRESS2 i2c bus address in xdsp_01_lcd.ino from 0x3F to 0x38.
In my_user_config.h enable USE_I2C, USE_DISPLAY_LCD, USE_DISPLAY, USE_DISPLAY_MODES1TO5 and comment all i2c devices which uses the same i2c address. Otherwise a i2c address conflict could happened which prevent Tasmota from recognizing the Display (i2cscanreturns an error). I also activate Script expressions and if statements.
Ok, time to build the firmware. Get tasmota and the patch (created with git format-patch HEAD~1 –stdout). Patch is written for 9.3.1 (cmmmit 92c0eb000) but if there are no breaking changes it should also run on newer versions.
Setup the basic config (WiFi, MQTT..), open the Webfrontend and go to the (web) console. If the LCD display is recognized there should be such an entry:
First and foremost, you need to build a binary that supports the screen and touch drivers. Support for Lanbon L8 in Tasmota has been added recently and you will need to build from the latest development release of Tasmota.
Build using tasmota32 environment. You can already use PlatformIO to flash to ESP32 or esptool.py. If using esptool.py you need all the necessary files and this set of options:
esptool.py --chip esp32 --port
This script will give you three basic touch buttons that are linked to the relay. You can change the labels and colors used in the script. See Tasmota displays documentation on which parameters to use.
With Tasmota you have a working touch screen and its backlight, relays are controllable and ambient LEDs behave as any RGB light in Tasmota. Analog temperature measurements are too high which needs some tweaking.
Great! Most of the features are working fine but the UI isn’t really much of an improvement and it is behaving a bit sluggish. Not a clear victory, but an improvement, at least now all the entities are discovered in Tasmota Home Assistant integration and work as they should.
Shortly after publishing the review of Lanbon L8 I was contacted by fvanroie through Discord. He wanted me to look at his project built for LCD touch screens running on ESP8266 and ESP32: openHASP.
One caveat is that you need a home automation system that will handle all the logic and update or redraw the objects. That some extra work, amount depending on the platform you use, but ultimately it pays off since you get a highly customisable and beautiful touch UI to display almost anything you’d want to in a way you want to.
It is good to know there are better options than what originally came with the switch. You can choose between the incredible customizability of openHASP, tight integration of Tasmota with more basic UI and I believe that esphome will catch up easily if there’s interest.
If you would like to build a web server displaying readings from multiple sensors, follow the next tutorial: ESP32 Plot Sensor Readings in Charts (Multiple DS18B20 Sensors)
This is a never-ending story about Theo Arends’s much-loved alternative firmware for IOT (http://ota.tasmota.com/tasmota/tasmota.bin.gz) as Tasmota is now at stable release version 8.5.1 “Hannah” (update October 2, 2020) and development version 9.0.0.1– I’ve upgraded my various ESP8266-based devices including Itead Sonoff BASIC, TH10, 4CH Pro, ProR2, Powr2, Shelly One, Blitzwolf and others). Warning, there are SOME devices out there which cannot accept Tasmota or other alternative firmware. My overall advice would be to avoid them where possible unless you wish to rely on cloud services). This entry will assume you want local control of devices.
Well, as, until recently in the UK, the bars were closed and we still can’t really travel freely over there, sitting at home updating Tasmota seems a sensible (and safe) way to pass time. Be sure to check the Tasmota docs site for upgrades etc. and for COMMANDS in Tasmotago here.
Noteably, with Tasmota “Elliot”, we can now leave off all sensor checking if we don’t have any sensors – and the number of .bin file permutations has gone up… and I’ve just added a DHT22 sensor to a Sonoff Basic board (rev 2, the ones currently going for a song). I used gnd, 3v3 and RX pins on the 4 way header and included a 10k pullup for the data line. For this I used tasmota-sensors.bin – if I were not using any sensors I’d use tasmota-lite.bin
The new Tasmota docs site replaces the older WIKI and there is also a new flasher utility therein. Firstly we have the updates to Tasmota itself (9.0.0.1 development version) and the Tasmota Device Manager software (TDM)version 0.2.6 and now TASMOTIZE as a Windows executable (tasmotizer-1.2.exe) – for flashing Tasmota onto various IOT devices. But not just flashing – EASY flashing – with WIFI, MQTT and module setup all in the same place. For TDM, if you want the Windows EXE versions then head directly to theRELEASES page.
I grabbed TASUIon Dec 21, 2019 but not done a lot with it… http://tasui.shantur.com – and what is THAT I hear you ask? Well, it is a web-browser based UI for Tasmota devices – apparently for Tasmota 7.0.2.4 or later so please don’t bother until you update your devices… my friend Antonio confused the hell out of me by referring to “CORS http://tasui.shantur.com” – what is that I asked. Well if you want to have a play, just take that text without the quotes, paste it into the CONSOLE in one or more of your Tasmota-equipped devices to test – and immediately they know about this new UI (even after a reboot). In a browser on your local network, enter the link (top of this para) and the UI will start up.
Let’s back-track for a second for those new to the subject… when it comes to controlling devices from simple WIFI-controlled on-off switches through to RGB lighting, LCD displays and so on, Tasmota is one of several free firmware alternatives to the almost endemic numbers of (largely) cloud-based IOT solutions. I should point out that font support remains very limited in Tasmota (Feb 2021).
For obvious commercial reasons, many manufacturers of IOT products would like us to use their own proprietary solutions, often relying on their own control APPS and cloud-based storage/control. Some folk don’t trust cloud-based solutions (for a variety of reasons). Another issue is that every manufacturer seems to have their reasons why you should use THEIR cloud solution. I’m happiest with local control (Tasmota most of the time for ESP8266 – and using Node-Red on a Raspberry Pi for my central controller).
Tasmota started off as an alternative to control Itead Sonoff and other boards, something you could (can) freely download and “flash ” onto said boards and then either control your devices via simple web commands or something like MQTT. There are other solutions: “Espurna” comes to mind as well as “ESP-GO”. The latter is covered extensively earlier in this blog and I spent many months developing this with help from Aidan Ruff and others.
Recently, Tasmota has been coming on in leaps and bounds and is now THE dominant alternative IOT (ESP82666) device firmware as it now supports a WIDE variety of IOT WIFI-controlled devices not to mention Zigbee and features which are growing constantly.
SO, here we are, Tasmota can be installed on, for just one example, Itead Sonoff BASIC (110v-220v power control) boards and used to control them over WIFI, even adding lots of different sensors for the more ambitious. In my case this is all controlled centrally using a Raspberry Pi running Node-Red and MQTT protocol. Others may prefer to control devices directly via a browser as the Tasmota WebUI is in fact excellent.
What’s new? Well, Tasmota now offers support for a LOT of devices, has a NICE interface as well as TASMOTA DEVICE MANAGER (TDM), a new website putting it all together, TASMOTIZER, software to easily FLASH (program) boards with Tasmota – and it is all getting easier by the day. And NOW we have TasUI – lovely.
Tasmota is easy to install on various devices using (in some cases TUYA-CONVERT or a serial convertor (FTDI) and is also easily upgradeable “LIVE” via OTA – I have many devices, some hidden away in the loft, some in another country – all of which I can now safely update while they are running using TDM – which in my case runs on Windows 10.
Talking of devices in another country – especially one with less than perfect electric power – you should be aware in the Tasmota commands referred to above – SETOPTION commands… “setoption 13 1” disables special button tricks like long press and double press – always do that (once only, non-volatile) if you don’t NEED that. Another non-volatile command “SETOPTION65 1” – set this once a controller is in place and working – the option defaults to 0 to get you out of a jam if you tend to mess up passwords etc, but can also result in Tasmota returning to default settings after repeated power cycling. Set “SETOPTION65 1” to STOP this from happening.
Tasmota adds many new features, and allows you to integrate Sonoffs into an existing home automation system without relying on external cloud services. It includes MQTT support, Belkin WeMo emulation, easy configuration using a web browser, and you don’t even need a compiler or IDE to install it.
Note: Since this video was released, the Tasmota project has changed its build process so that the binaries are now called “tasmota” instead of “sonoff”. I have edited the text instructions below to match, but screenshots and the video still refer to the old name.
The Tasmota firmware and its documentation is available at github.com/arendst/Sonoff-Tasmota, including both firmware and pre-compiled binary releases. If you want to compile the code yourself that’s fine, but you don’t need to if you just want the latest version. The binary releases are at:
The binaries with 2-letter country codes appended, such as “tasmota-IT.bin”, have the exact same functionality as the standard “tasmota.bin” but with different languages for the user interface. If you want to run Tasmota in a language other than English, select the appropriate “tasmota-XX.bin” file.
I prefer to rename the binary file so that it includes the release version, such as “tasmota-8_4_0.bin”. That way if I come back to it later, I can see what version I downloaded.
Open a terminal, and go into the directory where you have the Tasmota binary. Use esptool to push it to the Sonoff using the serial port location that you found earlier:
Disconnect the Sonoff power power, then reconnect it. When the Tasmota firmware starts up and doesn’t find any existing configuration, it goes into a setup mode and creates its own WiFi network. The network will have a name similar to “Tasmota-6392”, with the 4 digits based on the last part of the unique MAC address of the Sonoff hardware.
Tasmota can use the button on the Sonoff to put it into special modes. If you quick-press the button 4 times, it will restart the setup process and create its own WiFi network again just like in step 7. Then you can connect to its WiFi, and give it new details so it can connect to your main WiFi network again. Your other settings will be retained so you don’t need to set them again.
If you press and hold the button for more than 40 seconds, Tasmota will clear all its settings, reboot, create a WiFi network, and begin the setup process from scratch.
If you want to keep the option of returning the Sonoff to factory-original condition, you can download the original firmware out of its flash memory and save it for later use. Obviously this has to be done BEFORE you flash Tasmota onto it!
Later, if you change your mind and want to put the original firmware back in place, you can follow the normal steps for installing Tasmota but instead use the file you saved. The command will look similar to this, but with your serial port address substituted:
While searching the Internet for a battery monitor for DC voltages, I came across the PZME-017. The Peacefair company is known for various inexpensive battery monitors with LCD displays such as the PZEM-015.
In contrast to the PZEM-015, the PZEM-017 has no display and transmits the measurement data via the Modbus. The Modbus protocol is open and there are some implementations with an arduino. The website is an example here Solarduino called. There, however, a TTL-RS485 adapter is used to connect to the Arduino. In the area of home automation there are implementations with a Wemos D1 mini (ESP8266) with Tasmota firmware and a data connection via WiFi. However, it cannot be used well as a battery monitor on a boat, as you still need an external power supply of 5V for the Wemos D1 mini.
Energy display in kWh for the current day, previous day and total consumption display (not power off resistant when completely switched off, details look here)
The current version of the Tasmota firmware can be downloaded here: http://ota.tasmota.com/tasmota/release/ The firmware is available in different language versions. The tasmota.bin file would be a good choice for English-language firmware. If you want to know more about Tasmota, you can visit this website: https://www.tasmota.info There you will find detailed information about supported hardware and flashing.
The Tasmota firmware is universal and supports a variety of devices. With the configuration, the firmware is adapted to the specific hardware. After flashing, the Wemos D1 mini starts with its own access point, which can be reached under the SSID tasmota_xxxxxx. A password for logging into the WiFi network is not required. The start page can be opened with a web browser under the IP address 192.168.4.1. The respective settings are made under Configuration as shown in the following images.
Up to 3 temperature sensors can be connected in parallel to the 1-Wire port. The sensors can be used, for example, to measure the temperature of the battery, the charger, the solar regulator or the inverter. Any other application would also be conceivable. The Tasmota firmware will automatically detect the additional temperature sensors and display the temperature values below the values from the battery monitor. The assignment of the sensors to the IDs must be found out by testing the sensors.
By default, the Tasmota firmware only shows the voltage without decimal places. Up to two decimal places can be displayed if you enter the following command in the console:
If you want to access this data on third-party websites, you have to CORS (Cross Origin Resource Sharing) in the Tasmota firmware. This is done with the following command via the console:
The measured values can also be integrated into SignalK and can then be displayed via the instrument panel. How the configuration works in detail is described here:
The power consumption of the battery monitor can be reduced quite significantly to 1.0 mA at 12 V if the Wemos D1 mini can be switched off using a small switch (red cable 3.3V). The original measuring circuit then continues to run in the switched-off state and counts the power consumption. Only data transmission and display of the measurement data is then no longer possible. After switching on the supply voltage, all data are transmitted again and displayed correctly. This is very useful when you are not on the boat, so as not to discharge the battery.
If you also want to measure the consumption data of the AC shore connection, you can do this with the Sonoff Pow Power Monitoring Switch with the Tasmopta firmware do. The shore connection can also be switched on and off via the module. The newer variant is the Sonoff Pow R2. It has a larger range of functions and can display more measured values and react to limit values. An ESP8266 is already built into these two devices and is only operated with the Tasmota firmware. A modification of the electronic circuit is not necessary as with the battery monitor. The Sonoff Pow R2 is therefore a good addition to the battery monitor.
https://github.com/arendst/Sonoff-Tasmota - Provides ESP8266-based Sonoff-Tasmota firmware for iTead Sonoff, Wemos and NodeMCU hardware with Web, MQTT and OTA firmware using Arduino IDE or PlatformIO - See http://thehackbox.org/tasmota/ for more info on Sonoff-Tasmota
Allows Tasmota Device manager (tdmgr), which is a python GUI application to run in a docker container, and uses noVNC (HTML5 web based VNC client) to let you view tdmgr remotely.
Tasmota rules to update to MQTT the status of a washer and dryer, based on power monitoring (Using Sonoff POW V2 devices). Automation rules use this to notify my phone when the washer or dryer have finished.
Use of a Viewsonic VPC101 All-in-one PC as a home automation display (Home Assistant) running Debian and getting the touch screen working and calibrated