My Bambu Lab X1C Dashboard & Automations

Perhaps this is a really dumb question. But where do I find the access code required for LAN connection? I cannot find this anywhere in the settings of the printer. I read some things about it only being available at binding it to an account. But I did that already.

The Cloud option doesnt work for me.

I fixed it on mine, my issue was that my AMS was named different than what I had. Mine was just “p1p_ams” and the .yaml has it as “x1c_ams_1” I had changed to p1p but didn’t see the _1 at the end at first

On the printer’s display, Settings, General tab. It’s on the left.

1 Like

here is my A1 dashboard, i use tapo as camera. I dont use external spool.

Requirements:
Bambu Lab
Mushroom
card-mod
hui-element

code:

type: vertical-stack
cards:
  - type: horizontal-stack
    cards:
      - type: custom:mushroom-title-card
        title: Bambu Lab A1
        alignment: start
      - type: custom:mod-card
        card:
          type: custom:mushroom-chips-card
          chips:
            - type: entity
              entity: switch.3d_printer
              icon: mdi:power
              content_info: false
              tap_action:
                action: call-service
                service: switch.toggle
                service_data:
                  entity_id: switch.3d_printer
                confirmation:
                  text: Toggle Printer Power?
                  dismiss: false
            - type: conditional
              conditions:
                - entity: sensor.a1_printer_print_status
                  state: running
              chip:
                type: entity
                entity: button.a1_printer_pause_printing
                icon: mdi:pause
                content_info: false
                tap_action:
                  action: call-service
                  service: button.press
                  service_data:
                    entity_id: button.a1_printer_pause_printing
            - type: conditional
              conditions:
                - entity: sensor.a1_printer_print_status
                  state: pause
              chip:
                type: entity
                entity: button.a1_printer_resume_printing
                icon: mdi:play
                content_info: false
                tap_action:
                  action: call-service
                  service: button.press
                  service_data:
                    entity_id: button.a1_printer_resume_printing
            - type: conditional
              conditions:
                - entity: sensor.a1_printer_print_status
                  state: running
              chip:
                type: entity
                entity: button.a1_printer_stop_printing
                icon: mdi:stop
                content_info: false
                tap_action:
                  action: call-service
                  service: button.press
                  service_data:
                    entity_id: button.a1_printer_stop_printing
                  confirmation:
                    text: Cancel print?
                    dismiss: false
            - type: conditional
              conditions:
                - entity: sensor.a1_printer_print_status
                  state: pause
              chip:
                type: entity
                entity: button.a1_printer_stop_printing
                icon: mdi:stop
                content_info: false
                tap_action:
                  action: call-service
                  service: button.press
                  service_data:
                    entity_id: button.a1_printer_stop_printing
                  confirmation:
                    text: Cancel print?
                    dismiss: false
        card_mod:
          style: |
            ha-card {
              display: flex;
              justify-content: end;
              align-items: center;
              height: 80px;
            }
  - type: custom:mod-card
    card:
      camera_view: live
      type: picture-glance
      entities: []
      camera_image: camera.a1_cam
  - type: custom:mod-card
    card_mod:
      style:
        hui-horizontal-stack-card $: |
          div#root > :first-child > * {
            width: 20%;
            flex: auto; 
          }
          div#root > :last-child > * {
            width: 80%;
            flex: auto; 
          }
    card:
      type: horizontal-stack
      cards:
        - type: custom:mushroom-chips-card
          chips:
            - type: template
              entity: binary_sensor.a1_printer_online
              content: AMS
              card_mod:
                style: |
                  ha-card {
                    background: none !important;
                    border: none;
                    font-size: 4rem !important;
                  }
            - type: spacer
            - type: conditional
              conditions:
                - entity: sensor.a1_printer_print_status
                  state: running
              chip:
                type: entity
                entity: sensor.a1_printer_task_name
                icon: mdi:clipboard-check
                tap_action:
                  action: more-info
                  entity: image.a1_printer_cover_image
            - type: conditional
              conditions:
                - entity: sensor.a1_printer_print_status
                  state: pause
              chip:
                type: entity
                entity: sensor.a1_printer_task_name
                icon: mdi:clipboard-check
                tap_action:
                  action: more-info
                  entity: image.a1_printer_cover_image
  - type: horizontal-stack
    cards:
      - type: custom:mod-card
        card_mod:
          style: |
            ha-card {
              font-size: 10px;
              --tray_1_color: {{state_attr('sensor.a1_ams_tray_1', 'color') }};
              --tray_2_color: {{state_attr('sensor.a1_ams_tray_2', 'color') }};
              --tray_3_color: {{state_attr('sensor.a1_ams_tray_3', 'color') }};
              --tray_4_color: {{state_attr('sensor.a1_ams_tray_4', 'color') }};
              --tray_1_bg: {% if is_state_attr('sensor.a1_ams_tray_1', 'active', true) %} rgba(255,254,249, 0.5); {% else %} rgba(111,111,111, 0.2) {% endif %};
              --tray_2_bg: {% if is_state_attr('sensor.a1_ams_tray_2', 'active', true) %} rgba(255,254,249, 0.5); {% else %} rgba(111,111,111, 0.2) {% endif %};
              --tray_3_bg: {% if is_state_attr('sensor.a1_ams_tray_3', 'active', true) %} rgba(255,254,249, 0.5); {% else %} rgba(111,111,111, 0.2) {% endif %};
              --tray_4_bg: {% if is_state_attr('sensor.a1_ams_tray_4', 'active', true) %} rgba(255,254,249, 0.5); {% else %} rgba(111,111,111, 0.2) {% endif %};
            }
        card:
          card_mod:
            style: |
              .entities {
                align-items: start !important;
              }
          show_name: false
          show_icon: true
          show_state: true
          type: glance
          entities:
            - entity: sensor.a1_ams_tray_1
              icon: mdi:circle-slice-8
              card_mod:
                style: |
                  :host {
                    --paper-item-icon-color: var(--tray_1_color);
                  }
                  state-badge {
                    background-color: var(--tray_1_bg);
                    border-radius: 50%;
                  }
                  div {
                    white-space: unset !important;
                    text-wrap: balance !important;
                  }
            - entity: sensor.a1_ams_tray_2
              icon: mdi:circle-slice-8
              card_mod:
                style: |
                  :host {
                    --paper-item-icon-color: var(--tray_2_color);
                  }
                  state-badge {
                    background-color: var(--tray_2_bg);
                    border-radius: 50%;
                  }
                  div {
                    white-space: unset !important;
                    text-wrap: balance !important;
                  }
            - entity: sensor.a1_ams_tray_3
              icon: mdi:circle-slice-8
              card_mod:
                style: |
                  :host {
                    --paper-item-icon-color: var(--tray_3_color);
                  }
                  state-badge {
                    background-color: var(--tray_3_bg);
                    border-radius: 50%;
                  }
                  div {
                    white-space: unset !important;
                    text-wrap: balance !important;
                  }
            - entity: sensor.a1_ams_tray_4
              icon: mdi:circle-slice-8
              card_mod:
                style: |
                  :host {
                    --paper-item-icon-color: var(--tray_4_color);
                  }
                  state-badge {
                    background-color: var(--tray_4_bg);
                    border-radius: 50%;
                  }
                  div {
                    white-space: unset !important;
                    text-wrap: balance !important;
                  }
  - type: custom:mod-card
    card:
      type: custom:mushroom-chips-card
      chips:
        - type: template
          entity: binary_sensor.a1_printer_online
          content: Printer
          card_mod:
            style: |
              ha-card {
                background: none !important;
                border: none;
                font-size: 4rem !important;
              }
        - type: spacer
        - type: entity
          entity: sensor.a1_printer_current_stage
        - type: entity
          entity: binary_sensor.a1_printer_hms_errors
          icon: mdi:alert-circle-outline
  - type: custom:mod-card
    card:
      show_name: false
      show_icon: true
      show_state: true
      type: glance
      entities:
        - entity: sensor.a1_printer_nozzle_temperature
          icon: mdi:printer-3d-nozzle
        - entity: sensor.a1_printer_bed_temperature
          icon: mdi:train-car-flatbed
        - entity: sensor.3d_printer_current_consumption
          icon: mdi:lightning-bolt
      state_color: false
  - type: custom:mod-card
    card:
      type: custom:mushroom-chips-card
      chips:
        - type: spacer
        - type: entity
          entity: sensor.a1_printer_print_progress
          icon: mdi:progress-helper
        - type: entity
          entity: sensor.a1_printer_end_time
          icon: mdi:progress-check
        - type: entity
          entity: sensor.a1_printer_remaining_time
          icon: mdi:timer-sand
  - type: custom:mod-card
    card:
      type: custom:mushroom-chips-card
      chips:
        - type: template
          entity: binary_sensor.a1_printer_online
          content: Modes
          card_mod:
            style: |
              ha-card {
                background: none !important;
                border: none;
                font-size: 4rem !important;
              }
  - type: horizontal-stack
    cards:
      - type: custom:hui-element
        card_type: button
        entity: select.a1_printer_printing_speed
        name: Silent
        icon: mdi:speedometer-slow
        tap_action:
          action: call-service
          service: select.select_option
          data:
            option: silent
          target:
            entity_id: select.a1_printer_printing_speed
        card_mod:
          style: |
            ha-card {
              box-shadow: none !important;
              background-color: rgba(0,0,0,0);
              border: none;
              --paper-item-icon-color: {% if is_state('select.a1_printer_printing_speed', 'Silent') or is_state('select.a1_printer_printing_speed', 'silent') %} rgba(68,115,158,1); {% else %} grey; {% endif %}
            }
      - type: custom:hui-element
        card_type: button
        entity: select.a1_printer_printing_speed
        name: Standard
        icon: mdi:speedometer-medium
        tap_action:
          action: call-service
          service: select.select_option
          data:
            option: standard
          target:
            entity_id: select.a1_printer_printing_speed
        card_mod:
          style: |
            ha-card {
              box-shadow: none !important;
              background-color: rgba(0,0,0,0);
              border: none;
              --paper-item-icon-color: {% if is_state('select.a1_printer_printing_speed', 'Standard') or is_state('select.a1_printer_printing_speed', 'standard') %} green; {% else %} grey; {% endif %}
            }
      - type: custom:hui-element
        card_type: button
        entity: select.a1_printer_printing_speed
        name: Sport
        icon: mdi:speedometer
        tap_action:
          action: call-service
          service: select.select_option
          data:
            option: sport
          target:
            entity_id: select.a1_printer_printing_speed
        card_mod:
          style: |
            ha-card {
              box-shadow: none !important;
              background-color: rgba(0,0,0,0);
              border: none;
              --paper-item-icon-color: {% if is_state('select.a1_printer_printing_speed', 'Sport') or is_state('select.a1_printer_printing_speed', 'sport') %} yellow ; {% else %} grey; {% endif %}
            }
      - type: custom:hui-element
        card_type: button
        entity: select.a1_printer_printing_speed
        name: Ludicrous
        icon: mdi:speedometer
        tap_action:
          action: call-service
          service: select.select_option
          data:
            option: ludicrous
          target:
            entity_id: select.a1_printer_printing_speed
        card_mod:
          style: |
            ha-card {
              box-shadow: none !important;
              background-color: rgba(0,0,0,0);
              border: none;
              --paper-item-icon-color: {% if is_state('select.a1_printer_printing_speed', 'Ludicrous') or is_state('select.a1_printer_printing_speed', 'ludicrous') %} red; {% else %} grey; {% endif %}
            }

