Skip to content

Plugin lcd display

Martin Pihrt edited this page Oct 13, 2026 · 1 revision

LCD Display

Displays OSPy status information on a 16x2 HD44780 LCD through a PCF8574 I2C expander.

At a glance

Item Value
Version 1.0.2
Category Hardware, displays and outputs
Author Martin Pihrt
License GPL-3.0
OSPy 3.0.211 or newer
Python 3.8 or newer
Permissions i2c
Hardware platforms: raspberry_pi, beaglebone, linux; interfaces: i2c
Dependencies None
Python/OS packages smbus / python3-smbus (required)
Interfaces Mobile API v1
Source Open the plug-in directory

What it is for

Displays OSPy status information on a 16x2 HD44780 LCD through a PCF8574 I2C expander.

How it works and how to configure it

Version 1.0.1 disconnects all OSPy signal receivers when the plug-in worker stops, preventing stale callbacks after a plug-in restart.

Tested in Python 3+

This plugin shows information on 16x2 character LCD with PCF8574. Automatically detects the display at the following I2C addresses: 0x20-0x27, 0x38-0x3F. Compatible with the HD44780 controller.

The plug-in includes an OSPy plugin.json manifest, uses the shared plug-in runtime and implements health(). Diagnostics reports whether the display function and worker are running, the detected I2C address, the last successful LCD update and the most recent I2C error. A temporarily busy shared I2C bus is reported as a warning; a persistent write error is reported as an error.

Plugin setup

  • Check Use I2C LCD: If checked use I2C lcd plugin is enabled and print messages on the LCD display.

  • HW version I2C PCF8574<->LCD: Select type Hardware board with PCF8574. Conection with LCD driver: a) Lower 4 bits of expander are commands bits b) Top 4 bits of expander are commands bits AND P0-4 P1-5 P2-6 (Use for LCD1602 board) c) Top 4 bits of expander are commands bits AND P0-6 P1-5 P2-4 d) LCD1602 board where lower 4 are commands, but backlight is pin 3 e) LCD board (https://pihrt.com/clanky/arduino-uno-deska-i2c-lcd-16x2)

  • Check Use print lines to debug files: If checked use print lines to debug files line 1 or line 2 print to debug files. (warning: If you enable this debug file will have a huge size).

  • Display: If checked print state message to LCD display System Name: SW Version Date: IP: Port: CPU Temp: Time and Date: Uptime: Rain Sensor: Last Run Program: Pressure Sensor: Water Tank Level: Running Stations: DS18B20 Temperature: Wind Speed: Shows current wind speed and maximum wind speed from the Wind Speed Monitor plugin in the format actual (max) unit.

The LCD controller is re-initialized at the start of each display cycle without re-scanning the I2C address. This helps recover HD44780/PCF8574 displays that drift into corrupted characters during long running operation.

  • Status: Status window from the plugin. Example message on the LCD display: OpenSprinkler Py (text on line 1) Irrigation system (text on line 2) CPU temperature: 42.8 C Date: 17.02.2015 Time: 12:22:57 OSPy version: 2015-02-17 System uptime: 5:12:11 My IP is: https://192.168.4.184/8080 My port is: 8080 Rain sensor: Inactive Last program: None Pressure sensor: Not available Water Tank Level: Level 120 cm 100%, volume 1.25 m3, ping 86 cm DS1-6 Temperature: 23.5, -127, 23.5, 36.5, 78.0, -127 (-127 is not connected probe to hardware board...)

  • Important status information OSPy: If events occur in the system: restart, poweroff, update available, they will be displayed preferentially regardless of the above settings.

The hardware should be connected as follows (LCD board by pihrt.com)

The LCD 1602 IIC with PCF8574 (Top 4 bits of expander are commands bits AND P0-4 P1-5 P2-6)

PCF8574 address map

Visit Martin Pihrt's blog. for more information.

In-app help and settings notes

The following notes are generated from the help page shipped with this plug-in. Field names are also explained directly in the OSPy settings page.

This plugin shows information on a 16x2 character LCD with

Automatically detects the display at the following addresses

Compatible with the HD44780 controller.

Warning: The LCD display must not have the same address as other extensions.

For example, if you use the Button Control extension, it has a 0x27 address, like some LCD displays. If you have the same address, change it on the LCD board!

Plugin setup

  • Check Use LCD

If checked use lcd plugin is enabled and print messages on the LCD display.

  • HW version PCF8574<->LCD

Select type Hardware board with PCF8574. Conection with LCD driver.

  • Lower 4 bits of expander are commands bits

  • Top 4 bits of expander are commands bits AND P0-4 P1-5 P2-6 (Use for LCD1602 board)

  • Top 4 bits of expander are commands bits AND P0-6 P1-5 P2-4

  • LCD1602 board where lower 4 are commands, but backlight is pin 3

  • LCD board (https://pihrt.com/clanky/arduino-uno-deska-i2c-lcd-16x2)

  • Check Use print lines to debug files

If checked use print lines to debug files line 1 or line 2 print to debug files. Warning: If you enable this debug file will have a huge size.

  • System notifications

If the check box is selected, system notifications will be displayed in priority (other messages will be suppressed).

  • Display

If checked print state message to LCD display.

  • System Name

  • SW Version Date

  • IP

  • Port

  • CPU Temp

  • Time and Date

  • Uptime

  • Rain Sensor

  • Last Run Program

  • Pressure Sensor

  • Water Tank Level

  • DS18B20 Temperature

  • Running Stations

  • Schedule - Manual

  • System enabled

  • Sensors

  • Current Loop Tanks Monitor

  • Wind Speed

Wind Speed shows the current wind speed and the maximum wind speed from the Wind Speed Monitor extension in the format actual (max) unit.

At the start of each display cycle the LCD controller is initialized again without searching for a new I2C address. This can recover HD44780/PCF8574 displays when long running text turns into corrupted characters.

  • Status

Status window from the plugin.

  • Important status information OSPy

If events occur in the system: restart, poweroff, update available, they will be displayed preferentially regardless of the above settings.

On the setup page, there is a LCD simulation at the bottom that view the information to the real display.

Visit for more information

The hardware should be connected as follows (LCD board by pihrt.com).

The LCD 1602 IIC with PCF8574

PCF8574 address map

Related links and diagrams

schematics

lcd1602 iic

pcf8574 map

Support

Check OSPy → Diagnostics first and remove passwords, tokens, private addresses and other secrets before sharing logs. Report reproducible plug-in problems in the OSPy-plugins issue tracker.

Back to the plug-in catalog

Clone this wiki locally