Documentation

Character Displays

Character displays provide visual feedback of MudPi status on 16x2 or 20x4 LCD screens.

Overview

Character displays let you show system information directly on small LCD screens connected to your Raspberry Pi. MudPi manages a message queue that cycles through messages on the display, each shown for a configurable duration (in seconds).

Configuration

mudpi.config.json
{
  "displays": [
    {
      "key": "lcd_main",
      "interface": "i2c",
      "model": "16x2",
      "address": "0x27",
      "duration": 5,
      "name": "Main Display"
    }
  ]
}

Interfaces

Interface Description
example Virtual display for testing (outputs to console)
i2c I2C-connected LCD display (most common)
nanpy LCD connected via Arduino using Nanpy

Actions

Action Description
show Add a message to the display queue
clear Clear the current message from the display
clear_queue Remove all messages from the queue
next_message Skip to the next message in the queue
turn_on_backlight Turn on the LCD backlight
turn_off_backlight Turn off the LCD backlight

Events

Displays fire the following events:

Message Event

Fired when a new message is displayed:

Message Event
{
  "event": "Message",
  "component_id": "lcd_main",
  "data": {
    "message": "Temp: 72°F",
    "duration": 5
  }
}

Clear Event

Fired when the display is cleared.

ClearQueue Event

Fired when the entire message queue is emptied.

Dynamic Messages

You can include dynamic values in display messages using bracket notation. MudPi will replace [key] with the current state value of the matching component:

Dynamic Message
Temp: [greenhouse_temp]°F
Moisture: [soil_sensor_1]%

Note

Dynamic keys are resolved at display time from MudPi's state store. Make sure the referenced component key exists and is actively reporting data.

Position in Queue

Messages are added to the end of the queue by default. The display cycles through messages in order, showing each for its configured duration before advancing to the next. When the queue is exhausted, it loops back to the beginning.