This looks nice - how did you add the image of the model being printed?

The entity is called:
image.a1_cover_image

This is such a popular printer, there should be an official integration to hass. How do you request integrations?

@benji Thank you for the code :+1: I adapted it to my liking, it is awesome.

1 Like

Hi, can you share code of your beautiful configuration
Thanks

Here is my code:

  - icon: mdi:alpha-a-box-outline
    title: Bambu A1
    id: bambua1
    cards:


    - type: vertical-stack
      cards:
        - type: horizontal-stack
          cards:
            - type: custom:mushroom-title-card
              title: '{{ states.sensor.a1_printer_name.state }}'
              alignment: start
        - type: custom:mod-card
          card:
            # camera_view: live
            type: picture-glance
            entities: []
            camera_image: camera.a1_camera

        - type: horizontal-stack
          cards:
            - type: custom:mod-card
              card:
                type: picture-entity
                entity: image.a1_cover_image  
                camera_view: auto
                show_name: false
                show_state: false

            - type: vertical-stack
              cards:
                - type: markdown
                  content: >
                    <font size="5">{{ states.sensor.a1_task_name.state }}</font>

                    <table width=100%><tr><td align=left>Printed layers<td align=right><font color=#77fc54 ; size="4">{{ states.sensor.a1_current_layer.state}}</font>/{{states.sensor.a1_total_layer_count.state}}</td></tr></table>

                    <table width=100%><tr>
                    <td align=left><font size="5";color=#77fc54>{{ states.sensor.a1_print_progress.state}}%<td align=right>   
                    {% if (states.sensor.a1_remaining_time.state | int) == 0 %}
                      Success  
                    {% else %}
                      <font color=#959595>-{{(states.sensor.a1_remaining_time.state | int/60) | int  }}h{{ states.sensor.a1_remaining_time.state| int % 60 }}m 
                    {% endif %}
                    </td>
                    </tr></table>


                - type: 'custom:bar-card'           

                  entity: sensor.a1_print_progress
                  icon: 'off'
                  name: Progress
                  positions:
                    icon: 'off'
                    indicator: 'off'
                    title: inside
                    value: inside
                  severity:

                    - color: green #'#77fc54'
                      from: 0
                      to: 100


        - type: horizontal-stack
          cards:
          
          - type: custom:button-card
            # color: rgb(0, 255, 0)
            color_type: icon
            entity: button.a1_resume_printing
            
            icon: mdi:play
            name: Resume
            layout: icon_name            
            card_mod:
              style: |
                :host {
                    --paper-item-icon-color: green}
                ha-card {
                  height: 60px;
                }    

          - type: custom:button-card
            # color: rgb(0, 255, 0)
            color_type: icon
            entity: button.a1_pause_printing
            
            icon: mdi:pause
            name: Pause
            card_mod:
              style: |
                :host {
                    --paper-item-icon-color: rgreen}
                ha-card {
                  height: 60px;
                }       
            layout: icon_name_state
            confirmation:
              text: '[[[ return `Are you sure you want to pause the print?` ]]]' 


          - type: custom:button-card
            color: rgb(255, 0, 0)
            color_type: icon
            entity: button.a1_stop_printing
            
            icon: mdi:stop
            name: Stop
            card_mod:
              style: |
                :host {
                    --paper-item-icon-color: red}
                ha-card {
                  height: 60px;
                }
            layout: icon_name_state                
            confirmation:
              text: '[[[ return `Are you sure you want to stop the print?` ]]]'        


        - type: custom:mod-card
          card_mod:
            style:
              hui-horizontal-stack-card $: |
                div#root > :first-child {
                  width: 20%;
                  flex: auto; 
                }
                div#root > :last-child {
                  width: 80%;
                  flex: auto; 
                }
          card:
            type: horizontal-stack
            cards:
              - type: custom:mushroom-chips-card
                chips:
                  - type: template
                    entity: binary_sensor.a1_online
                    content: EXT.
                    card_mod:
                      style: |
                        ha-card {
                          background: none !important;
                          border: none;
                          font-size: 4rem !important;
                        }
              - type: custom:mushroom-chips-card
                chips:
                  - type: template
                    entity: binary_sensor.a1_online
                    content: AMS
                    card_mod:
                      style: |
                        ha-card {
                          background: none !important;
                          border: none;
                          font-size: 4rem !important;
                        }
                  - type: spacer
                  # - type: entity
                  #   entity: sensor.a1_ams_1_temperature
                  - type: entity
                    entity: sensor.a1_ams_1_humidity_index
                    icon: mdi:water-opacity
        - type: custom:mod-card
          card_mod:
            style:
              hui-horizontal-stack-card $: |
                div#root > :first-child {
                  width: 20%;
                  flex: auto; 
                }
                div#root > :last-child {
                  width: 80%;
                  flex: auto; 
                }
          card:
            type: horizontal-stack
            cards:
              - type: custom:mod-card
                card_mod:
                  style: |
                    ha-card {
                      font-size: 10px;
                      --external_spool_color: {{state_attr('sensor.a1_externalspool_external_spool', 'color') }};
                      --tray_1_color: {{state_attr('sensor.a1_ams_1_tray_1', 'color') }};
                      --tray_2_color: {{state_attr('sensor.a1_ams_1_tray_2', 'color') }};
                      --tray_3_color: {{state_attr('sensor.a1_ams_1_tray_3', 'color') }};
                      --tray_4_color: {{state_attr('sensor.a1_ams_1_tray_4', 'color') }};
                      --external_spool_bg: {% if is_state_attr('sensor.a1_externalspool_external_spool', 'active', true) %} rgba(255,254,249, 0.25); {% else %} rgba(111,111,111, 0.2) {% endif %};
                      --tray_1_bg: {% if is_state_attr('sensor.a1_ams_1_tray_1', 'active', true) %} rgba(255,254,249, 0.25); {% else %} rgba(111,111,111, 0.2) {% endif %};
                      --tray_2_bg: {% if is_state_attr('sensor.a1_ams_1_tray_2', 'active', true) %} rgba(255,254,249, 0.25); {% else %} rgba(111,111,111, 0.2) {% endif %};
                      --tray_3_bg: {% if is_state_attr('sensor.a1_ams_1_tray_3', 'active', true) %} rgba(255,254,249, 0.25); {% else %} rgba(111,111,111, 0.2) {% endif %};
                      --tray_4_bg: {% if is_state_attr('sensor.a1_ams_1_tray_4', 'active', true) %} rgba(255,254,249, 0.25); {% else %} rgba(111,111,111, 0.2) {% endif %};
                    }
                card:
                  card_mod:
                    style: |
                      .entities {
                        align-items: start !important;
                      }
                  show_name: false
                  show_icon: true
                  show_state: true
                  type: glance
                  entities:
                    - entity: sensor.a1_externalspool_external_spool
                      icon: mdi:circle-slice-8
                      card_mod:
                        style: |
                          :host {
                            --paper-item-icon-color: var(--external_spool_color);
                          }
                          state-badge {
                            background-color: var(--external_spool_bg);
                            border-radius: 50%;
                          }
                          div {
                            white-space: unset !important;
                            text-wrap: balance !important;
                          }
              - type: custom:mod-card
                card_mod:
                  style: |
                    ha-card {
                      font-size: 10px;
                      --external_spool_color: {{state_attr('sensor.a1_externalspool_external_spool', 'color') }};
                      --tray_1_color: {{state_attr('sensor.a1_ams_1_tray_1', 'color') }};
                      --tray_2_color: {{state_attr('sensor.a1_ams_1_tray_2', 'color') }};
                      --tray_3_color: {{state_attr('sensor.a1_ams_1_tray_3', 'color') }};
                      --tray_4_color: {{state_attr('sensor.a1_ams_1_tray_4', 'color') }};
                      --external_spool_bg: {% if is_state_attr('sensor.a1_externalspool_external_spool', 'active', true) %} rgba(255,254,249, 0.25); {% else %} rgba(111,111,111, 0.2) {% endif %};
                      --tray_1_bg: {% if is_state_attr('sensor.a1_ams_1_tray_1', 'active', true) %} rgba(255,254,249, 0.25); {% else %} rgba(111,111,111, 0.2) {% endif %};
                      --tray_2_bg: {% if is_state_attr('sensor.a1_ams_1_tray_2', 'active', true) %} rgba(255,254,249, 0.25); {% else %} rgba(111,111,111, 0.2) {% endif %};
                      --tray_3_bg: {% if is_state_attr('sensor.a1_ams_1_tray_3', 'active', true) %} rgba(255,254,249, 0.25); {% else %} rgba(111,111,111, 0.2) {% endif %};
                      --tray_4_bg: {% if is_state_attr('sensor.a1_ams_1_tray_4', 'active', true) %} rgba(255,254,249, 0.25); {% else %} rgba(111,111,111, 0.2) {% endif %};
                    }
                card:
                  card_mod:
                    style: |
                      .entities {
                        align-items: start !important;
                      }
                  show_name: false
                  show_icon: true
                  show_state: true
                  type: glance
                  entities:
                    - entity: sensor.a1_ams_1_tray_1
                      icon: mdi:circle-slice-8
                      card_mod:
                        style: |
                          :host {
                            --paper-item-icon-color: var(--tray_1_color);
                          }
                          state-badge {
                            background-color: var(--tray_1_bg);
                            border-radius: 50%;
                          }
                          div {
                            white-space: unset !important;
                            text-wrap: balance !important;
                          }
                    - entity: sensor.a1_ams_1_tray_2
                      icon: mdi:circle-slice-8
                      card_mod:
                        style: |
                          :host {
                            --paper-item-icon-color: var(--tray_2_color);
                          }
                          state-badge {
                            background-color: var(--tray_2_bg);
                            border-radius: 50%;
                          }
                          div {
                            white-space: unset !important;
                            text-wrap: balance !important;
                          }
                    - entity: sensor.a1_ams_1_tray_3
                      icon: mdi:circle-slice-8
                      card_mod:
                        style: |
                          :host {
                            --paper-item-icon-color: var(--tray_3_color);
                          }
                          state-badge {
                            background-color: var(--tray_3_bg);
                            border-radius: 50%;
                          }
                          div {
                            white-space: unset !important;
                            text-wrap: balance !important;
                          }
                    - entity: sensor.a1_ams_1_tray_4
                      icon: mdi:circle-slice-8
                      card_mod:
                        style: |
                          :host {
                            --paper-item-icon-color: var(--tray_4_color);
                          }
                          state-badge {
                            background-color: var(--tray_4_bg);
                            border-radius: 50%;
                          }
                          div {
                            white-space: unset !important;
                            text-wrap: balance !important;
                          }
        - type: custom:mod-card
          card:
            type: custom:mushroom-chips-card
            chips:
              - type: template
                entity: binary_sensor.a1_online
                content: Printer
                card_mod:
                  style: |
                    ha-card {
                      background: none !important;
                      border: none;
                      font-size: 4rem !important;
                    }
              - type: spacer
              - type: entity
                entity: sensor.a1_current_stage
              - type: light
                icon: mdi:lightbulb
                entity: light.a1_chamber_light
              - type: entity
                entity: sensor.a1_wi_fi_signal
              - type: entity
                entity: binary_sensor.a1_hms_errors
                icon: mdi:alert-circle
        - type: custom:mod-card
          card:
            show_name: false
            show_icon: true
            show_state: true
            type: glance
            entities:
              - entity: sensor.a1_nozzle_temperature
                icon: mdi:printer-3d-nozzle-heat
              - entity: sensor.a1_bed_temperature
                icon: mdi:radiator #mdi:train-car-flatbed
              # - entity: sensor.a1_chamber_temperature
              #   icon: mdi:minus-box-outline
              - entity: sensor.a1_speed_profile
                icon: mdi:speedometer
            state_color: false

        - type: custom:mushroom-chips-card
          chips:
            # - type: entity
            #   entity: sensor.a1_print_progress
            - type: entity
              entity: sensor.a1_end_time
          alignment: justify
