Skip to content

Instantly share code, notes, and snippets.

@bbbenji
Last active February 16, 2024 12:10
Show Gist options
  • Save bbbenji/8b38cfd891810fc4f4c4f5fd9d1e54df to your computer and use it in GitHub Desktop.
Save bbbenji/8b38cfd891810fc4f4c4f5fd9d1e54df to your computer and use it in GitHub Desktop.
Bambu Lab Automation Suite - Manage lights and notifications for Bambu Lab.
blueprint:
name: Bambu Lab X1C Automation Suite
description: Manage lights and notifications for Bambu Lab X1C with customizable trigger settings.
domain: automation
input:
print_finished_delay:
name: Print Finished Delay
description: Delay in minutes after print finished before executing the next action.
default: 0 # Default to no delay.
selector:
number:
min: 0
max: 60
unit_of_measurement: minutes
mode: slider
enable_x1c_chamber_light_trigger:
name: Enable X1C Chamber Light Trigger
description: Toggle the automation trigger based on the X1C chamber light state.
default: true
selector:
boolean: {}
enable_print_finished_trigger:
name: Enable Print Finished Trigger
description: Toggle the automation trigger for print finished events.
default: true
selector:
boolean: {}
enable_error_sensor_trigger:
name: Enable Error Sensor Trigger
description: Toggle the automation trigger based on the X1C error sensor state.
default: true
selector:
boolean: {}
external_light:
name: External Light
description: Light to be toggled by the X1C chamber light.
selector:
entity:
domain: light
x1c_chamber_light:
name: X1C Chamber Light
description: The X1C chamber light to monitor.
selector:
entity:
domain: light
bambu_lab_printer:
name: Bambu Lab Printer
description: The Bambu Lab printer to monitor for print finished events.
selector:
device:
integration: bambu_lab
error_sensor:
name: X1C Error Sensor
description: Sensor to monitor for X1C errors.
selector:
entity:
domain: binary_sensor
notification_device:
name: Notification Device
description: Device to send notifications to.
selector:
device:
integration: mobile_app
trigger:
- platform: state
entity_id: !input 'x1c_chamber_light'
from: "off"
to: "on"
- platform: state
entity_id: !input 'x1c_chamber_light'
from: "on"
to: "off"
- platform: device
device_id: !input 'bambu_lab_printer'
domain: bambu_lab
type: event_print_finished
- platform: state
entity_id: !input 'error_sensor'
to: "on"
action:
- choose:
- conditions: "{{ is_state('input_boolean.enable_x1c_chamber_light_trigger', 'on') }}"
sequence:
- choose:
- conditions: "{{ trigger.platform == 'state' and trigger.entity_id == states('input_x1c_chamber_light').entity_id }}"
sequence:
- choose:
- conditions: "{{ is_state('input_x1c_chamber_light', 'off') }}"
sequence:
- service: light.turn_off
target:
entity_id: !input 'external_light'
- conditions: "{{ is_state('input_x1c_chamber_light', 'on') }}"
sequence:
- service: light.turn_on
target:
entity_id: !input 'external_light'
- conditions: "{{ is_state('input_boolean.enable_print_finished_trigger', 'on') }}"
sequence:
- delay:
minutes: "{{ states('input_number.print_finished_delay') | int }}"
- service: light.turn_off
target:
entity_id: !input 'x1c_chamber_light'
- conditions: "{{ is_state('input_boolean.enable_error_sensor_trigger', 'on') }}"
sequence:
- service: notify.mobile_app
data:
message: "X1C issue detected - ({{ state_attr('input_error_sensor', '1-Severity') }})"
title: "{{ state_attr('input_error_sensor', '1-Error') }}"
data:
actions:
- action: "URI"
title: "See possible solutions on Bambu Lab Wiki"
uri: "{{ state_attr('input_error_sensor', '1-Wiki') }}"
target:
device_id: !input 'notification_device'
mode: single
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment