Skip to content

Notifications

A message on your phone when the printer needs you, and, if you like, when every print is done.

You get a notification when…
a part is still on the bed after the eject and its retries the job queue stopped
a print is too thin for the blade and was left on the bed the job queue waits for you
a print ended without an eject (no AUTO_EJECT in the end G-code, or cancelled) the parts are still on the bed
the next print did not start because old parts are still on the bed the guard
the parts box is almost full, or full (bin_capacity) when full, the next print waits until you empty it
with Spoolman: the spool cannot finish the next job, or may run out during the print the queue stops before that job (spool_low_action)
a print stopped with an error, or was cancelled
a printer's maintenance is due, and the farm's daily report (farm.md) in the app, with the farm
a hardware warning: a fan with a speed sensor stopped, a motor driver warning, a hot motor, a board link resending data, an unhealthy CAN bus, a heater that cannot hold its target, the computer too hot or short of voltage, memory or storage (Hardware) in the app; it opens the Hardware tab. Each phone can turn them off: Hardware warnings too
every print finishes (optional) with AUTO_EJECT in the end G-code this comes once the bed is clear

Tapping a notification opens the auto-eject page. With a printer farm, the app also gets them from every other printer of the farm, each with its name.

There are three ways to get them:

In the auto-eject app With ntfy On Telegram or Discord
Another app on the phone No: the notifications come from the auto-eject app The free ntfy app Telegram or Discord
While the app is closed Yes Yes Yes
Needs HTTPS (remote-access.md), sudo once Nothing else A Telegram bot of your own, or a Discord webhook (a few minutes)
Who can read the messages Only your devices: encrypted end to end Anyone who knows the topic name You, or the members of your Discord channel

A small service on the printer watches it and sends each notification, encrypted, to the push service of every device that turned them on: Google's for Chrome and Android, Apple's for iPhone and iPad, Mozilla's for Firefox. It works while the app is closed, and even while the phone's Tailscale is off: only opening the app needs Tailscale.

  1. Set up remote access with HTTPS first: phones allow notifications only over HTTPS.
  2. On the printer, over SSH:
    ~/klipper-auto-eject/install.sh --push
    
    It installs the klipper-auto-eject service (Python's cryptography package goes into ~/klipper-auto-eject-env if it is missing) and lets Moonraker restart it after updates. It asks for your password once.
  3. On the phone, open the auto-eject app over HTTPS, Blade and setup tab, Notifications, Turn on, and allow notifications. A test notification arrives.
  4. Do the same on every phone, tablet or computer that should get them. Each one chooses whether it also wants a notification when every print finishes.
Device Works
Android: Chrome, Edge, Samsung Internet, Firefox Yes, installed as an app or not
iPhone and iPad iOS 16.4 or newer, and only in the app added to the Home Screen
Computers: Chrome, Edge, Firefox, Safari Yes, while the browser runs

How it works: the device subscribes with its browser and stores the subscription in Moonraker's database (namespace auto_eject_push), so the service needs no port of its own. Each message is encrypted for that one device (RFC 8291); the push services carry it without being able to read it. The service's own key stays in ~/.config/klipper-auto-eject/vapid.pem. Its log: journalctl -u klipper-auto-eject.

With ntfy

The notifications go through ntfy, a free, open-source notification app.

  1. On the printer, over SSH:
    ~/klipper-auto-eject/install.sh --notify
    
    It asks where the notifications should go (choose 1) the ntfy app), then before every step:
  2. whether you also want one when every print finishes,
  3. and, at the end, whether to send a test notification.

It adds two [notifier] sections to moonraker.conf (after a backup), restarts Moonraker when the printer is idle, and sets the auto-eject setting notify to auto_eject. At the end it shows your topic, a random name like auto-eject-3f9a1c2b7d4e5f60. 2. On your phone, install the ntfy app (Google Play, F-Droid or the App Store), tap + and subscribe to that topic on the default server, ntfy.sh. 3. Run the installer again any time: it keeps the same topic.

