Automating 3D Printer Chamber Light Using Home Assistant

Fulcrum

Bambulab 3D printers have lights built in, which are great to see what’s going on inside the print chamber for enclosed models and on the camera/in the dark. Unfortunately after completing a print job the light remains on and has to be manually turned off.

The solution for me was to setup a quick automation to turn the light off a couple minutes after the print finishes.

While extremely simple this has quickly become one of my more frequently used automations.

Automation Logic

When
  Print finished

Then do
  Delay for 5:00
  Test If 3D Print Finished is On
  Turn off Chamber light

💡 Tip

The second condition action can be used after the timer in order to prevent the light turning off in the middle of printing when running another print job immediately after.

    flowchart TD
trigger(Print finished) --> wait

wait[Delay for 5:00] --> state{Test If 3D Print Finished is On}
state --> |On| action[Turn off Chamber light]
state --> |Off| nop[No Action]

While the Home Assistant GUI is the easiest way to configure and maintain Automations, a YAML version of the example is available below.

alias: 3D Printer Chamber Light Off
description: ""
triggers:
  - device_id: 1234567890abcdef1234567890abcdef
    domain: bambu_lab
    type: event_print_finished
    trigger: device
conditions: []
actions:
  - delay:
      hours: 0
      minutes: 5
      seconds: 0
      milliseconds: 0
  - condition: state
    entity_id: automation.3d_print_finished
    state: "on"
  - type: turn_off
    device_id: 1234567890abcdef1234567890abcdef
    entity_id: fedcba9876543210fedcba9876543210
    domain: light
mode: single

Next post

Example