A lightweight Python script that updates a Posiflex PD-2800/320 VFD display with live 3D printer status from Home Assistant.
- ✅ Live Print Status — Displays
"Printing","Paused","Standby", etc. - ✅ Print Progress Bar — Dynamic bar graph with percentage.
- ✅ Time Remaining — Converts seconds to a readable HH:MM format.
- ✅ "Printer Ready" Mode — Hides progress/time when idle.
- ✅ Auto-Start on Boot — Runs on Raspberry Pi via systemd service.
- ✅ Easy Customization — Change Home Assistant entity names via
config.py.
- 🖥️ Raspberry Pi (or any Linux system)
- 🔌 Posiflex PD-2800/320 VFD display (connected via USB)
- 🔄 Home Assistant with Moonraker Plugin
- 🐍 Python 3 & Dependencies
Run these commands on your Raspberry Pi:
sudo apt update && sudo apt install -y python3 python3-pip
pip3 install requestsgit clone https://github.com/YOUR_USERNAME/PrintStatusVFD.git
cd PrintStatusVFDEdit config.py:
nano config.pyModify it to match your Home Assistant API token & entities:
# Home Assistant Configuration
HA_URL = "http://homeassistant.local:8123/api/states"
HA_TOKEN = "YOUR_LONG_LIVED_ACCESS_TOKEN"
# Home Assistant Entity IDs (Update based on your setup)
PRINTER_STATUS_ENTITY = "sensor.k1c_current_print_state" # Printer state
PRINTER_PROGRESS_ENTITY = "sensor.k1c_progress" # Print completion %
PRINTER_TIME_LEFT_ENTITY = "sensor.k1c_print_time_left" # Time remaining in secondsSave and exit (CTRL+X, then Y, then ENTER).
Run manually to check for errors:
python3 homeassistant_display.pyIf everything works, press CTRL+C to stop.
To ensure PrintStatusVFD starts automatically on reboot, create a systemd service.
sudo nano /etc/systemd/system/vfd-display.servicePaste this inside:
[Unit]
Description=VFD Display Printer Status
After=network.target
[Service]
ExecStart=/usr/bin/python3 /home/pi/PrintStatusVFD/homeassistant_display.py
WorkingDirectory=/home/pi/PrintStatusVFD
Restart=always
User=pi
[Install]
WantedBy=multi-user.targetSave and exit (CTRL+X, then Y, then ENTER).
sudo systemctl daemon-reload
sudo systemctl enable vfd-display.service
sudo systemctl start vfd-display.servicesudo systemctl status vfd-display.serviceYou should see "active (running)" in green.
sudo rebootCheck the display after rebooting!
- Check logs:
journalctl -u vfd-display.service --no-pager | tail -50 - Restart the service manually:
sudo systemctl restart vfd-display.service
- Ensure the script runs without errors:
python3 homeassistant_display.py
- Check if Home Assistant’s API is responding:
If this fails, your Home Assistant API token may be incorrect.
curl -X GET -H "Authorization: Bearer YOUR_HA_LONG_LIVED_ACCESS_TOKEN" -H "Content-Type: application/json" http://homeassistant.local:8123/api/states
- Ensure Home Assistant is providing the correct time in seconds.
- You can log the output by adding
print(time_left_sec)insideget_printer_status().
If you’d like to improve PrintStatusVFD, feel free to:
- 🐛 Report bugs via GitHub Issues.
- 💡 Suggest features by opening a discussion.
- 🔄 Submit a pull request if you add something awesome!
This project is licensed under the MIT License—do whatever you want, just give credit! 😎