It worked if the test notification arrives on the phone. Send another one any time with AUTO_EJECT_NOTIFY_TEST in the console, or Send a test on the page: it goes the whole way, from Klipper through Moonraker to the phone, by both ways that are set up.

The auto-eject page shows the topic on its Blade and setup tab, with a button that opens it in ntfy.

Keep the topic to yourself

On the public ntfy.sh server, anyone who knows a topic's name can read its messages. The installer picks a random name that nobody can guess; don't post it anywhere. The messages hold file names and part names, nothing else.

To keep everything on your own network, run your own ntfy server and change the url: lines in moonraker.conf:

url: ntfys://user:password@ntfy.example.com/auto-eject-3f9a1c2b7d4e5f60?priority=high&tags=warning

On Telegram or Discord

On the printer, over SSH, run ~/klipper-auto-eject/install.sh --notify and choose 2) Telegram or 3) Discord. Then:

Telegram

  1. In Telegram, open @BotFather, send /newbot, and choose a name and a user name for your bot (it must end in bot). BotFather answers with a token such as 123456789:AAH….
  2. Paste the token when the installer asks. It stays hidden; the installer checks it with Telegram and tells you your bot's name.
  3. Open your bot in Telegram and send it any message: the installer finds your chat by itself. For a group, add the bot to the group and send the message there instead.

Discord

  1. In your Discord server: Server Settings → Integrations → Webhooks → New Webhook, pick the channel, then Copy Webhook URL.
  2. Paste it when the installer asks (it stays hidden).

Then, as with ntfy, it asks whether you want a message when every print finishes, adds the [notifier] sections to moonraker.conf, restarts Moonraker when the printer is idle, and sends a test. Send a test on the page sends another one any time.

The bot's token and the webhook let anyone who has them post as your bot or in your channel. They are only in moonraker.conf: the page shows only Telegram or Discord, and Report a problem leaves moonraker.conf out.

Email and other services

Moonraker sends notifications with Apprise, which knows about 100 services. Put any Apprise URL in the url: of the two sections and restart Moonraker.

By hand, without the installer

# moonraker.conf
[notifier auto_eject]
url: ntfys://<your-topic>?priority=high&tags=warning
events: gcode
title: Auto-eject
body: {event_message}

[notifier auto_eject_jobs]
url: ntfys://<your-topic>?tags=printer
events: complete, error, cancelled
title: Print {event_name}
body: {event_args[1].filename}{(': ' ~ event_args[1].message) if event_args[1].message else ''}

Restart Moonraker, then tell auto-eject which notifier to use, in the console:

AUTO_EJECT_SET KEY=notify VALUE=auto_eject

[notifier auto_eject] gets the auto-eject messages (events: gcode); [notifier auto_eject_jobs] gets Moonraker's own events for whole prints. Leave the second one out if you only want to hear about problems.

Without the service

Without install.sh --push, Turn on still works while the auto-eject app is open or in the background: the page shows the notifications itself. When the app is closed, only the service or ntfy can reach you.

Mobileraker

Mobileraker has its own notifications for prints and errors when its companion is installed on the printer (remote-access.md). It works next to ntfy.

Problems

What you see What to do
No Turn on button in the app The page is not on HTTPS (remote-access.md), or notifications are blocked for it in the browser's site settings
The app says notifications are on only while it runs The service is not installed or not running: install.sh --push, then systemctl status klipper-auto-eject
Nothing arrives on an iPhone Add the app to the Home Screen and turn notifications on from there (iOS 16.4 or newer)
The test notification does not arrive In the ntfy app, check the topic and the server (ntfy.sh). On the printer, curl -d test https://ntfy.sh/<topic> should reach the phone
Test works, but nothing from the printer Moonraker was not restarted after the change, or notify is not set: AUTO_EJECT_SET KEY=notify VALUE=auto_eject
Remote method 'notify' not registered notify names a notifier that Moonraker does not have. Check the section names in moonraker.conf, or set notify back to ""
Too many notifications Run install.sh --notify again and answer no to a notification for every print