← All recipes

OctoPrint Print Finished Alert to Discord via Home Assistant

Status: Draft

Last tested: TBD

Works with: Home Assistant, OctoPrint integration, Discord notification service

Category: 3D Printing / Home Assistant / Discord

Difficulty: Intermediate

Problem

Long 3D prints finish when you are away from the printer. A Discord alert makes it easy to know when the print completed or failed.

What you will build

A Home Assistant automation that watches an OctoPrint job state and sends a Discord message when the print finishes.

Requirements

Quick version

alias: Discord alert - 3D print finished
trigger:
  - platform: state
    entity_id: sensor.octoprint_current_state
    to: "Operational"
condition:
  - condition: template
    value_template: "{{ trigger.from_state.state in ['Printing', 'Pausing', 'Paused'] }}"
action:
  - service: notify.discord
    data:
      message: "3D print finished: {{ now().strftime('%Y-%m-%d %H:%M') }}"
mode: single

Step-by-step setup

Step 1: Find your OctoPrint state entity

In Home Assistant, search entities for `octoprint`. Identify the entity that changes between `Printing` and `Operational`.

Step 2: Confirm the state names

Start a test print or inspect recent history. State names may differ depending on integration version.

Step 3: Create the automation

Replace `sensor.octoprint_current_state` and `notify.discord` with your actual entity/service names.

Step 4: Run a test

Use a short print or temporarily trigger from Developer Tools.

Verification

Troubleshooting

| Symptom | Likely cause | Fix |

| --- | --- | --- |

| Alert fires on restart | Previous state was unavailable | Add conditions to exclude unavailable/unknown |

| Alert never fires | Entity/state name differs | Check entity history |

| Too little detail | Need filename/progress sensor | Add available OctoPrint attributes or sensors |

Optional upgrades