"Did I really say that?" Why yes, you did.
A thermal receipt printer for capturing silly quotes. Full project writeup at teddywarner.org/Projects/Quotes.
| Qty | Description | Price | Link |
|---|---|---|---|
| 1 | miemieyo Thermal Receipt Printer 80mm | $65.99 | Amazon |
| 1 | MPRT 5 Rolls Thermal Paper 3-1/8" x 230' | $15.99 | Amazon |
| 1 | LM2596 Buck Converter | $7.99 | Amazon |
| 1 | Raspberry Pi (any model) | ~$35-80 | Raspberry Pi |
Flash Raspberry Pi OS Lite (64-bit) and configure WiFi. SSH in:
ssh pi@raspberrypi.local
sudo apt update && sudo apt upgrade -ySet hostname to receipt:
sudo hostnamectl set-hostname receipt
sudo nano /etc/hosts # Change 127.0.1.1 to receipt
sudo rebootInstall dependencies:
sudo apt install -y python3-pip libusb-1.0-0-dev avahi-daemon
sudo systemctl enable avahi-daemongit clone https://github.com/Twarner491/quotes.git ~/quotes
cd ~/quotes
sudo pip3 install -r requirements.txt --break-system-packagesFind your printer's USB IDs:
lsusb # e.g., ID 0483:5720
lsusb -v -d 0483:5720 | grep "bEndpointAddress" # e.g., 0x03 OUT, 0x81 INEdit src/app.py with your values:
VENDOR_ID = 0x0483
PRODUCT_ID = 0x5720
OUT_EP = 0x03
IN_EP = 0x81Set USB permissions:
sudo cp system-config/99-thermal-printer.rules /etc/udev/rules.d/
sudo udevadm control --reload-rules && sudo udevadm triggerStart the service:
sudo cp system-config/receipt-printer-flask.service /etc/systemd/system/receipt-printer.service
sudo systemctl daemon-reload
sudo systemctl enable --now receipt-printer.serviceAccess at http://receipt.local:5000
For external access via Home Assistant webhook → MQTT → Pi.
Add to automations.yaml:
alias: "Quote Receipt Print"
trigger:
- platform: webhook
webhook_id: quote_receipt_print
allowed_methods: [POST]
local_only: false
action:
- service: mqtt.publish
data:
topic: "home/receipt_printer/print"
payload_template: >
{"quote": "{{ trigger.json.quote }}", "author": "{{ trigger.json.author | default('Anonymous') }}", "image": "{{ trigger.json.image | default('') }}"}Add to configuration.yaml:
http:
cors_allowed_origins:
- https://your-frontend-domain.comEdit src/mqtt_print_subscriber.py with your MQTT broker IP and printer IDs, then:
sudo cp system-config/receipt-printer-mqtt.service /etc/systemd/system/receipt-printer.service
sudo systemctl daemon-reload
sudo systemctl enable --now receipt-printer.serviceTo enable remote access on your fork, add your HA webhook URL as a GitHub Secret:
- Go to Settings → Secrets and variables → Actions
- Add secret:
HA_WEBHOOK_URL= Your Home Assistant webhook URL (e.g.,https://your-ha.com/api/webhook/quote_receipt_print)