Integration to control Epson receipt printers in Home Assistant.
- Print Services: Three convenient services for printing:
- Print text with customizable formatting (alignment, font, bold, double height/width, word wrapping)
- Print local and remote images (PNG, JPG, GIF, BMP) with automatic resizing
- Print QR codes
- Remote Image Support: Automatically downloads and prints images from URLs
- Automatic Resizing: Images are automatically resized to fit your printer's width while maintaining aspect ratio
- Paper Cutting: Optional automatic paper cutting after each print job
- Status Monitoring:
- Binary sensor for online/offline status
- Sensor for paper status (ok, low, out)
- Configurable Printer Settings: Support for different printer models with customizable column widths and image sizes
- In HACS, click on "Integrations"
- Click the three dots in the top right corner
- Select "Custom repositories"
- Add the URL
https://github.com/zacs/ha-receipt_printerand select the category "Integration" - Click the "+" button in the bottom right corner
- Search for "Receipt Printer"
- Click "Install"
- Restart Home Assistant
- Using the tool of choice open the directory (folder) for your HA configuration (where you find
configuration.yaml) - If you do not have a
custom_componentsdirectory there, you need to create it - In the
custom_componentsdirectory create a new folder calledreceipt_printer - Download all the files from the
custom_components/receipt_printer/directory in this repository - Place the files you downloaded in the new
receipt_printerdirectory you created - Restart Home Assistant
- In the Home Assistant UI, navigate to "Configuration" -> "Integrations"
- Click the "+" button to add a new integration
- Search for "Receipt Printer"
- Enter the following information:
- Printer Name: A friendly name for your printer (e.g., "Kitchen Receipt Printer")
- Printer IP Address: The IP address of your receipt printer on your network
- Columns (Font A): Number of text columns for font A (default: 42, suitable for TM-T88V)
- Columns (Font B): Number of text columns for font B (default: 56, suitable for TM-T88V)
- Image Max Width: Maximum image width in pixels (default: 512, suitable for TM-T88V)
The integration will attempt to connect to the printer and verify it's accessible. The column and image settings can be adjusted to match your specific printer model.
Different printer models support different widths:
- Epson TM-T88V/VI (80mm): Font A = 42 columns, Font B = 56 columns, Image width = 512 pixels
- For other models, consult your printer's documentation or the python-escpos printer profiles
This integration uses the python-escpos library and supports Epson ESC/POS compatible receipt printers with network (TCP/IP) connectivity.
Tested models:
- Epson TM-T88VI
Other ESC/POS compatible printers should work but may require adjusting the column widths and image size settings during configuration.
Note: USB and serial printers are not currently supported.
Once configured, the integration creates two entities for status monitoring:
- Connected: Printer is online and accessible
- Disconnected: Cannot communicate with printer
- ok: Printer has adequate paper
- low: Paper is running low (near-end sensor triggered)
- out: Printer is out of paper
The paper status sensor will be unavailable when the printer is offline.
The integration provides three services for printing:
Print text to the receipt printer with formatting options.
Service Data:
service: receipt_printer.print_text
data:
text: "Hello World!\nThis is a test receipt."
align: center # Options: left, center, right
font: a # Options: a, b
bold: false
double_height: false
double_width: false
wrap: true # Enable automatic word wrapping (default: true)
cut: true # Cut paper after printingWord Wrapping: When wrap: true (default), text will automatically wrap at word boundaries to fit the printer's configured column width. Set to false to disable wrapping and print text as-is.
Print an image file to the receipt printer. Images can be local file paths or remote URLs.
Service Data:
service: receipt_printer.print_image
data:
image_path: "/config/www/logo.png" # or "https://example.com/image.jpg"
center: true
cut: trueSupported formats: PNG, JPG, GIF, BMP
Image Handling:
- Local files: Use absolute paths (e.g.,
/config/www/image.png) - Remote images: Use full URLs (e.g.,
https://example.com/image.jpg) - Images wider than the configured max width are automatically resized while maintaining aspect ratio
- Images smaller than the max width are printed at their original size
Print a QR code to the receipt printer.
Service Data:
service: receipt_printer.print_qr
data:
content: "https://www.home-assistant.io"
size: 3 # Size from 1-16
center: true
cut: trueautomation:
- alias: "Print Welcome Receipt"
trigger:
- platform: state
entity_id: person.john
to: "home"
action:
- service: receipt_printer.print_text
data:
text: |
================================
WELCOME HOME JOHN!
================================
Time: {{ now().strftime('%H:%M:%S') }}
Date: {{ now().strftime('%Y-%m-%d') }}
Temperature: {{ states('sensor.living_room_temperature') }}°C
================================
align: center
cut: trueautomation:
- alias: "Print Shopping List QR"
trigger:
- platform: tag
tag_id: shopping_list
action:
- service: receipt_printer.print_text
data:
text: "Scan for Shopping List:"
align: center
bold: true
cut: false
- service: receipt_printer.print_qr
data:
content: "https://your-shopping-list-url.com"
size: 5
center: true
cut: trueautomation:
- alias: "Print Door Access Log"
trigger:
- platform: state
entity_id: lock.front_door
to: "unlocked"
action:
- service: receipt_printer.print_text
data:
text: |
DOOR ACCESS LOG
{{ now().strftime('%Y-%m-%d %H:%M:%S') }}
Front door unlocked
{% if trigger.to_state.attributes.user_id %}
User: {{ trigger.to_state.attributes.user_id }}
{% endif %}
align: left
cut: true- Verify the printer's IP address is correct
- Ensure the printer is powered on and connected to your network
- Check that your Home Assistant instance can reach the printer's IP (try pinging it)
- Verify no firewall is blocking communication on the printer's port (typically 9100)
- Clean the printer's print head according to manufacturer instructions
- Check paper quality and ensure it's compatible with thermal printing
- Verify paper is loaded correctly
The paper status depends on the printer's sensors. Some printer models may not support all status queries. The integration will still function for printing even if status updates are unavailable.
This integration is built using the python-escpos library. Contributions are welcome!
- Built on top of the python-escpos library
- Integration structure based on integration_blueprint
Epson spec sheet for the TM-T88VI (the only model I have): https://download4.epson.biz/sec_pubs/pos/reference_en/epos_and/ref_epos_sdk_and_en_printer-specificsupportinformation_tm-t88vi.html