https://github.com/ghosttypes/ff-5mp-hass
Powerful Home Assistant plugin for FlashForge 3D printers
https://github.com/ghosttypes/ff-5mp-hass
3d-printer flashforge hacs home-assistant home-assistant-integration
Last synced: 21 days ago
JSON representation
Powerful Home Assistant plugin for FlashForge 3D printers
- Host: GitHub
- URL: https://github.com/ghosttypes/ff-5mp-hass
- Owner: GhostTypes
- License: mit
- Created: 2025-11-02T04:56:17.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2026-03-23T21:31:41.000Z (3 months ago)
- Last Synced: 2026-04-02T08:32:47.346Z (3 months ago)
- Topics: 3d-printer, flashforge, hacs, home-assistant, home-assistant-integration
- Language: Python
- Homepage:
- Size: 1.71 MB
- Stars: 10
- Watchers: 0
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
- Agents: AGENTS.md
Awesome Lists containing this project
README
FlashForge 3D Printer Integration for Home Assistant
A Home Assistant custom integration for modern FlashForge printers using the local HTTP API in LAN mode for reliable, real-time monitoring and control.
Features
Category
Feature
Details
Monitoring
28 Sensors
Real-time temperatures, print progress, filament tracking, fan speeds, air quality (5M Pro TVOC), active IFS slot, print completion time, lifetime statistics, and diagnostics
4 Binary Sensors
Printing status, connectivity, error detection, pause state
Live Camera Feed
MJPEG stream auto-detected from the printer-reported camera stream URL or the standard OEM fallback endpoint when firmware omits it
5 Image Entities
Active g-code thumbnail, plus 4 AD5X IFS slot color swatches (filament color + material label)
Control
Switches
LED control, plus Pro-only camera power toggle
Select Entity
Filtration mode control (Off/Internal/External)
4 Buttons
Pause, resume, cancel print jobs, and clear printer status directly from Home Assistant
Architecture
HTTP-First Design
Superior reliability compared to TCP-only implementations
Async/Await
Fully asynchronous for optimal Home Assistant integration
Auto-Discovery
UDP-based network discovery with manual fallback
Configurable Polling
Adjust update frequency from 5-300 seconds
Supported Hardware
Printer Model
Support Status
FlashForge Adventurer 5M
Supported
FlashForge Adventurer 5M Pro
Supported
FlashForge AD5X
Supported
Legacy TCP-only models (including Adventurer 4)
Not Supported
Feature availability is detected at runtime. The camera entity is always created, and it becomes available when the printer reports an active OEM stream URL or the standard OEM fallback stream endpoint responds. The camera power switch remains Pro-only.
This integration does not support legacy TCP-only printers.
Requirements
| Requirement | Details |
|-------------|---------|
| **Home Assistant** | 2025.1.0 or newer |
| **Python Library** | [flashforge-python-api](https://pypi.org/project/flashforge-python-api/) 1.2.0+ |
| **Network** | Local LAN connectivity to printer |
| **Printer Setup** | LAN mode enabled with serial number and check code |
Installation
| Method | Steps |
|--------|-------|
| **Via HACS (Recommended)** | 1. Open **HACS** in Home Assistant
2. Click on **Integrations**
3. Click the **⋮** menu (top right) → **Custom repositories**
4. Add repository:
• **URL**: `https://github.com/GhostTypes/ff-5mp-hass`
• **Category**: `Integration`
5. Click **Add**
6. Search for "FlashForge" in HACS
7. Click **Download**
8. **Restart Home Assistant** |
| **Manual Installation** | 1. Download the [latest release](https://github.com/GhostTypes/ff-5mp-hass/releases)
2. Extract the `custom_components/flashforge` folder
3. Copy to your Home Assistant `config/custom_components/` directory
4. Restart Home Assistant |
Configuration
| Step | Instructions |
|------|--------------|
| **Prerequisites: Enable LAN Mode** | Before adding the integration, you must enable LAN mode on your FlashForge printer:
1. On the printer touchscreen, go to **Settings** → **Network** → **LAN Mode**
2. Enable LAN mode
3. Note the **Check Code** (8-digit code) - you'll need this for setup
[Video Tutorial](https://www.youtube.com/watch?v=krdEGccZuKo) |
| **Option 1: Automatic Discovery (Recommended)** | 1. Go to **Settings** → **Devices & Services** → **Integrations**
2. Click **+ Add Integration**
3. Search for **"FlashForge"**
4. Select your AD5X, Adventurer 5M, or Adventurer 5M Pro from the discovered list
5. Enter your printer's **Check Code**
6. Click **Submit** |
| **Option 2: Manual Configuration** | 1. Go to **Settings** → **Devices & Services** → **Integrations**
2. Click **+ Add Integration**
3. Search for **"FlashForge"**
4. Select **"Configure Manually"**
5. Enter:
• **IP Address**: Your printer's IP (e.g., `192.168.1.100`)
• **Printer Name**: Friendly name (optional)
• **Serial Number**: From printer settings
• **Check Code**: From LAN mode settings
6. Click **Submit** |
| **Configuration Options** | After setup, you can adjust settings:
1. Go to **Settings** → **Devices & Services** → **FlashForge**
2. Click **⋮** on your printer → **Configure**
3. **Scan Interval**: Update frequency in seconds (5-300, default: 10) |
| **LED Switch Override** | If your printer's LED switch is not detected but you know it is supported, enable **Always show LED switch** in the options. This will force the LED switch to appear regardless of printer capability checks. |
Available Entities
### Sensors
| Entity | Description | Unit |
|--------|-------------|------|
| `sensor.flashforge_machine_status` | Current printer state (idle, printing, paused, error) | - |
| `sensor.flashforge_nozzle_temperature` | Current extruder temperature | °C |
| `sensor.flashforge_nozzle_target_temperature` | Target extruder temperature | °C |
| `sensor.flashforge_bed_temperature` | Current bed temperature | °C |
| `sensor.flashforge_bed_target_temperature` | Target bed temperature | °C |
| `sensor.flashforge_print_progress` | Print completion percentage | % |
| `sensor.flashforge_current_file` | Currently printing file name | - |
| `sensor.flashforge_current_layer` | Current layer number | - |
| `sensor.flashforge_total_layers` | Total layer count | - |
| `sensor.flashforge_elapsed_time` | Time spent printing | seconds |
| `sensor.flashforge_remaining_time` | Estimated time remaining | seconds |
| `sensor.flashforge_filament_length` | Estimated filament length needed | meters |
| `sensor.flashforge_filament_weight` | Estimated filament weight | grams |
| `sensor.flashforge_print_speed` | Speed adjustment percentage | % |
| `sensor.flashforge_z_offset` | Z-axis compensation | mm |
| `sensor.flashforge_nozzle_size` | Installed nozzle size | - |
| `sensor.flashforge_filament_type` | Current filament type | - |
| `sensor.flashforge_lifetime_filament` | Total filament used over printer lifetime | meters |
| `sensor.flashforge_lifetime_runtime` | Total runtime over printer lifetime | - |
### Binary Sensors
| Entity | Description | Device Class |
|--------|-------------|--------------|
| `binary_sensor.flashforge_printing` | On when actively printing | `running` |
| `binary_sensor.flashforge_online` | On when printer is connected | `connectivity` |
| `binary_sensor.flashforge_error` | On when error detected | `problem` |
| `binary_sensor.flashforge_paused` | On when print is paused | - |
### Switches
| Entity | Description | Availability |
|--------|-------------|--------------|
| `switch.flashforge_led` | Control printer LED lights | All Models |
| `switch.flashforge_camera` | Toggle the OEM camera power state | Pro models |
### Select Entities
| Entity | Description | Options | Availability |
|--------|-------------|---------|--------------|
| `select.flashforge_filtration_mode` | Control filtration system | Off, Internal, External | Model-dependent |
### Buttons
| Entity | Description |
|--------|-------------|
| `button.flashforge_pause_print` | Pause active print job |
| `button.flashforge_resume_print` | Resume paused print job |
| `button.flashforge_cancel_print` | Cancel and abort print job |
| `button.flashforge_clear_status` | Clear printer status/errors |
### Camera
| Entity | Description |
|--------|-------------|
| `camera.flashforge_camera` | Live MJPEG stream from the printer-reported OEM camera URL |
Usage Examples
### Automation: Notify When Print Completes
```yaml
automation:
- alias: "3D Print Complete Notification"
trigger:
- platform: state
entity_id: binary_sensor.flashforge_printing
from: "on"
to: "off"
action:
- service: notify.mobile_app
data:
title: "Print Complete"
message: "{{ states('sensor.flashforge_current_file') }} finished printing!"
```
### Automation: Alert on Print Error
```yaml
automation:
- alias: "3D Printer Error Alert"
trigger:
- platform: state
entity_id: binary_sensor.flashforge_error
to: "on"
action:
- service: notify.mobile_app
data:
title: "Printer Error"
message: "FlashForge printer has encountered an error!"
data:
priority: high
```
### Automation: Turn Off LED When Print Finishes
```yaml
automation:
- alias: "Turn Off Printer LED After Print"
trigger:
- platform: state
entity_id: binary_sensor.flashforge_printing
from: "on"
to: "off"
action:
- service: switch.turn_off
target:
entity_id: switch.flashforge_led
```
### Lovelace Card Example
```yaml
type: entities
title: FlashForge Printer
entities:
- entity: sensor.flashforge_machine_status
- entity: binary_sensor.flashforge_printing
- entity: sensor.flashforge_print_progress
- entity: sensor.flashforge_nozzle_temperature
- entity: sensor.flashforge_bed_temperature
- entity: sensor.flashforge_remaining_time
- type: divider
- entity: button.flashforge_pause_print
- entity: button.flashforge_resume_print
- entity: button.flashforge_cancel_print
- entity: button.flashforge_clear_status
- type: divider
- entity: switch.flashforge_led
- entity: switch.flashforge_camera
- entity: select.flashforge_filtration_mode
```
### Camera Card
```yaml
type: picture-glance
camera_image: camera.flashforge_camera
entities:
- binary_sensor.flashforge_printing
- sensor.flashforge_print_progress
```
Troubleshooting
| Issue | Problem | Solutions |
|-------|---------|-----------|
| **Discovery Not Finding Printer** | Automatic discovery doesn't detect your printer | • Ensure printer is on the same network/subnet as Home Assistant
• Check firewall settings (UDP port 18007 must be open)
• Verify LAN mode is enabled on the printer
• Try manual configuration with IP address |
| **Connection Failed During Setup** | Setup fails with connection error | • Verify printer has LAN mode enabled
• Check the check code is correct (codes can expire)
• Ensure printer is powered on and connected to network
• Test API access manually: `http://:8898/info`
• Verify serial number matches printer label |
| **Entities Show "Unavailable"** | Integration installed but entities are unavailable | • Check printer is online and reachable
• Verify credentials are still valid
• Reload the integration: Settings → Integrations → FlashForge → ⋮ → Reload
• Check Home Assistant logs for connection errors |
| **Camera Entity Unavailable** | The camera entity shows unavailable | • The camera entity is always created, but it only becomes available when the printer reports an active OEM camera stream URL or the standard OEM fallback stream endpoint responds
• Verify the OEM camera is installed and enabled on the printer
• The `switch.flashforge_camera` power control remains Pro-only |
| **Python API Not Installing** | Integration fails due to missing flashforge-python-api | • Verify Home Assistant has internet access
• Check PyPI is reachable: https://pypi.org/project/flashforge-python-api/
• Try manual install: `pip install flashforge-python-api` in HA environment
• Restart Home Assistant after installation |
| **Static IP Recommended** | - | For best reliability, assign a static IP address to your printer in your router's DHCP settings. This prevents connection issues if the printer's IP changes. |
Related Projects
Project
Description
Link
Python API Library
Core HTTP API client for FlashForge printers
ff-5mp-api-py
TypeScript API Library
TypeScript/JavaScript API client
ff-5mp-api-ts
FlashForgeUI
Cross-platform monitoring & control application
FlashForgeUI-Electron
License
If you find this integration useful, please star the repository!