Large 3D printer on a light wooden workbench, next to it a tablet with a smart home dashboard and the progress display of the running print

Connect Your 3D Printer to Home Assistant (Klipper & Moonraker)

In my Elegoo Neptune 4 Plus review I already hinted at it: this printer runs Klipper – which means it ships with everything you need to bring it into your smart home. In this article I will show you step by step how to connect your 3D printer to Home Assistant: using the Moonraker integration, with a dashboard for your phone and a notification the moment your print is done.

The best part: on the Neptune 4 Plus (and its siblings, the Neptune 4 and Neptune 4 Pro) you do not need to flash anything or modify the printer in any way. Many forum posts claim you first have to install the alternative OpenNept4une firmware to get Home Assistant working – that is simply not true. There is exactly one trick hardly anyone knows about, and it consists of a single number: port 80. I verified all of this on my own machine.

Transparency note: Elegoo provided the Neptune 4 Plus free of charge as a long-term loan unit. The manufacturer had no influence on the content of this article – there were no guidelines and no review before publication. Everything you read here I verified on the device myself.
What is Moonraker?

Moonraker is an open-source API server that exposes the Klipper 3D printer firmware via HTTP and WebSocket. Web interfaces like Mainsail and Fluidd, but also Home Assistant, use it to talk to the printer. On the Elegoo Neptune 4 series, Moonraker already runs out of the box.

What you need

  • A running Home Assistant installation – for example on a Raspberry Pi
  • A 3D printer running Klipper and Moonraker – in my case the Elegoo Neptune 4 Plus*; any other Klipper printer with Mainsail or Fluidd works just the same
  • The Marketplace (formerly HACS) – the Moonraker integration is not an official integration
  • Your printer’s IP address on the local network
Links marked with * are affiliate links, which makes them advertising. If you buy through one, I earn a commission at no extra cost to you. As an Amazon Associate I earn from qualifying purchases. Learn more

If your printer runs OctoPrint on a Raspberry Pi instead, you do not need this article: for OctoPrint, Home Assistant ships its own official integration – simply add it under Settings → Devices & Services.

Why Moonraker and not OctoPrint?

A fair question, because OctoPrint was the standard way to get a 3D printer onto the network for years. On Klipper printers like the Neptune 4 series, however, OctoPrint is simply redundant: Klipper runs directly on the printer’s board, and Moonraker is its interface to the outside world. An additional Pi running OctoPrint would just put a second box next to the printer that cannot do anything the printer does not already do by itself. The Moonraker integration talks to the printer directly – with no middleman.

The crucial trick on the Neptune 4: port 80 instead of 7125

Normally Moonraker listens on port 7125 – which is also the default value the Home Assistant integration will suggest in its setup dialog. On the Neptune 4 Plus, however, that runs you straight into a wall: Elegoo configured Moonraker to be reachable only locally on the printer board. From the outside, port 7125 is closed.

A look at the running machine shows why everything works anyway: the printer board (an MKS-PI with the hostname mkspi) runs an nginx web server that forwards all Moonraker requests on port 80 – including the WebSocket connection Home Assistant needs for live updates. You can verify this yourself before setting up anything in Home Assistant. Just open this in your browser (or via curl):

http://YOUR-PRINTER-IP/printer/info

If the printer answers with a JSON response containing "state": "ready", Moonraker is reachable and you are good to go. On my test unit (firmware V1.4.1.4) Moonraker 1.5.0 responds there. You will find your printer’s IP address right on the touchscreen in the Wi-Fi settings – or in your router’s web interface.

Tip: Give the printer a fixed IP address in your router before you continue. If DHCP hands it a new IP later, Home Assistant will lose the connection.

For every other Klipper printer – say, a converted Ender 3 running Mainsail or Fluidd – the same test applies with the default port: http://PRINTER-IP:7125/printer/info. Simply remember which of the two responds on your setup; that exact port goes into the integration in a minute.

Installing the Moonraker integration from the Marketplace

The Moonraker integration is a community project and comes from the Marketplace, built in from Home Assistant 2026.11. For older versions, our HACS guide covers the install. The screenshot still shows HACS. Here’s how it works:

  1. Open Settings → Marketplace and search for “Moonraker”
  2. Select the entry “Moonraker” (Home Assistant integration for Moonraker, Klipper and Mainsail) and select Install
  3. Restart Home Assistant if a repair asks you to. With HACS, you always need to restart
Moonraker integration in the HACS store
The Moonraker integration in HACS

Connecting the printer to Home Assistant

Then head to the actual setup: Settings → Devices & Services → Add Integration, then search for Moonraker. In the dialog, enter:

