A comprehensive local custom integration linking AstroBox gateways and compatible 3D printers directly into your Home Assistant smart home system.
This custom integration provides local monitoring and automation capabilities for AstroBox deployments without relying on external cloud infrastructure. By targeting local REST API frameworks, it enables real-time telemetry tracking and hardware command controls over a local area network connection.
- Automated API Key Extraction: Eliminates the manual process of hunting down hidden security tokens. The config flow requests only the local address, then extracts the internal
UI_API_KEYstraight from the gateway's frontend login script headers. - Unified Device Representation: Maps sensors, binary flags, configuration inputs, control buttons, and selector options under a single consolidated Device Card within the Home Assistant interface.
- Local Network Flexibility:
- Hostname Addressability: Supports local mDNS address parsing (e.g.,
astrobox.local) alongside standard fixed IPv4 addresses. Connection processes explicitly handle mDNS routing adjustments to force IPv4 transport mechanisms exclusively, preventing common mDNS IPv6 resolution failures. - Optional MAC Address Network Profile Fusion: Allows you to input an optional network hardware MAC address. When specified, Home Assistant cross-references this token against network tracking integrations (like UniFi, Omada, or OPNsense) to dynamically merge system connectivity metrics directly into the same printer device card.
- Hostname Addressability: Supports local mDNS address parsing (e.g.,
- Resilient Lifecycle Handshakes: Gracefully catches hardware power-state cycles. If the physical 3D printer is switched off at the wall while the underlying Raspberry Pi or gateway computer remains active, the integration intercepts the resulting HTTP
409 Conflicterrors. This updates entities to anOfflineorUnavailablestate cleanly, protecting system logs from traceback exceptions.
| Platform | Entity Name | Functional Description |
|---|---|---|
| Sensor | Nozzle Temperature | Active extruder temperature telemetry (°C). Keeps target limits visible as an attribute. |
| Sensor | Bed Temperature | Print surface bed temperature telemetry (°C). Keeps target limits visible as an attribute. |
| Sensor | Print Progress | Completion metrics percentage indicator (%). Includes file name, byte size, and filament requirements as state attributes. |
| Sensor | Printer State | Explicit string representation of current operations (Printing, Operational, Paused, Offline). |
| Sensor | Print Time Elapsed | Cumulative active runtime tracker (seconds). |
| Sensor | Print Time Remaining | Live countdown timer tracking remaining duration until completion (seconds). |
| Sensor | Print ETA | Static timestamp tracking absolute completion time matching your system timezone clock. |
| Sensor | Storage Disk Usage | Tracks host gateway filesystem memory usage thresholds (%). |
| Binary Sensor | Connection Status | Binary indicator showing gateway communication availability. |
| Binary Sensor | Error Status | Dedicated safety tracking node watching internal firmware error signals. |
| Button | Connect Printer | Commands the local gateway to open and claim the hardware serial line. |
| Button | Disconnect Printer | Safely disconnects the active serial line link. |
| Button | Wakeup Nudge | Forwards harmless serial text signals (M117, M105) to wake stalled microcontrollers. |
| Button | System Operations | Advanced controls to power cycle services, reboot the operating system, or execute safe system shutdowns. |
| Number | Nozzle / Bed Targets | Dynamic input numbers mapping custom target temperatures onto live hardware heating matrices. |
| Select | Preheat Profile | A drop-down selection macro setting material heating presets (PLA, PETG, ABS) to both elements concurrently. |
- Navigate to your Home Assistant instance dashboard.
- Select HACS (Home Assistant Community Store) -> Integrations.
- Click the Three Dots Menu located in the top-right corner, then click Custom repositories.
- Input the repository URL into the Repository prompt field:
[https://github.com/Michael-O-Power/ha_astrobox](https://github.com/Michael-O-Power/ha_astrobox) - Assign Integration as the functional Category, then click Add.
- Select the freshly populated AstroBox 3D Printer entry from your list, select Download, and fetch the desired version bundle.
- Restart your Home Assistant server to load and register the component directory structure.
- Download the target release source package as a structured
.ziparchive. - Unzip the code bundle and identify the interior
custom_components/astrobox/folder directory. - Access your Home Assistant runtime directories via secure SFTP, Samba sharing, or the Terminal & SSH add-on.
- Copy the entire
astroboxfolder path explicitly into your custom components directory:config/custom_components/astrobox/ - Verify structural folder read/write file permissions and execute a full core framework reboot of Home Assistant.
Once the integration assets have loaded into your deployment environment, initialize your connection by following these instructions:
- Navigate to Settings -> Devices & Services -> Integrations.
- Click the floating + Add Integration button in the lower-right corner.
- Search for AstroBox 3D Printer and select it to initialize the setup block.
- Complete the input validation options:
- Host: Supply either the static IP network allocation address or the local mDNS hostname string (e.g.,
192.168.68.58orcocooncreate.local). - MAC Address (Optional): Input the network interface hardware MAC address matching your box platform (e.g.,
AA:BB:CC:DD:EE:FF). This allows Home Assistant to automatically group and align your printer with existing network profiles tracking client status.
- Host: Supply either the static IP network allocation address or the local mDNS hostname string (e.g.,
- Click Submit.
The integration will access the target host web template, extract the active authentication token automatically, check core system characteristics against your firmware parameters (
v0.21(3)baseline architectures), and generate your dashboard controller card.