nice dashboard can you share code ?
Sure, no problem. There is a lot of entities that will need renaming. Probably easiest to do some ‘search and replace’ in notepad or something.
This is the main printer part (Left side)
Main printer code
type: vertical-stack
cards:
- type: custom:mod-card
card:
type: custom:mushroom-chips-card
chips:
- type: template
entity: binary_sensor.x1c_00m09d470100819_online
icon: phu:bambu-lab
card_mod:
style: |
ha-card {
background: none !important;
border: none;
font-size: 4rem !important;
}
- type: spacer
- type: entity
entity: sensor.x1c_00m09d470100819_current_stage
- type: light
icon: mdi:lightbulb
entity: light.x1c_00m09d470100819_chamber_light
- type: entity
entity: binary_sensor.x1c_00m09d470100819_hms_errors
icon: mdi:alert-circle
- type: custom:mod-card
card:
camera_view: live
type: picture-glance
entities: []
camera_image: camera.x1c_00m09d470100819_camera
- type: horizontal-stack
cards:
- type: custom:button-card
color: green
color_type: icon
entity: button.x1c_00m09d470100819_resume_printing
icon: mdi:play
name: Resume
layout: icon_name
card_mod:
style: |
:host {
--paper-item-icon-color: green}
ha-card {
height: 60px;
}
layout: icon_name_state
- type: custom:button-card
color: "#C46641"
color_type: icon
entity: button.x1c_00m09d470100819_pause_printing
icon: mdi:pause
name: Pause
card_mod:
style: |
:host {
--paper-item-icon-color: darkorange}
ha-card {
height: 60px;
}
layout: icon_name_state
confirmation:
text: "[[[ return `Pause the print?` ]]]"
- type: custom:button-card
color: rgb(255, 0, 0)
color_type: icon
entity: button.x1c_00m09d470100819_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 `Stop the Print?` ]]]"
- type: horizontal-stack
cards:
- camera_view: auto
fit_mode: cover
type: picture-glance
entities: []
image_entity: image.x1c_00m09d470100819_cover_image
hold_action:
action: none
- type: vertical-stack
cards:
- type: markdown
content: >-
<font size="4">{{
states.sensor.x1c_00m09d470100819_task_name.state }}</font>
<table width=100%><tr><td align=left>Printed layers<td
align=right><font color=#C46641 ; size="4">{{
states.sensor.x1c_00m09d470100819_current_layer.state}}</font>/{{states.sensor.x1c_00m09d470100819_total_layer_count.state}}</td></tr></table>
<table width=100%><tr> <td align=left><font
size="5";color=#C46641>{{
states.sensor.x1c_00m09d470100819_print_progress.state}}%<td
align=right> {% if
(states.sensor.x1c_00m09d470100819_remaining_time.state | float(0)
* 3600) <= 0 %}
Success
{% else %}
<font color=#959595>-{{ (states('sensor.x1c_00m09d470100819_remaining_time') | float(0) * 3600) | timestamp_custom('%-H:%M', false) }}
{% endif %} </td> </tr></table>
- type: custom:bar-card
icon: "off"
name: Progress
positions:
icon: "off"
indicator: "off"
title: inside
value: inside
severity:
- color: null
from: 0
to: 100
entities:
- entity: sensor.x1c_00m09d470100819_print_progress
The top of the right side, just above the AMS (Right side)
Top right side
type: vertical-stack
cards:
- type: custom:mod-card
card:
type: custom:mushroom-chips-card
chips:
- type: template
icon: mdi:fan
entity: binary_sensor.x1c_00m09d470100819_online
card_mod:
style: |
ha-card {
background: none !important;
border: none;
font-size: 4rem !important;
}
- type: spacer
- type: entity
icon: mdi:printer-3d-nozzle-heat
entity: sensor.x1c_00m09d470100819_heatbreak_fan_speed
- type: entity
entity: sensor.x1c_00m09d470100819_cooling_fan_speed
icon: mdi:select-group
- type: entity
icon: mdi:fan-auto
entity: sensor.x1c_00m09d470100819_aux_fan_speed
- type: entity
entity: sensor.x1c_00m09d470100819_chamber_fan_speed
icon: phu:extractor-fan
- type: custom:mod-card
card:
show_name: false
show_icon: true
show_state: true
type: glance
entities:
- entity: sensor.x1c_00m09d470100819_nozzle_temperature
icon: mdi:printer-3d-nozzle-heat
- entity: sensor.x1c_00m09d470100819_bed_temperature
icon: mdi:train-car-flatbed
- entity: sensor.x1c_00m09d470100819_chamber_temperature
icon: mdi:minus-box-outline
- entity: sensor.x1c_00m09d470100819_speed_profile
state_color: false
You need to create a file in /homeassistant/custom_templates/ and name it: cols.jinja
You can easily add or change color names as you like. HEX color does not need to be an exact match. code will show the nearest color match.
Put this code in the file:
Color finding code
{% macro hex2name(hex,name_only=True) -%}
{% set cols = {
"Indian Red": "#cd5c5c", "Light Coral": "#f08080",
"Salmon": "#fa8072", "Dark Salmon": "#e9967a",
"Light Salmon": "#ffa07a", "Red": "#ff0000",
"Crimson": "#dc143c", "Fire Red": "#b22222",
"Dark Red": "#8b0000", "Pink": "#ffc0cb",
"Light Pink": "#ffb6c1", "Hot Pink": "#ff69b4",
"Deep Pink": "#ff1493", "Medium Violet Red": "#c71585",
"Pale Violet Red": "#db7093", "Coral": "#ff7f50",
"Tomato": "#ff6347", "Orange Red": "#ff4500",
"Dark Orange": "#ff8c00", "Orange": "#ffa500",
"Gold": "#ffd700", "Yellow": "#ffff00",
"Light Yellow": "#ffffe0", "Lemon Chiffon": "#fffacd",
"Light Golden Rod Yellow": "#fafad2", "Papaya Whip": "#ffefd5",
"Moccasin": "#ffe4b5", "Peach Puff": "#ffdab9",
"Pale Golden Rod": "#eee8aa", "Khaki": "#f0e68c",
"Dark Khaki": "#bdb76b", "Lavender": "#e6e6fa",
"Thistle": "#d8bfd8", "Plum": "#dda0dd",
"Violet": "#ee82ee", "Orchid": "#da70d6",
"Fuchsia": "#ff00ff", "Magenta": "#ff00ff",
"Medium Orchid": "#ba55d3", "Medium Purple": "#9370db",
"Blue Violet": "#8a2be2", "Dark Violet": "#9400d3",
"Dark Orchid": "#9932cc", "Dark Magenta": "#8b008b",
"Purple": "#800080", "Indigo": "#4b0082",
"Dark Slate Blue": "#483d8b", "Slate Blue": "#6a5acd",
"Medium Slate Blue": "#7b68ee", "Rebecca Purple": "#663399",
"Green Yellow": "#adff2f", "Chartreuse": "#7fff00",
"Lawn Green": "#7cfc00", "Lime": "#00ff00",
"Lime Green": "#32cd32", "Pale Green": "#98fb98",
"Light Green": "#90ee90", "Spring Green": "#00ff7f",
"Medium Spring Green": "#00fa9a", "Medium Sea Green": "#3cb371",
"Sea Green": "#2e8b57", "Forest Green": "#228b22",
"Green": "#008000", "Dark Green": "#006400",
"Yellow Green": "#9acd32", "Olive Drab": "#6b8e23",
"Olive": "#808000", "Dark Olive Green": "#556b2f",
"Medium Aquamarine": "#66cdaa", "Dark Sea Green": "#8fbc8f",
"Light Sea Green": "#20b2aa", "Dark Cyan": "#008b8b",
"Teal": "#008080", "Aqua": "#00ffff",
"Cyan": "#00ffff", "Light Cyan": "#e0ffff",
"Pale Turquoise": "#afeeee", "Aquamarine": "#7fffd4",
"Turquoise": "#40e0d0", "Medium Turquoise": "#48d1cc",
"Dark Turquoise": "#00ced1", "Cadet Blue": "#5f9ea0",
"Steel Blue": "#4682b4", "Light Steel Blue": "#b0c4de",
"Powder Blue": "#b0e0e6", "Light Blue": "#add8e6",
"Sky Blue": "#87ceeb", "Light Sky Blue": "#87cefa",
"Deep Sky Blue": "#00bfff", "Dodger Blue": "#1e90ff",
"Cornflower Blue": "#6495ed", "Royal Blue": "#4169e1",
"Blue": "#0000ff", "Medium Blue": "#0000cd",
"Dark Blue": "#00008b", "Navy": "#000080",
"Midnight Blue": "#191970", "Cornsilk": "#fff8dc",
"Blanched Almond": "#ffebcd", "Bisque": "#ffe4c4",
"Navajo White": "#ffdead", "Wheat": "#f5deb3",
"Burlywood": "#deb887", "Tan": "#d2b48c",
"Rosy Brown": "#bc8f8f", "Sandy Brown": "#f4a460",
"Golden Rod": "#daa520", "Dark Golden Rod": "#b8860b",
"Peru": "#cd853f", "Chocolate": "#d2691e",
"Saddle Brown": "#8b4513", "Sienna": "#a0522d",
"Brown": "#a52a2a", "Maroon": "#800000",
"White": "#ffffff", "Snow": "#fffafa",
"Honeydew": "#f0fff0", "Mint Cream": "#f5fffa",
"Azure": "#f0ffff", "Alice Blue": "#f0f8ff",
"Ghost White": "#f8f8ff", "White Smoke": "#f5f5f5",
"Sea Shell": "#fff5ee", "Beige": "#f5f5dc",
"Old Lace": "#fdf5e6", "Floral White": "#fffaf0",
"Ivory": "#fffff0", "Antique White": "#faebd7",
"Linen": "#faf0e6", "Lavender Blush": "#fff0f5",
"Misty Rose": "#ffe4e1", "Gainsboro": "#dcdcdc",
"Light Gray": "#d3d3d3", "Light Grey": "#d3d3d3",
"Silver": "#c0c0c0", "Dark Gray": "#a9a9a9",
"Dark Grey": "#a9a9a9", "Gray": "#808080",
"Grey": "#808080", "Dim Gray": "#696969",
"Dim Grey": "#696969", "Light Slate Gray": "#778899",
"Light Slate Grey": "#778899", "Slate Gray": "#708090",
"Slate Grey": "#708090", "Dark Slate Gray": "#2f4f4f",
"Dark Slate Grey": "#2f4f4f", "Black": "#000000",
"Bambu Green": "#00AE42", "Misteltoe Green": "#3F8E43",
"Cyan": "#0086D6", "Magenta": "#EC008C",
"Orange": "#F75403", "Gold": "#E5B03D",
"Red": "#C12E1F"
} -%}
{% set ns = namespace(distance=0,name="") -%}
{% set hex = hex|lower|select('in','0123456789abcdef')|join -%}
{% if hex|length == 3 -%}
{% set hex = hex[0]*2~hex[1]*2~hex[2]*2 -%}
{% endif -%}
{% if hex|length != 6 -%}
{% else -%}
{% set rgb = {'r':hex[0:2]|int(base=16),'g':hex[2:4]|int(base=16),'b':hex[4:6]|int(base=16)} -%}
{% for c in cols -%}
{% set crgb = {'r':cols[c][1:3]|int(base=16),'g':cols[c][3:5]|int(base=16),'b':cols[c][5:7]|int(base=16)} -%}
{% set cdist = sqrt((rgb['r']-crgb['r'])**2 + (rgb['g']-crgb['g'])**2 + (rgb['b']-crgb['b'])**2) -%}
{% if ns.name == "" or ns.distance > cdist -%}
{% set ns.name, ns.distance = c, cdist -%}
{% endif -%}
{% endfor -%}
{% if name_only -%}
{{ ns.name -}}
{% else -%}
{{ {"name": ns.name, "distance": ns.distance}|to_json -}}
{% endif -%}
{% endif -%}
{% endmacro -%}
This is the dashboard code for 1 AMS:
Code for 1 AMS
type: vertical-stack
cards:
- type: custom:mod-card
card_mod:
style:
hui-horizontal-stack-card $: |
div#root > :last-child > * {
width: 100%;
flex: auto;
}
card:
type: horizontal-stack
cards:
- type: custom:mushroom-chips-card
chips:
- type: template
entity: binary_sensor.x1c_00m09d470100819_online
content: AMS A
card_mod:
style: |
ha-card {
background: none !important;
border: none;
font-size: 4rem !important;
}
- type: spacer
- type: entity
entity: sensor.x1c_00m09d470100819_ams_1_remaining_drying_time
- type: entity
entity: sensor.x1c_00m09d470100819_ams_1_temperature
- type: entity
entity: sensor.x1c_00m09d470100819_ams_1_humidity
- type: entity
entity: sensor.x1c_00m09d470100819_ams_1_humidity_index
icon: mdi:water-opacity
- type: horizontal-stack
cards:
- type: vertical-stack
cards:
- type: markdown
card_mod:
style: |
:host {
max-width:100px !important;
border:none;
margin: 0px 0px 0px 0px !important;
padding: 0px 0px 0px 0px !important;
}
ha-markdown {
padding: 0px 0px 0px 0px !important;
margin: 0px 0px 0px 0px !important;
width: 100%;
line-height:1.5;
height: 100%;
justify-content: center !important;
}
ha-card {
{%- set active = state_attr('sensor.x1c_00m09d470100819_ams_1_tray_1', 'active') %}
{%- if active == 1 %}
--ha-card-border-color: darkorange;
{%- else %}
{%- endif %}
border-radius: 20px;
}
content: >-
<table width=100%><td align=center><font size="2" color=#FFFFFF>{{
state_attr('sensor.x1c_00m09d470100819_ams_1_tray_1', 'name') |
replace('Bambu ', '') | replace('For PLA/PETG', '') | replace('
Basic', '')}}</font> <table width=100%><td align=center><font
size="2"> {% if
((state_attr('sensor.x1c_00m09d470100819_ams_1_tray_1',
'remain')/100)*335) <= 0 %}
Empty spool
{% else %}
<font color=#959595>{{ (state_attr('sensor.x1c_00m09d470100819_ams_1_tray_1', 'remain')*10) }}g <font color=#FFFFFF> | </font><font color=#959595>{{ ((state_attr('sensor.x1c_00m09d470100819_ams_1_tray_1', 'remain')/100)*335) | round(0) }}m
{% endif %}</td> </tr></table>
<font
color={{state_attr('sensor.x1c_00m09d470100819_ams_1_tray_1',
'color') [0:7] }}> <ha-icon icon="phu:3d-filament"></ha-icon>
<table width=100%><td align=center><font size="2" color=#FFFFFF>{%
from 'cols.jinja' import hex2name %}{{
hex2name(state_attr('sensor.x1c_00m09d470100819_ams_1_tray_1',
'color') [1:7]) }}</font></td></tr></table>
- type: vertical-stack
cards:
- type: markdown
card_mod:
style: |
:host {
max-width:100px !important;
border:none;
margin: 0px 0px 0px 0px !important;
padding: 0px 0px 0px 0px !important;
}
ha-markdown {
padding: 0px 0px 0px 0px !important;
margin: 0px 0px 0px 0px !important;
width: 100%;
line-height:1.5;
height: 100%;
justify-content: center !important;
}
ha-card {
{%- set active = state_attr('sensor.x1c_00m09d470100819_ams_1_tray_2', 'active') %}
{%- if active == 1 %}
--ha-card-border-color: darkorange;
{%- else %}
{%- endif %}
border-radius: 20px;
}
content: >-
<table width=100%><td align=center><font size="2" color=#FFFFFF>{{
state_attr('sensor.x1c_00m09d470100819_ams_1_tray_2', 'name') |
replace('Bambu ', '') | replace('For PLA/PETG', '') | replace('
Basic', '')}}</font> <table width=100%><td align=center><font
size="2"> {% if
((state_attr('sensor.x1c_00m09d470100819_ams_1_tray_2',
'remain')/100)*335) <= 0 %}
Empty<br>spool
{% else %}
<font color=#959595>{{ (state_attr('sensor.x1c_00m09d470100819_ams_1_tray_2', 'remain')*10) }}g <font color=#FFFFFF> | </font><font color=#959595>{{ ((state_attr('sensor.x1c_00m09d470100819_ams_1_tray_2', 'remain')/100)*335) | round(0) }}m
{% endif %}</td> </tr></table>
<font
color={{state_attr('sensor.x1c_00m09d470100819_ams_1_tray_2',
'color') [0:7] }}> <ha-icon icon="phu:3d-filament"></ha-icon>
<table width=100%><td align=center><font size="2" color=#FFFFFF>{%
from 'cols.jinja' import hex2name %}{{
hex2name(state_attr('sensor.x1c_00m09d470100819_ams_1_tray_2',
'color') [1:7]) }}</font></td></tr></table>
- type: vertical-stack
cards:
- type: markdown
card_mod:
style: |
:host {
max-width:100px !important;
border:none;
margin: 0px 0px 0px 0px !important;
padding: 0px 0px 0px 0px !important;
}
ha-markdown {
padding: 0px 0px 0px 0px !important;
margin: 0px 0px 0px 0px !important;
width: 100%;
line-height:1.5;
height: 100%;
justify-content: center !important;
}
ha-card {
{%- set active = state_attr('sensor.x1c_00m09d470100819_ams_1_tray_3', 'active') %}
{%- if active == 1 %}
--ha-card-border-color: darkorange;
{%- else %}
{%- endif %}
border-radius: 20px;
}
content: >-
<table width=100%><td align=center><font size="2" color=#FFFFFF>{{
state_attr('sensor.x1c_00m09d470100819_ams_1_tray_3', 'name') |
replace('Bambu ', '') | replace('For PLA/PETG', '') | replace('
Basic', '')}}</font> <table width=100%><td align=center><font
size="2"> {% if
((state_attr('sensor.x1c_00m09d470100819_ams_1_tray_3',
'remain')/100)*335) <= 0 %}
Empty spool
{% else %}
<font color=#959595>{{ (state_attr('sensor.x1c_00m09d470100819_ams_1_tray_3', 'remain')*10) }}g <font color=#FFFFFF> | </font><font color=#959595>{{ ((state_attr('sensor.x1c_00m09d470100819_ams_1_tray_3', 'remain')/100)*335) | round(0) }}m
{% endif %}</td> </tr></table>
<font
color={{state_attr('sensor.x1c_00m09d470100819_ams_1_tray_3',
'color') [0:7] }}> <ha-icon icon="phu:3d-filament"></ha-icon>
<table width=100%><td align=center><font size="2" color=#FFFFFF>{%
from 'cols.jinja' import hex2name %}{{
hex2name(state_attr('sensor.x1c_00m09d470100819_ams_1_tray_3',
'color') [1:7]) }}</font></td></tr></table>
- type: vertical-stack
cards:
- type: markdown
card_mod:
style: |
:host {
max-width:100px !important;
border:none;
margin: 0px 0px 0px 0px !important;
padding: 0px 0px 0px 0px !important;
}
ha-markdown {
padding: 0px 0px 0px 0px !important;
margin: 0px 0px 0px 0px !important;
width: 100%;
line-height:1.5;
height: 100%;
justify-content: center !important;
}
ha-card {
{%- set active = state_attr('sensor.x1c_00m09d470100819_ams_1_tray_4', 'active') %}
{%- if active == 1 %}
--ha-card-border-color: darkorange;
{%- else %}
{%- endif %}
border-radius: 20px;
}
content: >-
<table width=100%><td align=center><font size="2" color=#FFFFFF>{{
state_attr('sensor.x1c_00m09d470100819_ams_1_tray_4', 'name') |
replace('Bambu ', '') | replace('For PLA/PETG', '') | replace('
Basic', '')}}</font> <table width=100%><td align=center><font
size="2"> {% if
((state_attr('sensor.x1c_00m09d470100819_ams_1_tray_4',
'remain')/100)*335) <= 0 %}
Empty<br>spool
{% else %}
<font color=#959595>{{ (state_attr('sensor.x1c_00m09d470100819_ams_1_tray_4', 'remain')*10) }}g <font color=#FFFFFF> | </font><font color=#959595>{{ ((state_attr('sensor.x1c_00m09d470100819_ams_1_tray_4', 'remain')/100)*335) | round(0) }}m
{% endif %}</td> </tr></table>
<font
color={{state_attr('sensor.x1c_00m09d470100819_ams_1_tray_4',
'color') [0:7] }}> <ha-icon icon="phu:3d-filament"></ha-icon>
<table width=100%><td align=center><font size="2" color=#FFFFFF>{%
from 'cols.jinja' import hex2name %}{{
hex2name(state_attr('sensor.x1c_00m09d470100819_ams_1_tray_4',
'color') [1:7]) }}</font></td></tr></table>