FieldValue
Hostyour printer’s IP address (192.168.178.67 in my case)
Port80 on the Elegoo Neptune 4 / 4 Pro / 4 Plus – 7125 on other Klipper printers
API keyleave empty (the printer does not require one out of the box)
Printer’s nameyour choice, e.g. “Neptune” – Home Assistant derives the entity names from it

The port is where most people fail: if you keep the suggested 7125 on a Neptune 4, the setup ends with a “Failed to connect” error. With port 80, the integration connects and creates the printer as a device with all its entities.

Moonraker connection dialog in Home Assistant
The setup dialog – enter port 80 for the Neptune 4
Neptune 4 Plus device page in Home Assistant with controls
The Neptune 4 Plus as a device in Home Assistant
Neptune 4 Plus sensors in Home Assistant during a print
Live sensors during a running print

The entities you get

Once set up, the printer appears with a whole collection of sensors, buttons and switches. The entity IDs start with the name you chose in the dialog – with “Neptune” that would be sensor.neptune_bed_temperature, for example. The most important ones at a glance:

EntityWhat it provides
Current Print StatePrint status: standby, printing, paused, complete, cancelled or error – the foundation for all automations
ProgressProgress of the current print in percent
Print ETA / Print Time LeftEstimated completion time and remaining time
Extruder / Bed TemperatureCurrent and target temperatures of hotend and heated bed
FilenameFile name of the running print
Filament UsedFilament consumed since the print started
Current Layer / Total LayerCurrent layer and total layer count
Pause / Resume / Cancel PrintButtons to pause, resume or cancel the print
Emergency StopImmediate emergency stop of the printer – use with care

On top of that you get sensors for fan speed, toolhead position, the slicer’s time estimate and the printer board’s load, plus buttons for homing the axes – more than 60 entities in total on my test unit. Your Klipper macros show up as buttons as well; some of them are disabled by default and can be enabled in the entity settings if needed. The integration does create a webcam entity on the Neptune, but it stays blank as long as no camera is connected – none is installed from the factory. There is also a thumbnail entity showing a preview of the running print, provided your slicer embeds preview images into the G-code.

Three things positively surprised me while going through the entities. First: the Neptune’s LED light bar shows up as its own switch (switch.neptune_output_pin_caselight1) – turning the light on and off from my phone worked right away, I tried it immediately. Second, the filament sensor reports as binary_sensor.neptune_fila whether filament is loaded – perfect as an extra condition in automations. And third, the integration ships statistics sensors: total print time, number of print jobs and the longest print; on my unit, two weeks in, they showed 63 jobs and a good 21 hours of print time. The number entities additionally let you set target temperatures and the speed factor directly as sliders.

The integration sets the polling interval on its own: while a print is running, it fetches new values every 2 seconds, otherwise every 30 seconds. Progress and temperatures update almost live during a print, so there is nothing to tweak.

A dashboard card for the printer

To get started, a simple combination of built-in Home Assistant cards is all you need – no custom cards required. Add a new card to your dashboard, switch to YAML mode and paste the following (adjust the entity names to your printer’s name):

type: vertical-stack
cards:
  - type: tile
    entity: sensor.neptune_current_print_state
    name: Print status
  - type: gauge
    entity: sensor.neptune_progress
    name: Progress
  - type: entities
    entities:
      - sensor.neptune_extruder_temperature
      - sensor.neptune_bed_temperature
      - sensor.neptune_print_eta
      - sensor.neptune_filename
  - type: horizontal-stack
    cards:
      - type: button
        entity: button.neptune_pause_print
        name: Pause
      - type: button
        entity: button.neptune_resume_print
        name: Resume
      - type: button
        entity: button.neptune_cancel_print
        name: Cancel
3D printer dashboard card in Home Assistant during a print
The dashboard card on my phone during a print

If you want something fancier: the integration’s documentation features an extensive community dashboard with temperature graphs and progress bars – it does, however, require the Mushroom, Bar Card, Button Card and ApexCharts custom cards from the Marketplace. I also cover the general approach to building dashboards in my article on the Home Assistant dashboard on the Shelly Wall Display.

Automation: get notified when the print is done

This is the real reason for the whole exercise: a large printer like the Neptune 4 Plus happily prints for six or eight hours straight, and nobody sits next to it that long. With the status sensor, a phone notification is built in two minutes. Create a new automation under Settings → Automations & Scenes: as the trigger, pick the state of sensor.neptune_current_print_state with the target value complete; as the action, a notification to the companion app. In YAML it looks like this:

alias: 3D print finished
triggers:
  - trigger: state
    entity_id: sensor.neptune_current_print_state
    to: complete
