Skip to content

Home Assistant integration

Each printer becomes a Home Assistant device with a camera and sensors, 23 bruh_bambu.* services, an alert event, and a dashboard card.

Set it up

Settings › Home Assistant before the restart: the integration notice with Restart Home Assistant, and the dashboard card and Morph card, each marked installed with the line to paste

Restart Home Assistant once after installing the app. The Printers tab and Settings › Home Assistant show a banner with a Restart Home Assistant button. After the restart the integration sets itself up under Settings → Devices & services → BRUH Bambu Studio, with a device per printer.

An update asks for another restart only when the integration’s code changed. A change to the dashboard card alone needs a page reload.

The integration is installed and kept up to date by the enable_ha_integration option, on by default.

Entities

Each printer is a device named after the printer. With a printer called Workshop X1C:

Entity What it is
camera.workshop_x1c_camera The printer’s own camera, live over your network
sensor.workshop_x1c_status The printer’s own word — idle, prepare, running, pause, finish, failed — or offline when it is not reporting. Everything else is in its attributes: the stage, the AMS units, the tray in use, the spool holder, the fans and the HMS codes
sensor.workshop_x1c_stage What it is doing inside that state: levelling, heating, changing filament…
sensor.workshop_x1c_progress Progress, %
sensor.workshop_x1c_time_left Time left
sensor.workshop_x1c_nozzle_temperature Nozzle temperature
sensor.workshop_x1c_bed_temperature Bed temperature

Failure detection entities

With print failure detection on, the device also has:

Entity What it is
sensor.workshop_x1c_failure_detection off, idle, watching, looking, basic, warning, failure, covered, dark, frozen or no_camera, with the last look, the next one and any open alert as attributes
binary_sensor.workshop_x1c_print_problem On while an alert is open; level says warning or failure
binary_sensor.workshop_x1c_plate_clear The plate has been seen clear after a finish (works with detection off too)
binary_sensor.workshop_x1c_camera_covered The lens is covered
camera.workshop_x1c_last_print_check The frame brAIn last judged

Services

  • printer is the printer’s name or serial number. Leave it out when there is only one printer.
  • Every service answers with the result. A refusal, such as “Workshop X1C is already printing”, is raised with its reason, so it shows in the automation trace.
Service What it does
bruh_bambu.print_file Print a file from /share/bambu, sliced first if needed. slot / material / colour choose the filament for a bare model; plate, use_ams, ams_mapping, timelapse, bed_leveling, flow_cali, vibration_cali, layer_inspect, plate_type, speed, copies and settings are the print options
bruh_bambu.slice_file Slice a project or model (plate, machine, process, filaments, arrange, orient)
bruh_bambu.pause_print Pause the current print
bruh_bambu.resume_print Resume it
bruh_bambu.stop_print Stop it
bruh_bambu.import_url Import a model from a Printables page or a file link; answers with the new files’ paths
bruh_bambu.open_in_studio Open a file in the sidebar’s Bambu Studio

The print alert event

Every warning and failure fires bruh_bambu_print_alert with:

Field
printer The printer’s id
printer_name Its name
alert The alert’s id (pass it to print_alert_action)
level warning or failure
problem What brAIn saw
summary One line for a person
paused Whether the printer was paused

The printer card

Add BRUH Bambu printers from the Lovelace card picker (install_lovelace_card, on by default), or paste:

type: custom:bruh-bambu-card
# With no options it shows every printer. To show one:
entity: sensor.workshop_x1c_status
# Trim it:
show_camera: false
show_ams: false
show_controls: false
show_detection: false

entities: takes a list of status sensors to show several.

In Morph, the same card is type: custom:morph-bambu-printer, in Morph’s own look (install_morph_card). Morph picks it up within two minutes.

On the card
Always The printer’s name and state, the camera, the progress with the time left and the finish time, the temperatures, and Pause / Resume
Failure detection One line with its state. During an alert, what brAIn saw with Ignore and Pause print, or Resume and Stop
Behind ⋯ Stop (press twice), the speed, the chamber light, Refresh, Reconnect and the AMS trays

Automation examples

Flash a light when a print has a problem

triggers:
- trigger: state
entity_id: binary_sensor.workshop_x1c_print_problem
to: "on"
actions:
- action: light.turn_on
target: { entity_id: light.office }
data: { flash: long }

Tell me when the print is done

triggers:
- trigger: state
entity_id: sensor.workshop_x1c_status
to: finish
actions:
- action: notify.mobile_app_alex_phone
data:
title: Print finished
message: "{{ state_attr('sensor.workshop_x1c_status', 'printer_name') }} is done."
triggers:
- trigger: time
at: "06:00:00"
conditions:
- condition: state
entity_id: sensor.workshop_x1c_status
state: idle
actions:
- action: bruh_bambu.print_file
data:
file: imports/rotor.stl
printer: Workshop X1C
plate_type: textured_pei
copies: 4
settings:
layer_height: 0.16
walls: 4
print_sequence: by object

Designing from an automation

actions:
- action: bruh_bambu.design_part
data:
description: >-
A wall hook 4 cm long for a coat, two screw holes,
and print it on the Workshop X1C
name: Coat hook
response_variable: started

Designing takes minutes, so design_part answers as soon as brAIn has started, with the part’s id and name. To print the part, either:

  • put the print in the description, as above, and the conversation prints it once it has built, or
  • poll bruh_bambu.design_status until the version has built, then call bruh_bambu.print_part.