1 Like

hi there, thank you posting this if i copy it and goto a blank dashboard and do raw editor and paste it, it does not work. it seems to throw indentation errors, which i tried to correct, but with no success.

any ideas?

Unable to parse YAML: YAMLException: bad indentation of a mapping entry (2:10) 1 | - icon: mdi:alpha-a-box-outline 2 | title: Bambu A1 --------------^ 3 | id: bambua1 4 | cards:

that is the error i am getting

The “copy” button seems to omit the first spaces before “-”. Just move the first “- icon” to be inline with the rest.

still having an issue, can you copy and paste which one i have to move?

Just control-a and copy the code above. It’s valid. The copy button doesn’t copy it right and it’s the first line of that code.

i did t hat but now i get this

Your configuration is not valid: r: Expected an object, but received: [object Object]

I thought I’d try and I’m getting the same error.

Your configuration is not valid: r: Expected an object, but received: [object Object]

1 Like

The code is for a1 and the sensor names are for that particular printer. You should change all sensor values to values of your own machine. Besides that I don’t think I could help anymore. As the code works for me.

I’ve managed to get it working. Think the code box on this forum has thrown off the formatting even more than thought. Thanks very much for sharing your code!

@kritikos24 send me a DM

2 Likes

My take on a dashboard for a P1S. The goal was to use as few dependencies as possible and avoid card_mod. Only dependency is Mushroom cards.