actions:
  - action: notify.mobile_app_your_phone
    data:
      title: 3D print finished ✅
      message: >-
        {{ states('sensor.neptune_filename') }} is done.
        Let the plate cool down before removing the part.
mode: single

Following the same pattern, I set up a second automation with the target value error – that way my phone also tells me when a print stops with an error, instead of discovering it hours later on a half-finished part. If you like, add paused as a third case, since running out of filament pauses the print as well.

Security: Moonraker has no login

Here is something I found while inspecting the Neptune 4 Plus configuration that hardly any review mentions: in the printer’s moonraker.conf, all private IP ranges are listed as trusted_clients out of the box – including the entire 192.168.0.0/16 network. In plain terms: every device on your home network can fully control the printer without any authentication – start prints, cancel them, turn on the heaters. That is exactly why the Home Assistant setup works without an API key in the first place.

On a home network that is an acceptable trade-off, but you should derive two rules from it: never expose the printer to the internet via port forwarding – if you want to check on your print while away, do it through Home Assistant’s remote access or a VPN like WireGuard. And if you segment your network anyway, put the printer with your other IoT devices into a guest network or IoT VLAN where devices cannot talk to each other freely.

Printer switched off? Keeping the log quiet

Unlike a smart plug, a 3D printer does not run around the clock – and as soon as it is off, its entities in Home Assistant become “unavailable”. That is normal and not an error: the integration periodically retries the connection and recovers on its own once the printer is switched back on. It does, however, write warnings into the Home Assistant log while doing so. If that bothers you, enable the option in the integration’s settings to log connection messages for unreachable printers at DEBUG level only – and your log stays clean.

The next logical step, by the way, is automating the power itself: a power-metering smart plug like the Shelly AZ Plug* between printer and outlet, and Home Assistant switches the printer off by itself once the hotend has cooled down. How that works, and what the Neptune 4 Plus actually draws in power, will get its own article in this series.

Troubleshooting: the most common pitfalls

  • “Failed to connect” during setup: Nine times out of ten it is the wrong port. Neptune 4 / 4 Pro / 4 Plus: port 80. Self-built Klipper setups: 7125. When in doubt, run the curl test from above.
  • Connection drops after a few days: Usually the router assigned the printer a new IP via DHCP. Set a fixed IP in the router, then update the address in the integration’s settings.
  • Entities “unavailable”: The printer is off or not on Wi-Fi – not an integration bug, see above.
  • An expected macro is missing: Some macro buttons are disabled by default. Check the disabled entities on the device page and enable them.
  • No thumbnail: The preview only works if your slicer writes preview images into the G-code. In ElegooSlicer and OrcaSlicer this is a process or printer setting.

Frequently asked questions

Does the Home Assistant connection work on the Elegoo Neptune 4 without flashing the firmware?

Yes. Moonraker already runs on the Neptune 4 series out of the box, and an nginx web server on the printer board exposes the API on port 80 – including the WebSocket connection the Home Assistant integration requires. The alternative OpenNept4une firmware is not needed for this.

Which port do I need to enter for Moonraker on the Neptune 4?

Port 80 instead of the suggested default of 7125. On the Neptune 4, Moonraker itself is only reachable locally on the printer board; from the outside, the nginx proxy in front of it answers on port 80. On self-built Klipper setups with Mainsail or Fluidd, the standard port 7125 still applies.

Do I need an API key for the Moonraker integration?

No, leave the field empty. Out of the box, the Neptune 4 lists all private IP ranges as trusted and does not require any authentication on the local network. Convenient, but it also means: never expose the printer to the internet via port forwarding – use Home Assistant remote access or a VPN when you are away.

Can I pause or cancel a print from Home Assistant?

Yes. The integration creates buttons for pause, resume, cancel and an emergency stop, plus buttons for homing the axes and for your Klipper macros. Combined with the status sensor, you can operate the printer entirely from your dashboard or phone.

Does this also work with OctoPrint instead of Klipper?

For OctoPrint you do not need the Moonraker integration: Home Assistant ships its own official OctoPrint integration, added under Settings, Devices and Services. The Moonraker integration is the way to go for Klipper printers – the Neptune 4 series and any printer running Mainsail or Fluidd.

Conclusion

Connecting the Neptune 4 Plus to Home Assistant is a ten-minute job – once you know the port trick. From then on, the printer reports in by itself when a print is finished or stuck, and the dashboard shows status, temperatures and remaining time at a glance. For me, the error notification alone has already paid off: a failed eight-hour print now gets noticed within minutes, not the next morning. In the next part of this series we will measure and switch: what does the Neptune 4 Plus actually draw in power, and how can Home Assistant switch it off automatically after a print? Have fun setting it up!

Similar Posts