Paperang P2/P2S — A Compact Bluetooth Thermal Printer for Home Assistant

tl;dr: Print text, images, QR codes, and pickup codes from Home Assistant — USB or Bluetooth auto-discovery, interactive device page, 7 services, multi-printer support. MIT licensed. Install via HACS.


Why a Thermal Printer in Home Assistant?

I've been building my smart home for years, and one thing kept bugging me: some information is just better on paper.

  • :clipboard: Shopping lists — tap a button, grab the slip, walk out
  • :package: Pickup codes — package locker codes printed automatically when a delivery arrives
  • :sun_behind_small_cloud: Morning brief — weather, calendar, to-do list, printed at 8 AM
  • :warning: Alerts — low battery, water leak, door left open — physical paper gets noticed

The Paperang P2/P2S (also sold as 喵喵机 MiaoMiaoJi) is a pocket-sized thermal printer that costs about $25-35 on AliExpress. No ink, no toner — just thermal paper rolls. Perfect for home automation.

So I built a native Home Assistant integration.

What It Does

:electric_plug: Zero-Config Discovery

Plug in via USB → HA detects it automatically. Power on via Bluetooth → HA finds it. No MAC addresses, no YAML, no bluetoothctl tinkering. Just confirm the notification and you're done.

:control_knobs: Interactive Device Page

All controls live right on the device page — no YAML editing needed:

Control Type What It Does
Print Mode dropdown text / image / QR / pickup code
Print Content text input what to print
Font Size slider (12–96) text size
Heat Density slider (0–100%) print darkness
QR Size slider (100–576px) QR code dimensions
Image Profile dropdown portrait / landscape / document / high_contrast / light
Vertical toggle rotate 90° for vertical printing
Feed Lines slider paper advance

:bar_chart: 6 Real-Time Sensors

Sensor Unit
Battery %
Status diagnostic code
Voltage mV
Temperature °C
Heat Density %
Connection connected/disconnected

Static info (model, firmware, board version, serial number) shows on the device card.

:printer: 7 Services for Automations

# Print morning weather
service: paperang.print_text
data:
  text: |
    🌤️ Good morning!
    Today: {{ states('weather.home') }}
    High: {{ state_attr('weather.home', 'temperature') }}°C
  font_size: 20
  heat_density: 60
Service Use Case
paperang.print_text Weather, calendar, reminders, to-do lists
paperang.print_image Camera snapshots, floor plans, memes
paperang.print_qr WiFi credentials, URLs, home automation shortcuts
paperang.print_pickup_code Package locker codes — big, bold, readable
paperang.print_test_page Connectivity check
paperang.get_status Poll battery/status programmatically
paperang.feed_paper Advance paper between prints

:package: Multi-Device Support

Got two printers? One by the door for pickup codes, one on your desk for morning briefs. Each has its own coordinator, transport config, and device page — fully isolated.

Real Automation Examples

Print Pickup Code When Package Arrives

automation:
  - alias: "Print Pickup Code on Delivery"
    trigger:
      - platform: state
        entity_id: sensor.package_delivery
    action:
      - service: paperang.print_pickup_code
        data:
          pickup_code: "{{ states('input_text.pickup_code') }}"

Morning Brief Print

automation:
  - alias: "Daily Morning Brief"
    trigger:
      - platform: time
        at: "08:00:00"
    action:
      - service: paperang.print_text
        data:
          text: |
            📅 {{ now().strftime('%A, %B %d') }}
            🌡️ {{ states('sensor.outdoor_temp') }}°C | 💧 {{ states('sensor.humidity') }}%
            📋 {{ states('sensor.todoist_tasks') }} tasks due
          font_size: 18

Low Battery Alert — On Paper

automation:
  - alias: "Printer Low Battery Alert"
    trigger:
      - platform: numeric_state
        entity_id: sensor.paperang_p2_battery
        below: 20
    action:
      - service: paperang.print_text
        data:
          text: "⚠️ Paperang battery low: {{ states('sensor.paperang_p2_battery') }}%"
          font_size: 24

Installation

HACS (Recommended — 1 minute)

Open in HACS

Or manually:

  1. HACS → Integrations → ⋮ → Custom repositories
  2. URL: https://github.com/mdj2812/paperang-hacs
  3. Category: Integration
  4. Install Paperang P2 Printer
  5. Restart HA

![HACS Installation]

Manual

git clone https://github.com/mdj2812/paperang-hacs.git
cp -r paperang-hacs/custom_components/paperang /config/custom_components/paperang

Requirements

  • USB: Paperang P2 plugged into HA host (USB passthrough if VM)
  • Bluetooth: Bluetooth adapter on HA host (classic BR/EDR, not BLE — works with HA's built-in Bluetooth integration)
  • Paper: 57mm thermal paper rolls (standard, cheap)

Works with both Paperang and 喵喵机 (MiaoMiaoJi) branded P2/P2S devices.

Tech Stack

  • Python custom component, pure asyncio
  • paperang-p2-lib — core protocol library (also open source)
  • Transport: USB (PyUSB) + Bluetooth SPP/RFCOMM (stdlib socket.AF_BLUETOOTH)
  • CI: GitHub Actions with Docker HA test containers, 90%+ test coverage
  • License: MIT

Links


I've been using this daily for about a month. It's stable, the device page makes one-off prints easy, and the automations are fun to build. If you've got a Paperang gathering dust in a drawer — give it a job.

:star: Stars, issues, and PRs welcome. Happy printing!

2 Likes

And I have only tested with Paperang P2. But theoratically it can work with other models from Paperang. Please leave comment if you have tested with other models. And don't hesitate to raise an issue if encountered any issue.