views:
- title: Dashboard
path: snapmaker-u1
type: sections
max_columns: 3
dense_section_placement: false
sections:
- type: grid
column_span: 3
cards:
- type: custom:button-card
template: u1_showcase_data
custom_fields:
content: |-
[[[
// A running HA client may have loaded its resource list before the Showcase was registered.
if (!customElements.get("u1-fusion-showcase-hero-v18") ||
!customElements.get("u1-fusion-showcase-ironoxx")) {
this._u1ShowcaseModule ??= import("/local/media/snapmaker-u1/showcase/u1-fusion-showcase.u1.js?v=559-20").catch(error => {
console.error("U1 Fusion Showcase resource failed to load", error);
});
}
const d = variables.d;
const tone = {neutral:'#a3a7ad',hot:'#ff6347',warn:'#f3be73',error:'#ff8377',ok:'#93cc9f'}[d.tone];
const tool = !d.known ? '' : d.active !== null ? `T${d.active} mounted` :
d.heads.every(head => head.state === 'parked') ? '4 tools docked' : 'Tool position unknown';
return `
5 · Snapmaker U1
U1 Fusion Showcase
`;
]]]
styles:
card:
- background: transparent
- border: none
- padding: '0'
grid_options:
columns: full
rows: auto
- type: grid
cards:
- type: custom:u1-fusion-showcase-hero-v18
axis_limits:
x:
- 0
- 271
y:
- 0
- 335
z:
- -6
- 275
grid_options:
columns: full
rows: auto
card_mod:
style: |-
@media (min-width: 1200px) {
ha-card {
box-sizing: border-box;
--u1-overview-height: clamp(345px, calc(22vw + 64px), 410px);
min-height: var(--u1-overview-height);
}
}
show_print_actions: true
show_filament_heat: true
controls_source:
dashboard: 3d-printer
view: snapmaker-u1
- type: grid
cards:
- type: custom:u1-fusion-showcase-ironoxx
filaments_sensor: sensor.snapmaker_u1_card_filamente
files_sensor: sensor.snapmaker_u1_card_druckdateien
camera: camera.snapmaker_u1_card_kamera
layout: scroll
controls_lock: 60
emergency_stop: hide
camera_direct: 'off'
camera_webrtc: 'off'
camera_mode: still
refresh: 3
camera_max_height: 480
show:
- stage
camera_overlay: false
state_accent: false
card_mod:
style: |-
ha-card { border-radius: 14px; box-shadow: none; }
.head { display: none !important; }
ha-card { padding: 0; overflow: hidden; background: transparent; }
.panel.stage { margin: 0; }
.stage .thumb, .cam-state small { display: none !important; }
.stage-actions { padding: 8px 12px; }
.stage-actions button { min-height: 38px; }
ha-card {
background: var(--card-background-color);
border: 1px solid var(--divider-color);
border-radius: 14px;
padding: 0;
}
.panel.stage { border: none; border-radius: 0; background: transparent; }
.panel.stage::before {
content: "Printer camera";
display: block;
padding: 14px 14px 11px;
color: var(--primary-text-color);
font-size: 17px;
font-weight: 700;
}
.stage-actions button:not([data-act="light"]) { display: none; }
.stage-actions { padding: 8px; }
.stage-actions button { min-height: 36px; }
@media (min-width: 1200px) {
ha-card {
box-sizing: border-box;
--u1-overview-height: clamp(345px, calc(22vw + 64px), 410px);
min-height: var(--u1-overview-height);
}
}
@media (min-width: 1200px) { .stage .frame { min-height:calc(var(--u1-overview-height) - 111px); } }
camera_fit: contain
grid_options:
columns: full
rows: auto
- type: grid
cards:
- type: custom:button-card
template: u1_showcase_data
custom_fields:
content: |-
[[[
const d = variables.d;
const esc = s => String(s ?? '').replace(/[&<>"']/g,c=>({'&':'&','<':'<','>':'>','"':'"',"'":'''}[c]));
const decimal = (n,digits=0) => Number(n).toLocaleString('en-GB',{maximumFractionDigits:digits});
const positive = n => typeof n === 'number' && Number.isFinite(n) && n > 0;
const duration = minutes => {
if (!positive(minutes)) return '';
const m = Math.max(1,Math.round(minutes));
return m < 60 ? `${m} min` : `${Math.floor(m / 60)} h ${m % 60} min`;
};
const date = (value,options) => Number.isFinite(Date.parse(value)) ? new Date(value).toLocaleString('en-GB',options) : '';
const image = (...candidates) => candidates.find(p => typeof p === 'string' && /^\/snapmaker_u1_card\/thumbs\//.test(p));
const metric = (label,value) => value ? `${label}${esc(value)}` : '';
const result = {complete:'Completed',completed:'Completed',cancelled:'Cancelled',canceled:'Cancelled',error:'Error',failed:'Error',aborted:'Cancelled'};
const err = d.known && d.status === 'error';
const activeJob = d.running || err;
const last = d.known && !activeJob ? d.last : null;
const thumb = activeJob ? image(d.model?.thumb) : last ? image(last.thumb,d.lastModel?.thumb,last.photo) : undefined;
const pct = d.running && d.progress !== null ? Math.round(Math.max(0,Math.min(100,d.progress))) : null;
const short = v => v.replace(/\.(gcode|3mf)$/i,'').replace(/[_+]+/g,' ');
const filename = activeJob ? short(d.filename) : last ? short(last.name || last.file) : '';
const heading = activeJob ? 'Print job' : d.known ? 'Last print' : 'Print job';
const chip = activeJob ? d.label : last ? result[last.result] : '';
const finish = date(d.eta,{hour:'2-digit',minute:'2-digit'});
const ended = date(last?.ended,{day:'2-digit',month:'2-digit',hour:'2-digit',minute:'2-digit'});
const filament = positive(last?.filament_used) ? `${decimal(last.filament_used / 1000,2)} m` : '';
const layer = d.layer || d.layers ? `${d.layer ?? '—'} / ${d.layers ?? '—'}` : '';
const metrics = d.running
? metric('Layer',layer)+metric('ETA',finish)+metric('Remaining',duration(d.remaining))+metric('Elapsed',duration(d.elapsed))
: last ? metric('Duration',duration(last.duration / 60))+metric('Filament',filament) : '';
const statusText = err ? d.reason || 'The printer reported an error.'
: d.status === 'paused' && d.running ? d.reason || 'The print is waiting to resume.'
: !d.online ? 'Printer disconnected.'
: !d.known ? 'Print status is currently unknown.'
: !activeJob && !last ? 'No print has been recorded yet.' : '';
const tone = activeJob ? d.tone : last && ['complete','completed'].includes(last.result) ? 'ok' : 'neutral';
return `${heading}${chip ? `${chip}` : ''}
${pct === null ? '' : `${pct} %
`}
${(thumb || filename) ? `${thumb ? `
})
` : ''}
${esc(filename)}
${ended ? `
${esc(ended)}
` : ''}
` : ''}
${statusText ? `${esc(statusText)}
` : ''}
${metrics ? `${metrics}
` : ''}`;
]]]
grid_options:
columns: full
rows: auto
card_mod:
style: |-
@media (min-width: 1200px) {
ha-card {
box-sizing: border-box;
--u1-overview-height: clamp(345px, calc(22vw + 64px), 410px);
min-height: var(--u1-overview-height);
}
}
@media (min-width: 1200px) {
ha-card { min-height: calc(var(--u1-overview-height) - 57px); }
ha-card:not(:has(.u1-track)) .u1-job-main .u1-model {
height: clamp(105px, calc(22vw - 174px), 145px);
}
}
styles:
card:
- justify-content: flex-start
grid:
- grid-template-rows: max-content
- align-content: start
- align-items: start
- type: custom:button-card
template: u1_showcase_data
entity: button.snapmaker_u1_card_not_halt
name: Emergency stop
icon: mdi:alert-octagon
show_name: true
show_icon: true
tap_action:
action: |-
[[[
const available = entity?.state && entity.state !== 'unavailable';
return variables.d.online && available ? 'perform-action' : 'none';
]]]
perform_action: button.press
target:
entity_id: button.snapmaker_u1_card_not_halt
confirmation:
text: Trigger an emergency stop? Klipper stops immediately and switches
off the heaters and motors. A firmware restart is required afterward.
styles:
card:
- height: 40px
- border-radius: 999px
- padding: 0 7px
- box-shadow: none
- background: '[[[ return variables.d.running ? ''#a41622'' : ''#424448'';
]]]'
- border: '[[[ return variables.d.running ? ''1px solid #d94b52''
: ''1px solid #6b6d72''; ]]]'
- color: '#fff'
- opacity: '[[[ return variables.d.online && entity?.state && entity.state
!== ''unavailable'' ? ''1'' : ''.48''; ]]]'
grid:
- grid-template-areas: '"i n"'
- grid-template-columns: 22px max-content
- grid-template-rows: 1fr
- justify-content: center
- column-gap: 5px
icon:
- width: 18px
- color: '#fff'
name:
- font-size: 13px
- font-weight: '650'
grid_options:
columns: full
rows: auto
- type: grid
column_span: 3
cards:
- type: heading
heading: Print controls
icon: mdi:tune-variant
heading_style: title
grid_options:
columns: full
rows: auto
- type: vertical-stack
cards:
- type: custom:button-card
template: u1_showcase_data
entity: number.snapmaker_u1_card_geschwindigkeit
name: Print speed
show_name: true
show_icon: false
show_label: true
label: |-
[[[
const value = entity?.state;
return !variables.d.controllable || typeof value !== 'string' || !value.trim() || !Number.isFinite(Number(value))
? 'Unavailable'
: Number(value).toLocaleString('en-GB') + ' %';
]]]
tap_action:
action: none
hold_action:
action: none
double_tap_action:
action: none
styles:
card:
- padding: 8px 12px
- boxShadow: none
grid:
- grid-template-areas: '"n l"'
- grid-template-columns: 1fr auto
- grid-template-rows: auto
name:
- justify-self: start
- font-weight: '650'
- font-size: 13px
label:
- color: '#ff8069'
- font-weight: '700'
- font-size: 13px
- type: conditional
conditions:
- condition: state
entity: binary_sensor.snapmaker_u1_card_live_verbindung
state: 'on'
- condition: state
entity: sensor.snapmaker_u1_card_druckerwerte
state: ready
- condition: state
entity: sensor.snapmaker_u1_card_druckstatus
state_not:
- unavailable
- unknown
- ''
- condition: state
entity: number.snapmaker_u1_card_geschwindigkeit
state_not:
- unavailable
- unknown
- ''
card:
type: vertical-stack
cards:
- type: entities
show_header_toggle: false
entities:
- type: custom:slider-entity-row
entity: number.snapmaker_u1_card_geschwindigkeit
full_row: true
hide_state: true
toggle: false
min: 70
max: 130
step: 5
card_mod:
style: 'ha-card { box-shadow: none; --ha-card-border-width:
0px; } .card-content { padding: 0 10px; }'
- type: grid
columns: 3
square: false
cards:
- type: custom:button-card
template: u1_showcase_data
entity: number.snapmaker_u1_card_geschwindigkeit
name: 85 %
show_icon: false
show_name: true
show_label: false
tap_action:
action: |-
[[[
const value = 85;
const raw = entity?.state;
const limits = entity?.attributes;
return variables.d.controllable && typeof raw === 'string' && raw.trim() && Number.isFinite(Number(raw))
&& limits && Number.isFinite(limits.min) && Number.isFinite(limits.max)
&& value >= limits.min && value <= limits.max
? 'call-service' : 'none';
]]]
service: number.set_value
service_data:
entity_id: number.snapmaker_u1_card_geschwindigkeit
value: 85
hold_action:
action: none
double_tap_action:
action: none
styles:
card:
- height: 38px
- padding: 3px 2px
- color: var(--primary-text-color)
- border: 1px solid var(--divider-color)
icon:
- width: 13px
name:
- font-size: 12px
- font-weight: '650'
- justify-self: center
- align-self: center
label:
- font-size: 10px
grid:
- grid-template-areas: '"n"'
- grid-template-columns: 1fr
- grid-template-rows: 1fr
- type: custom:button-card
template: u1_showcase_data
entity: number.snapmaker_u1_card_geschwindigkeit
name: 100 %
icon: mdi:restore
show_icon: true
show_name: true
show_label: false
tap_action:
action: |-
[[[
const value = 100;
const raw = entity?.state;
const limits = entity?.attributes;
return variables.d.controllable && typeof raw === 'string' && raw.trim() && Number.isFinite(Number(raw))
&& limits && Number.isFinite(limits.min) && Number.isFinite(limits.max)
&& value >= limits.min && value <= limits.max
? 'call-service' : 'none';
]]]
service: number.set_value
service_data:
entity_id: number.snapmaker_u1_card_geschwindigkeit
value: 100
hold_action:
action: none
double_tap_action:
action: none
styles:
card:
- height: 38px
- padding: 3px 2px
- color: '#ff8069'
- border: '1px solid #ff8069'
icon:
- width: 13px
name:
- font-size: 12px
- font-weight: '650'
grid:
- grid-template-areas: '"i n"'
- grid-template-columns: 18px max-content
- grid-template-rows: 1fr
- justify-content: center
- column-gap: 4px
- type: custom:button-card
template: u1_showcase_data
entity: number.snapmaker_u1_card_geschwindigkeit
name: 115 %
show_icon: false
show_name: true
show_label: false
tap_action:
action: |-
[[[
const value = 115;
const raw = entity?.state;
const limits = entity?.attributes;
return variables.d.controllable && typeof raw === 'string' && raw.trim() && Number.isFinite(Number(raw))
&& limits && Number.isFinite(limits.min) && Number.isFinite(limits.max)
&& value >= limits.min && value <= limits.max
? 'call-service' : 'none';
]]]
service: number.set_value
service_data:
entity_id: number.snapmaker_u1_card_geschwindigkeit
value: 115
hold_action:
action: none
double_tap_action:
action: none
styles:
card:
- height: 38px
- padding: 3px 2px
- color: var(--primary-text-color)
- border: 1px solid var(--divider-color)
icon:
- width: 13px
name:
- font-size: 12px
- font-weight: '650'
- justify-self: center
- align-self: center
label:
- font-size: 10px
grid:
- grid-template-areas: '"n"'
- grid-template-columns: 1fr
- grid-template-rows: 1fr
grid_options:
columns: 12
rows: auto
- type: vertical-stack
cards:
- type: custom:button-card
template: u1_showcase_data
entity: number.snapmaker_u1_card_flussrate
name: Flow rate
show_name: true
show_icon: false
show_label: true
label: |-
[[[
const value = entity?.state;
return !variables.d.controllable || typeof value !== 'string' || !value.trim() || !Number.isFinite(Number(value))
? 'Unavailable'
: Number(value).toLocaleString('en-GB') + ' %';
]]]
tap_action:
action: none
hold_action:
action: none
double_tap_action:
action: none
styles:
card:
- padding: 8px 12px
- boxShadow: none
grid:
- grid-template-areas: '"n l"'
- grid-template-columns: 1fr auto
- grid-template-rows: auto
name:
- justify-self: start
- font-weight: '650'
- font-size: 13px
label:
- color: '#ff8069'
- font-weight: '700'
- font-size: 13px
- type: conditional
conditions:
- condition: state
entity: binary_sensor.snapmaker_u1_card_live_verbindung
state: 'on'
- condition: state
entity: sensor.snapmaker_u1_card_druckerwerte
state: ready
- condition: state
entity: sensor.snapmaker_u1_card_druckstatus
state_not:
- unavailable
- unknown
- ''
- condition: state
entity: number.snapmaker_u1_card_flussrate
state_not:
- unavailable
- unknown
- ''
card:
type: vertical-stack
cards:
- type: entities
show_header_toggle: false
entities:
- type: custom:slider-entity-row
entity: number.snapmaker_u1_card_flussrate
full_row: true
hide_state: true
toggle: false
min: 90
max: 110
step: 1
card_mod:
style: 'ha-card { box-shadow: none; --ha-card-border-width:
0px; } .card-content { padding: 0 10px; }'
- type: grid
columns: 3
square: false
cards:
- type: custom:button-card
template: u1_showcase_data
entity: number.snapmaker_u1_card_flussrate
name: 95 %
show_icon: false
show_name: true
show_label: false
tap_action:
action: |-
[[[
const value = 95;
const raw = entity?.state;
const limits = entity?.attributes;
return variables.d.controllable && typeof raw === 'string' && raw.trim() && Number.isFinite(Number(raw))
&& limits && Number.isFinite(limits.min) && Number.isFinite(limits.max)
&& value >= limits.min && value <= limits.max
? 'call-service' : 'none';
]]]
service: number.set_value
service_data:
entity_id: number.snapmaker_u1_card_flussrate
value: 95
hold_action:
action: none
double_tap_action:
action: none
styles:
card:
- height: 38px
- padding: 3px 2px
- color: var(--primary-text-color)
- border: 1px solid var(--divider-color)
icon:
- width: 13px
name:
- font-size: 12px
- font-weight: '650'
- justify-self: center
- align-self: center
label:
- font-size: 10px
grid:
- grid-template-areas: '"n"'
- grid-template-columns: 1fr
- grid-template-rows: 1fr
- type: custom:button-card
template: u1_showcase_data
entity: number.snapmaker_u1_card_flussrate
name: 100 %
show_icon: false
show_name: true
show_label: false
tap_action:
action: |-
[[[
const value = 100;
const raw = entity?.state;
const limits = entity?.attributes;
return variables.d.controllable && typeof raw === 'string' && raw.trim() && Number.isFinite(Number(raw))
&& limits && Number.isFinite(limits.min) && Number.isFinite(limits.max)
&& value >= limits.min && value <= limits.max
? 'call-service' : 'none';
]]]
service: number.set_value
service_data:
entity_id: number.snapmaker_u1_card_flussrate
value: 100
hold_action:
action: none
double_tap_action:
action: none
styles:
card:
- height: 38px
- padding: 3px 2px
- color: var(--primary-text-color)
- border: 1px solid var(--divider-color)
icon:
- width: 13px
name:
- font-size: 12px
- font-weight: '650'
- justify-self: center
- align-self: center
label:
- font-size: 10px
grid:
- grid-template-areas: '"n"'
- grid-template-columns: 1fr
- grid-template-rows: 1fr
- type: custom:button-card
template: u1_showcase_data
entity: number.snapmaker_u1_card_flussrate
name: 105 %
show_icon: false
show_name: true
show_label: false
tap_action:
action: |-
[[[
const value = 105;
const raw = entity?.state;
const limits = entity?.attributes;
return variables.d.controllable && typeof raw === 'string' && raw.trim() && Number.isFinite(Number(raw))
&& limits && Number.isFinite(limits.min) && Number.isFinite(limits.max)
&& value >= limits.min && value <= limits.max
? 'call-service' : 'none';
]]]
service: number.set_value
service_data:
entity_id: number.snapmaker_u1_card_flussrate
value: 105
hold_action:
action: none
double_tap_action:
action: none
styles:
card:
- height: 38px
- padding: 3px 2px
- color: var(--primary-text-color)
- border: 1px solid var(--divider-color)
icon:
- width: 13px
name:
- font-size: 12px
- font-weight: '650'
- justify-self: center
- align-self: center
label:
- font-size: 10px
grid:
- grid-template-areas: '"n"'
- grid-template-columns: 1fr
- grid-template-rows: 1fr
grid_options:
columns: 12
rows: auto
- type: vertical-stack
grid_options:
columns: 12
rows: auto
cards:
- type: custom:button-card
template: u1_showcase_data
name: Print actions
show_name: true
show_icon: false
show_label: true
label: |-
[[[
const d = variables.d;
if (!d.controllable) return 'Unavailable';
if (d.status === 'printing') return 'Printing';
if (d.status === 'paused') return 'Print paused';
return 'Idle';
]]]
tap_action:
action: none
hold_action:
action: none
double_tap_action:
action: none
styles:
card:
- padding: 8px 12px
- box-shadow: none
grid:
- grid-template-areas: '"n l"'
- grid-template-columns: 1fr auto
- grid-template-rows: auto
name:
- justify-self: start
- font-weight: '650'
- font-size: 13px
label:
- justify-self: end
- font-size: 13px
- font-weight: '700'
- color: |-
[[[
const d = variables.d;
if (d.status === 'printing') return '#ff8069';
if (d.status === 'paused') return '#ffb29e';
return 'var(--secondary-text-color)';
]]]
- type: grid
columns: 2
square: false
cards:
- type: custom:button-card
template: u1_showcase_data
entity: number.snapmaker_u1_card_bauteillufter
name: Part fan
icon: mdi:fan
show_name: true
show_icon: true
show_label: true
label: |-
[[[
const value = entity?.state;
return !variables.d.online || typeof value !== 'string' || !value.trim() || !Number.isFinite(Number(value))
? 'Off'
: Number(value).toLocaleString('en-GB') + ' %';
]]]
tap_action:
action: none
hold_action:
action: none
double_tap_action:
action: none
styles:
card:
- height: 34px
- padding: 0 10px
- border: 1px solid var(--divider-color)
- border-radius: 8px
- box-shadow: none
grid:
- grid-template-areas: '"i n l"'
- grid-template-columns: 18px auto 1fr
- grid-template-rows: 1fr
- column-gap: 6px
- align-items: center
icon:
- width: 16px
- color: |-
[[[
const v = Number(entity?.state);
return v > 0 ? '#ff8069' : 'var(--secondary-text-color)';
]]]
name:
- font-size: 12px
- font-weight: '650'
- justify-self: start
label:
- font-size: 12px
- font-weight: '700'
- justify-self: end
- color: |-
[[[
const v = Number(entity?.state);
return v > 0 ? '#ff8069' : 'var(--secondary-text-color)';
]]]
- type: custom:button-card
template: u1_showcase_data
entity: input_boolean.snapmaker_u1_cool_after_printing
show_name: false
show_icon: false
show_label: false
tap_action:
action: none
hold_action:
action: none
double_tap_action:
action: none
triggers_update:
- input_boolean.snapmaker_u1_cool_after_printing
- input_number.snapmaker_u1_cool_after_printing_minutes
- input_number.snapmaker_u1_cool_after_printing_speed
- input_boolean.snapmaker_u1_cool_after_printing_panel
- automation.snapmaker_u1_cool_after_printing
custom_fields:
tune:
card:
type: custom:button-card
entity: input_number.snapmaker_u1_cool_after_printing_minutes
name: Cooling
icon: mdi:fan-clock
show_name: true
show_icon: true
show_label: true
triggers_update:
- input_number.snapmaker_u1_cool_after_printing_minutes
- input_number.snapmaker_u1_cool_after_printing_speed
- automation.snapmaker_u1_cool_after_printing
label: |-
[[[
const mins = Math.round(Number(states['input_number.snapmaker_u1_cool_after_printing_minutes']?.state ?? 5));
const pct = Math.round(Number(states['input_number.snapmaker_u1_cool_after_printing_speed']?.state ?? 70));
const running = Number(states['automation.snapmaker_u1_cool_after_printing']?.attributes?.current ?? 0) > 0;
return running ? `${pct}%` : `${mins}m · ${pct}%`;
]]]
tap_action:
action: perform-action
perform_action: input_boolean.toggle
target:
entity_id: input_boolean.snapmaker_u1_cool_after_printing_panel
styles:
card:
- padding: '0'
- border: none
- border-radius: '0'
- background: transparent
- box-shadow: none
- pointer-events: auto
grid:
- grid-template-areas: '"i n l"'
- grid-template-columns: 18px auto 1fr
- grid-template-rows: 1fr
- column-gap: 5px
- align-items: center
icon:
- width: 15px
- color: var(--secondary-text-color)
name:
- justify-self: start
- font-weight: '650'
- font-size: 12px
label:
- font-size: 11px
- font-weight: '600'
- justify-self: end
- color: var(--secondary-text-color)
switch:
card:
type: custom:button-card
entity: input_boolean.snapmaker_u1_cool_after_printing
triggers_update:
- input_boolean.snapmaker_u1_cool_after_printing
show_icon: false
show_name: false
show_label: true
label: '[[[ return states[''input_boolean.snapmaker_u1_cool_after_printing'']?.state
=== ''on'' ? ''On'' : ''Off''; ]]]'
tap_action:
action: perform-action
perform_action: input_boolean.toggle
target:
entity_id: input_boolean.snapmaker_u1_cool_after_printing
styles:
card:
- padding: 1px 7px
- border-radius: 999px
- box-shadow: none
- pointer-events: auto
- background: '[[[ return states[''input_boolean.snapmaker_u1_cool_after_printing'']?.state
=== ''on'' ? ''rgba(255, 128, 105, 0.16)'' : ''rgba(255, 255, 255,
0.06)''; ]]]'
- border: '[[[ return states[''input_boolean.snapmaker_u1_cool_after_printing'']?.state
=== ''on'' ? ''1px solid rgba(255, 128, 105, 0.45)'' : ''1px solid
var(--divider-color)''; ]]]'
label:
- font-size: 11px
- font-weight: '700'
- color: '[[[ return states[''input_boolean.snapmaker_u1_cool_after_printing'']?.state
=== ''on'' ? ''#ff8069'' : ''var(--secondary-text-color)''; ]]]'
styles:
card:
- height: 34px
- padding: 0 8px
- border: 1px solid var(--divider-color)
- border-radius: 8px
- box-shadow: none
grid:
- grid-template-areas: '"tune switch"'
- grid-template-columns: 1fr auto
- grid-template-rows: 1fr
- column-gap: 6px
- align-items: center
custom_fields:
tune:
- pointer-events: auto
switch:
- pointer-events: auto
- type: grid
columns: 2
square: false
cards:
- type: custom:button-card
template: u1_showcase_data
name: |-
[[[
const s = variables.d.status;
return s === 'paused' ? 'Resume' : 'Pause';
]]]
icon: |-
[[[
const s = variables.d.status;
return s === 'paused' ? 'mdi:play' : 'mdi:pause';
]]]
show_name: true
show_icon: true
tap_action:
action: |-
[[[
const s = variables.d.status;
const c = variables.d.controllable;
if (!c) return 'none';
if (s === 'printing') {
const avail = states['button.snapmaker_u1_card_druck_pausieren']?.state;
return avail && avail !== 'unavailable' ? 'perform-action' : 'none';
}
if (s === 'paused') {
const avail = states['button.snapmaker_u1_card_druck_fortsetzen']?.state;
return avail && avail !== 'unavailable' ? 'perform-action' : 'none';
}
return 'none';
]]]
perform_action: button.press
target:
entity_id: |-
[[[
return variables.d.status === 'paused'
? 'button.snapmaker_u1_card_druck_fortsetzen'
: 'button.snapmaker_u1_card_druck_pausieren';
]]]
styles:
card:
- height: 38px
- border-radius: 8px
- padding: 0 10px
- border: 1px solid var(--divider-color)
- box-shadow: none
- opacity: '[[[ return [''printing'', ''paused''].includes(variables.d.status)
? ''1'' : ''0.4''; ]]]'
grid:
- grid-template-areas: '"i n"'
- grid-template-columns: 20px max-content
- grid-template-rows: 1fr
- justify-content: center
- align-items: center
- column-gap: 5px
icon:
- width: 17px
- color: var(--primary-text-color)
name:
- font-size: 12px
- font-weight: '650'
- type: custom:button-card
template: u1_showcase_data
entity: button.snapmaker_u1_card_druck_abbrechen
name: Cancel print
icon: mdi:stop
show_name: true
show_icon: true
tap_action:
action: |-
[[[
const available = entity?.state && entity.state !== 'unavailable';
return variables.d.controllable && ['printing','paused'].includes(variables.d.status) && available ? 'perform-action' : 'none';
]]]
perform_action: button.press
target:
entity_id: button.snapmaker_u1_card_druck_abbrechen
confirmation:
text: Cancel the current print? This will end the job.
styles:
card:
- height: 38px
- border-radius: 8px
- padding: 0 10px
- border: 1px solid var(--divider-color)
- box-shadow: none
- opacity: '[[[ return [''printing'', ''paused''].includes(variables.d.status)
? ''1'' : ''0.4''; ]]]'
grid:
- grid-template-areas: '"i n"'
- grid-template-columns: 20px max-content
- grid-template-rows: 1fr
- justify-content: center
- align-items: center
- column-gap: 5px
icon:
- width: 17px
- color: '[[[ return [''printing'', ''paused''].includes(variables.d.status)
? ''#ff8069'' : ''var(--secondary-text-color)''; ]]]'
name:
- font-size: 12px
- font-weight: '650'
- type: conditional
conditions:
- condition: state
entity: input_boolean.snapmaker_u1_cool_after_printing_panel
state: 'on'
card:
type: custom:vertical-stack-in-card
card_mod:
style: 'ha-card { border: 1px solid rgba(255, 128, 105, 0.35); border-radius:
14px; background: var(--ha-card-background, var(--card-background-color));
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.32); overflow: hidden; }'
cards:
- type: custom:button-card
template: u1_showcase_data
name: Cool after printing · Settings
show_name: true
show_icon: false
show_label: true
label: ✕
tap_action:
action: perform-action
perform_action: input_boolean.turn_off
target:
entity_id: input_boolean.snapmaker_u1_cool_after_printing_panel
styles:
card:
- padding: 8px 12px 4px 12px
- border: none
- border-radius: '0'
- background: transparent
grid:
- grid-template-areas: '"n l"'
- grid-template-columns: 1fr auto
- grid-template-rows: auto
name:
- justify-self: start
- font-size: 12px
- font-weight: '700'
- color: '#ff8069'
label:
- font-size: 13px
- font-weight: '700'
- color: var(--secondary-text-color)
- type: entities
show_header_toggle: false
entities:
- type: custom:slider-entity-row
entity: input_number.snapmaker_u1_cool_after_printing_minutes
name: Time
min: 1
max: 15
step: 1
hide_state: false
- type: custom:slider-entity-row
entity: input_number.snapmaker_u1_cool_after_printing_speed
name: Fan speed
min: 40
max: 100
step: 5
hide_state: false
card_mod:
style: 'ha-card { box-shadow: none; --ha-card-border-width: 0px; background:
transparent; } .card-content { padding: 2px 12px 6px 12px; }'
- type: custom:button-card
template: u1_showcase_data
name: Cools bed to 36 °C (stops early if reached). Best for PLA · off for
ABS / large PETG.
show_name: true
show_icon: false
show_label: false
tap_action:
action: none
styles:
card:
- padding: 0 12px 10px 12px
- border: none
- border-radius: '0'
- background: transparent
grid:
- grid-template-areas: '"n"'
- grid-template-columns: 1fr
- grid-template-rows: auto
name:
- justify-self: start
- text-align: left
- white-space: normal
- font-size: 11px
- line-height: '1.35'
- color: var(--secondary-text-color)
- type: grid
column_span: 2
cards:
- type: heading
heading: Filament management
icon: mdi:printer-3d-nozzle
heading_style: title
grid_options:
columns: full
rows: auto
- type: custom:u1-fusion-showcase-ironoxx
filaments_sensor: sensor.snapmaker_u1_card_filamente
files_sensor: sensor.snapmaker_u1_card_druckdateien
camera: camera.snapmaker_u1_card_kamera
layout: scroll
controls_lock: 60
emergency_stop: hide
camera_direct: 'off'
camera_webrtc: 'off'
camera_mode: still
refresh: 3
camera_max_height: 420
show:
- toolheads
state_accent: false
card_mod:
style: |-
ha-card { border-radius: 14px; box-shadow: none; }
.head { display: none !important; }
.head-card[data-active="1"] { border-color: transparent; background: var(--u1-panel-high); }
.heads { grid-template-columns: repeat(auto-fit, minmax(min(100%, 155px), 1fr)); }
.head-card[data-active="1"] .spool > circle[stroke-width="2.5"] { display: none; }
{% set live = is_state('binary_sensor.snapmaker_u1_card_live_verbindung', 'on') and has_value('sensor.snapmaker_u1_card_druckerwerte') and has_value('sensor.snapmaker_u1_card_druckstatus') %}
{% set raw = state_attr('sensor.snapmaker_u1_card_filamente', 'head_states') %}
{% set positions = raw if live and raw is sequence and raw is not string and raw is not mapping else [] %}
{% set mounted = positions | select('eq', 'active') | list | count %}
{% set selected = state_attr('sensor.snapmaker_u1_card_filamente', 'active_head') if live else none %}
{% set motion = state_attr('sensor.snapmaker_u1_card_druckerwerte', 'values') or {} %}
{% set slots = state_attr('sensor.snapmaker_u1_card_filamente', 'slots') or [] %}
{% for i in range(4) %}
{% set inlet = slots | selectattr('index', 'eq', i) | first | default({}) %}
{% set position = positions[i] if i < positions | count else none %}
{% set label = 'Docked' if position == 'parked' else 'Mounted' if position == 'active' and mounted == 1 else 'Position unknown' %}
.head-card[data-head="{{ i }}"] .head-name::after {
content: "T{{ i }} · {{ label }}{% if selected is integer and selected == i %} · Firmware selection{% endif %}{% if live and motion.get('e' ~ i ~ '_filament') == 'off' and inlet.get('loaded') is sameas true %} · At feeder only{% endif %}";
display: block;
margin: 3px 0 2px;
white-space: normal;
color: {{ '#ff8069' if position == 'active' and mounted == 1 else 'var(--secondary-text-color)' }};
font-size: 11px;
font-weight: 550;
line-height: 1.28;
}
{% endfor %}
.head-card-top { align-items: flex-start; }
@media (max-width: 600px) {
.heads { grid-template-columns: repeat(auto-fit, minmax(min(100%, 133px), 1fr)); gap: 7px; }
.head-card { padding: 8px; }
.head-card-top { gap: 5px; }
.head-card .spool { width: 27px; height: 27px; }
}
@media (min-width: 601px) and (max-width: 900px) {
.heads { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
ha-card { background: transparent; border: 0; padding: 0; }
.panel:has(> .heads) { margin: 0; }
.panel > .panel-head .panel-title { font-size:16px; font-weight:700; line-height:1.25; color:var(--primary-text-color); }
grid_options:
columns: full
rows: auto
- type: grid
cards:
- type: heading
heading: Motion & tools
heading_style: title
icon: mdi:tune-variant
grid_options:
columns: full
rows: auto
- type: custom:button-card
name: Not available during printing
icon: mdi:lock-outline
show_name: true
show_icon: true
show_state: false
tap_action:
action: none
hold_action:
action: none
double_tap_action:
action: none
visibility:
- condition: state
entity: sensor.snapmaker_u1_card_druckstatus
state:
- printing
- paused
grid_options:
columns: full
rows: auto
styles:
card:
- min-height: 66px
- padding: 12px 14px
- border-radius: 12px
- background: color-mix(in srgb,var(--primary-text-color) 8%,var(--card-background-color))
- border: 1px solid var(--divider-color)
- box-shadow: none
- cursor: default
grid:
- grid-template-areas: '"i n"'
- grid-template-columns: 22px max-content
- justify-content: center
- column-gap: 8px
icon:
- width: 20px
- color: var(--secondary-text-color)
name:
- color: var(--primary-text-color)
- font-size: 14px
- font-weight: '650'
- type: vertical-stack
cards:
- type: custom:vertical-stack-in-card
cards:
- type: custom:button-card
show_icon: false
show_name: false
show_state: false
tap_action:
action: none
hold_action:
action: none
double_tap_action:
action: none
triggers_update:
- sensor.snapmaker_u1_card_filamente
- sensor.snapmaker_u1_card_druckerwerte
- sensor.snapmaker_u1_card_druckstatus
- binary_sensor.snapmaker_u1_card_live_verbindung
- script.u1_fusion_v2_control
custom_fields:
heading: Motion
stop:
card:
type: custom:button-card
name: Emergency stop
icon: mdi:alert-octagon
show_icon: true
show_name: true
show_state: false
tap_action:
action: |-
[[[
const printing = ['printing','paused'].includes(states['sensor.snapmaker_u1_card_druckstatus']?.state);
return printing ? 'none' : 'perform-action';
]]]
perform_action: button.press
target:
entity_id: button.snapmaker_u1_card_not_halt
confirmation:
text: Trigger an emergency stop? Klipper stops immediately
and switches off the heaters and motors. A firmware
restart is required afterward.
hold_action:
action: none
double_tap_action:
action: none
styles:
card:
- height: 44px
- border-radius: 9px
- padding: 5px 8px
- background: '#424448'
- border: '1px solid #6b6d72'
- box-shadow: none
grid:
- grid-template-areas: '"i n"'
- grid-template-columns: min-content max-content
- justify-content: center
- gap: 6px
icon:
- width: 17px
- color: '#fff'
name:
- font-size: 13px
- font-weight: '750'
- color: '#fff'
img_cell:
- grid-area: i
- width: auto
- height: auto
layout: icon_name
home:
card:
type: custom:button-card
name: Home axes
show_icon: false
show_state: false
triggers_update:
- binary_sensor.snapmaker_u1_card_live_verbindung
- sensor.snapmaker_u1_card_druckerwerte
- sensor.snapmaker_u1_card_druckstatus
- sensor.snapmaker_u1_card_filamente
- script.u1_fusion_v2_control
tap_action:
action: '[[[ return ((states[''binary_sensor.snapmaker_u1_card_live_verbindung'']?.state
=== ''on'' && states[''sensor.snapmaker_u1_card_druckerwerte'']?.state
=== ''ready'' && [''standby'',''ready'',''complete'',''cancelled''].includes(states[''sensor.snapmaker_u1_card_druckstatus'']?.state)
&& states[''script.u1_fusion_v2_control'']?.state ===
''off'')) ? ''call-service'' : ''none''; ]]]'
service: script.u1_fusion_v2_control
service_data:
operation: home
hold_action:
action: none
double_tap_action:
action: none
styles:
card:
- height: 44px
- min-width: '0'
- padding: 4px 5px
- box-shadow: none
- border-radius: 9px
- background: 'var(--secondary-background-color, #252525)'
- opacity: '[[[ return ((states[''binary_sensor.snapmaker_u1_card_live_verbindung'']?.state
=== ''on'' && states[''sensor.snapmaker_u1_card_druckerwerte'']?.state
=== ''ready'' && [''standby'',''ready'',''complete'',''cancelled''].includes(states[''sensor.snapmaker_u1_card_druckstatus'']?.state)
&& states[''script.u1_fusion_v2_control'']?.state
=== ''off'')) ? ''1'' : ''.46''; ]]]'
- border: '[[[ return states[''sensor.snapmaker_u1_card_druckerwerte'']?.attributes?.values?.idle_timeout_state
=== ''Idle'' ? ''1px solid #ff8069'' : ''1px solid
var(--divider-color)''; ]]]'
name:
- font-size: 12px
- font-weight: '650'
- white-space: normal
- line-height: '1.15'
- text-align: center
styles:
card:
- padding: 4px 0 6px
- border: none
- box-shadow: none
- background: transparent
- border-radius: '0'
- min-width: '0'
grid:
- grid-template-areas: '"heading home stop"'
- grid-template-columns: minmax(0,1fr) minmax(105px,1.4fr)
minmax(80px,.9fr)
- align-items: center
- gap: 6px
custom_fields:
heading:
- min-width: '0'
- width: 100%
- justify-self: stretch
- text-align: left
stop:
- width: 100%
- min-width: '0'
home:
- min-width: '0'
- width: 100%
- justify-self: stretch
- text-align: left
- type: custom:button-card
show_icon: false
show_name: false
show_state: false
tap_action:
action: none
hold_action:
action: none
double_tap_action:
action: none
triggers_update:
- sensor.snapmaker_u1_card_filamente
- sensor.snapmaker_u1_card_druckerwerte
- sensor.snapmaker_u1_card_druckstatus
- binary_sensor.snapmaker_u1_card_live_verbindung
- script.u1_fusion_v2_control
- input_text.u1_fusion_v2_action_status
custom_fields:
state: |-
[[[
const online = states['binary_sensor.snapmaker_u1_card_live_verbindung']?.state === 'on';
const st = states['sensor.snapmaker_u1_card_druckstatus']?.state;
const busy = states['script.u1_fusion_v2_control']?.state === 'on';
const ready = states['sensor.snapmaker_u1_card_druckerwerte']?.state === 'ready';
const value = states['sensor.snapmaker_u1_card_druckerwerte']?.attributes?.values ?? {};
const xyz = ['x','y','z'].map(a => {
const n = value['toolhead_position_' + a];
const shown = online && n !== null && n !== undefined && String(n).trim() !== '' && Number.isFinite(Number(n));
return a.toUpperCase() + ' ' + (shown ? Number(n).toFixed(1) : '—');
}).join(' · ');
const needsHome = online && (states['sensor.snapmaker_u1_card_druckerwerte']?.attributes?.values?.idle_timeout_state === 'Idle');
const result = states['input_text.u1_fusion_v2_action_status']?.state;
const safe = s => String(s).replace(/[&<>"']/g,c=>({'&':'&','<':'<','>':'>','"':'"',"'":'''}[c]));
const hint = busy ? 'Action in progress' : !online ? 'Offline' : ['printing','paused'].includes(st) ? 'Locked while printing' : !ready || !['standby','ready','complete','cancelled'].includes(st) ? 'Printer is not ready' : needsHome ? 'Homing required' : 'Idle';
const detail = needsHome ? 'Motors off after idle timeout' : xyz + ' mm';
const messages = new Map([["Unbekannte U1-Aktion.","Unknown U1 action."],["U1-Zustand gelesen.","U1 status read."],["Der aktuelle Druckerzustand ist nicht erreichbar.","Current printer status is unavailable."],["U1 gesperrt. Der Drucker muss online, fehlerfrei und im Leerlauf sein.","U1 controls are locked. The printer must be online, idle and free of errors."],["Zuerst „Achsen referenzieren“. Die Achsen sind nicht referenziert.","Home the axes first."],["U1-Fahrt gesperrt. Schritt, Koordinaten oder Softlimit ungültig.","Move blocked. The step, coordinates or software limit is invalid."],["U1-Filamentaktion gesperrt. Feeder, Filamentzustand oder Sensor des gewählten Kopfes prüfen.","Filament action blocked. Check the selected tool's feeder, filament and sensor."],["Bett zuerst auf Mitte oder Unten fahren, damit der Kopf genug Abstand hat.","Move the bed to Center or Bottom first to give the tool enough clearance."],["U1-Preset gesperrt. Für diese Position muss genau ein Druckkopf am Schlitten sein.","Move blocked. This position requires exactly one tool mounted on the carriage."],["U1-Preset gesperrt. Ziel, Achsgrenzen oder aktuelle Position ungültig.","Move blocked. The target, axis limits or current position is invalid."],["U1 steht bereits am gewählten Ziel.","The U1 is already at the selected position."],["U1-Kopfaufnahme gesperrt. Werkzeugindex oder Dock-/Schlittenposition ungültig.","Tool pickup blocked. The tool index, dock or carriage position is invalid."],["Der gewählte Druckkopf ist bereits am Schlitten.","The selected tool is already mounted."],["U1-Parken gesperrt. Dock- oder Schlittenposition ist unklar.","Docking blocked. Dock or carriage position is unknown."],["Alle Druckköpfe sind bereits im Dock.","All tools are already docked."],["U1-Zustand hat sich geändert. Aktion gesperrt.","Printer status changed. Action blocked."],["U1-Befehl fehlgeschlagen oder Zeitüberschreitung. Vor Wiederholung Druckerzustand und G-Code-Konsole prüfen.","The command failed or timed out. Check the printer and G-code console before retrying."],["U1 hat den erwarteten Endzustand nicht bestätigt. Druckerzustand vor einer Wiederholung prüfen.","The U1 did not confirm the expected result. Check the printer before retrying."],["Achsen referenziert.","Axes homed."],["Zielposition erreicht.","Target position reached."],["Feinbewegung abgeschlossen.","Fine move completed."],["Druckkopf am Schlitten bestätigt.","Tool confirmed on the carriage."],["Druckkopf im Dock bestätigt.","Tool confirmed in the dock."],["Filament geladen.","Filament loaded."],["Filament entladen.","Filament unloaded."],["Aktion abgeschlossen.","Action complete."]]);
const note = !busy && result && !['Bereit','unknown','unavailable'].includes(result) && !(needsHome && (result.startsWith('Zuerst') || result === 'Achsen referenziert.')) ? '
' + safe(messages.get(result) || result) : '';
return '' + hint + '
' + detail + note + '';
]]]
styles:
card:
- padding: 0 0 2px
- border: none
- box-shadow: none
- background: transparent
- border-radius: '0'
- min-width: '0'
grid:
- grid-template-areas: '"state"'
- grid-template-columns: minmax(0,1fr)
- align-items: center
- gap: 6px
custom_fields:
state:
- min-width: '0'
- width: 100%
- justify-self: stretch
- text-align: left
- white-space: normal
- overflow-wrap: anywhere
- type: custom:button-card
show_icon: false
show_name: false
show_state: false
tap_action:
action: none
hold_action:
action: none
double_tap_action:
action: none
triggers_update:
- sensor.snapmaker_u1_card_filamente
- sensor.snapmaker_u1_card_druckerwerte
- sensor.snapmaker_u1_card_druckstatus
- binary_sensor.snapmaker_u1_card_live_verbindung
- script.u1_fusion_v2_control
custom_fields:
label: Bed
first:
card:
type: custom:button-card
name: Top
show_icon: false
show_state: false
triggers_update:
- binary_sensor.snapmaker_u1_card_live_verbindung
- sensor.snapmaker_u1_card_druckerwerte
- sensor.snapmaker_u1_card_druckstatus
- sensor.snapmaker_u1_card_filamente
- script.u1_fusion_v2_control
tap_action:
action: '[[[ if (states[''sensor.snapmaker_u1_card_druckerwerte'']?.attributes?.values?.idle_timeout_state
=== ''Idle'') return "none"; return ((states[''binary_sensor.snapmaker_u1_card_live_verbindung'']?.state
=== ''on'' && states[''sensor.snapmaker_u1_card_druckerwerte'']?.state
=== ''ready'' && [''standby'',''ready'',''complete'',''cancelled''].includes(states[''sensor.snapmaker_u1_card_druckstatus'']?.state)
&& states[''script.u1_fusion_v2_control'']?.state ===
''off'')) ? ''call-service'' : ''none''; ]]]'
service: script.u1_fusion_v2_control
service_data:
operation: preset
preset: bed_top
hold_action:
action: none
double_tap_action:
action: none
styles:
card:
- height: 44px
- min-width: '0'
- padding: 4px 5px
- box-shadow: none
- border-radius: 9px
- background: 'var(--secondary-background-color, #252525)'
- border: 1px solid var(--divider-color)
- opacity: '[[[ if (states[''sensor.snapmaker_u1_card_druckerwerte'']?.attributes?.values?.idle_timeout_state
=== ''Idle'') return ".42"; return ((states[''binary_sensor.snapmaker_u1_card_live_verbindung'']?.state
=== ''on'' && states[''sensor.snapmaker_u1_card_druckerwerte'']?.state
=== ''ready'' && [''standby'',''ready'',''complete'',''cancelled''].includes(states[''sensor.snapmaker_u1_card_druckstatus'']?.state)
&& states[''script.u1_fusion_v2_control'']?.state
=== ''off'')) ? ''1'' : ''.46''; ]]]'
name:
- font-size: 12px
- font-weight: '650'
- white-space: normal
- line-height: '1.15'
- text-align: center
second:
card:
type: custom:button-card
name: Center
show_icon: false
show_state: false
triggers_update:
- binary_sensor.snapmaker_u1_card_live_verbindung
- sensor.snapmaker_u1_card_druckerwerte
- sensor.snapmaker_u1_card_druckstatus
- sensor.snapmaker_u1_card_filamente
- script.u1_fusion_v2_control
tap_action:
action: '[[[ if (states[''sensor.snapmaker_u1_card_druckerwerte'']?.attributes?.values?.idle_timeout_state
=== ''Idle'') return "none"; return ((states[''binary_sensor.snapmaker_u1_card_live_verbindung'']?.state
=== ''on'' && states[''sensor.snapmaker_u1_card_druckerwerte'']?.state
=== ''ready'' && [''standby'',''ready'',''complete'',''cancelled''].includes(states[''sensor.snapmaker_u1_card_druckstatus'']?.state)
&& states[''script.u1_fusion_v2_control'']?.state ===
''off'')) ? ''call-service'' : ''none''; ]]]'
service: script.u1_fusion_v2_control
service_data:
operation: preset
preset: bed_mid
hold_action:
action: none
double_tap_action:
action: none
styles:
card:
- height: 44px
- min-width: '0'
- padding: 4px 5px
- box-shadow: none
- border-radius: 9px
- background: 'var(--secondary-background-color, #252525)'
- border: 1px solid var(--divider-color)
- opacity: '[[[ if (states[''sensor.snapmaker_u1_card_druckerwerte'']?.attributes?.values?.idle_timeout_state
=== ''Idle'') return ".42"; return ((states[''binary_sensor.snapmaker_u1_card_live_verbindung'']?.state
=== ''on'' && states[''sensor.snapmaker_u1_card_druckerwerte'']?.state
=== ''ready'' && [''standby'',''ready'',''complete'',''cancelled''].includes(states[''sensor.snapmaker_u1_card_druckstatus'']?.state)
&& states[''script.u1_fusion_v2_control'']?.state
=== ''off'')) ? ''1'' : ''.46''; ]]]'
name:
- font-size: 12px
- font-weight: '650'
- white-space: normal
- line-height: '1.15'
- text-align: center
third:
card:
type: custom:button-card
name: Bottom
show_icon: false
show_state: false
triggers_update:
- binary_sensor.snapmaker_u1_card_live_verbindung
- sensor.snapmaker_u1_card_druckerwerte
- sensor.snapmaker_u1_card_druckstatus
- sensor.snapmaker_u1_card_filamente
- script.u1_fusion_v2_control
tap_action:
action: '[[[ if (states[''sensor.snapmaker_u1_card_druckerwerte'']?.attributes?.values?.idle_timeout_state
=== ''Idle'') return "none"; return ((states[''binary_sensor.snapmaker_u1_card_live_verbindung'']?.state
=== ''on'' && states[''sensor.snapmaker_u1_card_druckerwerte'']?.state
=== ''ready'' && [''standby'',''ready'',''complete'',''cancelled''].includes(states[''sensor.snapmaker_u1_card_druckstatus'']?.state)
&& states[''script.u1_fusion_v2_control'']?.state ===
''off'')) ? ''call-service'' : ''none''; ]]]'
service: script.u1_fusion_v2_control
service_data:
operation: preset
preset: bed_bottom
hold_action:
action: none
double_tap_action:
action: none
styles:
card:
- height: 44px
- min-width: '0'
- padding: 4px 5px
- box-shadow: none
- border-radius: 9px
- background: 'var(--secondary-background-color, #252525)'
- border: 1px solid var(--divider-color)
- opacity: '[[[ if (states[''sensor.snapmaker_u1_card_druckerwerte'']?.attributes?.values?.idle_timeout_state
=== ''Idle'') return ".42"; return ((states[''binary_sensor.snapmaker_u1_card_live_verbindung'']?.state
=== ''on'' && states[''sensor.snapmaker_u1_card_druckerwerte'']?.state
=== ''ready'' && [''standby'',''ready'',''complete'',''cancelled''].includes(states[''sensor.snapmaker_u1_card_druckstatus'']?.state)
&& states[''script.u1_fusion_v2_control'']?.state
=== ''off'')) ? ''1'' : ''.46''; ]]]'
name:
- font-size: 12px
- font-weight: '650'
- white-space: normal
- line-height: '1.15'
- text-align: center
styles:
card:
- padding: 2px 0
- border: none
- box-shadow: none
- background: transparent
- border-radius: '0'
- min-width: '0'
grid:
- grid-template-areas: '"label first second third"'
- grid-template-columns: minmax(44px,.60fr) repeat(3,minmax(0,1fr))
- align-items: center
- gap: 6px
custom_fields:
label:
- min-width: '0'
- width: 100%
- justify-self: stretch
- text-align: left
first:
- min-width: '0'
- width: 100%
- justify-self: stretch
- text-align: left
second:
- min-width: '0'
- width: 100%
- justify-self: stretch
- text-align: left
third:
- min-width: '0'
- width: 100%
- justify-self: stretch
- text-align: left
- type: custom:button-card
show_icon: false
show_name: false
show_state: false
tap_action:
action: none
hold_action:
action: none
double_tap_action:
action: none
triggers_update:
- sensor.snapmaker_u1_card_filamente
- sensor.snapmaker_u1_card_druckerwerte
- sensor.snapmaker_u1_card_druckstatus
- binary_sensor.snapmaker_u1_card_live_verbindung
- script.u1_fusion_v2_control
custom_fields:
label: Tool
first:
card:
type: custom:button-card
name: Front left
show_icon: false
show_state: false
triggers_update:
- binary_sensor.snapmaker_u1_card_live_verbindung
- sensor.snapmaker_u1_card_druckerwerte
- sensor.snapmaker_u1_card_druckstatus
- sensor.snapmaker_u1_card_filamente
- script.u1_fusion_v2_control
tap_action:
action: '[[[ if (states[''sensor.snapmaker_u1_card_druckerwerte'']?.attributes?.values?.idle_timeout_state
=== ''Idle'') return "none"; return ((states[''binary_sensor.snapmaker_u1_card_live_verbindung'']?.state
=== ''on'' && states[''sensor.snapmaker_u1_card_druckerwerte'']?.state
=== ''ready'' && [''standby'',''ready'',''complete'',''cancelled''].includes(states[''sensor.snapmaker_u1_card_druckstatus'']?.state)
&& states[''script.u1_fusion_v2_control'']?.state ===
''off'') && (states[''sensor.snapmaker_u1_card_filamente'']?.attributes?.head_states
?? []).filter(s => s === ''active'').length === 1) ?
''call-service'' : ''none''; ]]]'
service: script.u1_fusion_v2_control
service_data:
operation: preset
preset: head_left
hold_action:
action: none
double_tap_action:
action: none
styles:
card:
- height: 44px
- min-width: '0'
- padding: 4px 5px
- box-shadow: none
- border-radius: 9px
- background: 'var(--secondary-background-color, #252525)'
- border: 1px solid var(--divider-color)
- opacity: '[[[ if (states[''sensor.snapmaker_u1_card_druckerwerte'']?.attributes?.values?.idle_timeout_state
=== ''Idle'') return ".42"; return ((states[''binary_sensor.snapmaker_u1_card_live_verbindung'']?.state
=== ''on'' && states[''sensor.snapmaker_u1_card_druckerwerte'']?.state
=== ''ready'' && [''standby'',''ready'',''complete'',''cancelled''].includes(states[''sensor.snapmaker_u1_card_druckstatus'']?.state)
&& states[''script.u1_fusion_v2_control'']?.state
=== ''off'') && (states[''sensor.snapmaker_u1_card_filamente'']?.attributes?.head_states
?? []).filter(s => s === ''active'').length ===
1) ? ''1'' : ''.46''; ]]]'
name:
- font-size: 12px
- font-weight: '650'
- white-space: normal
- line-height: '1.15'
- text-align: center
second:
card:
type: custom:button-card
name: Center
show_icon: false
show_state: false
triggers_update:
- binary_sensor.snapmaker_u1_card_live_verbindung
- sensor.snapmaker_u1_card_druckerwerte
- sensor.snapmaker_u1_card_druckstatus
- sensor.snapmaker_u1_card_filamente
- script.u1_fusion_v2_control
tap_action:
action: '[[[ if (states[''sensor.snapmaker_u1_card_druckerwerte'']?.attributes?.values?.idle_timeout_state
=== ''Idle'') return "none"; return ((states[''binary_sensor.snapmaker_u1_card_live_verbindung'']?.state
=== ''on'' && states[''sensor.snapmaker_u1_card_druckerwerte'']?.state
=== ''ready'' && [''standby'',''ready'',''complete'',''cancelled''].includes(states[''sensor.snapmaker_u1_card_druckstatus'']?.state)
&& states[''script.u1_fusion_v2_control'']?.state ===
''off'') && (states[''sensor.snapmaker_u1_card_filamente'']?.attributes?.head_states
?? []).filter(s => s === ''active'').length === 1) ?
''call-service'' : ''none''; ]]]'
service: script.u1_fusion_v2_control
service_data:
operation: preset
preset: head_center
hold_action:
action: none
double_tap_action:
action: none
styles:
card:
- height: 44px
- min-width: '0'
- padding: 4px 5px
- box-shadow: none
- border-radius: 9px
- background: 'var(--secondary-background-color, #252525)'
- border: 1px solid var(--divider-color)
- opacity: '[[[ if (states[''sensor.snapmaker_u1_card_druckerwerte'']?.attributes?.values?.idle_timeout_state
=== ''Idle'') return ".42"; return ((states[''binary_sensor.snapmaker_u1_card_live_verbindung'']?.state
=== ''on'' && states[''sensor.snapmaker_u1_card_druckerwerte'']?.state
=== ''ready'' && [''standby'',''ready'',''complete'',''cancelled''].includes(states[''sensor.snapmaker_u1_card_druckstatus'']?.state)
&& states[''script.u1_fusion_v2_control'']?.state
=== ''off'') && (states[''sensor.snapmaker_u1_card_filamente'']?.attributes?.head_states
?? []).filter(s => s === ''active'').length ===
1) ? ''1'' : ''.46''; ]]]'
name:
- font-size: 12px
- font-weight: '650'
- white-space: normal
- line-height: '1.15'
- text-align: center
third:
card:
type: custom:button-card
name: Rear right
show_icon: false
show_state: false
triggers_update:
- binary_sensor.snapmaker_u1_card_live_verbindung
- sensor.snapmaker_u1_card_druckerwerte
- sensor.snapmaker_u1_card_druckstatus
- sensor.snapmaker_u1_card_filamente
- script.u1_fusion_v2_control
tap_action:
action: '[[[ if (states[''sensor.snapmaker_u1_card_druckerwerte'']?.attributes?.values?.idle_timeout_state
=== ''Idle'') return "none"; return ((states[''binary_sensor.snapmaker_u1_card_live_verbindung'']?.state
=== ''on'' && states[''sensor.snapmaker_u1_card_druckerwerte'']?.state
=== ''ready'' && [''standby'',''ready'',''complete'',''cancelled''].includes(states[''sensor.snapmaker_u1_card_druckstatus'']?.state)
&& states[''script.u1_fusion_v2_control'']?.state ===
''off'') && (states[''sensor.snapmaker_u1_card_filamente'']?.attributes?.head_states
?? []).filter(s => s === ''active'').length === 1) ?
''call-service'' : ''none''; ]]]'
service: script.u1_fusion_v2_control
service_data:
operation: preset
preset: head_back_right
hold_action:
action: none
double_tap_action:
action: none
styles:
card:
- height: 44px
- min-width: '0'
- padding: 4px 5px
- box-shadow: none
- border-radius: 9px
- background: 'var(--secondary-background-color, #252525)'
- border: 1px solid var(--divider-color)
- opacity: '[[[ if (states[''sensor.snapmaker_u1_card_druckerwerte'']?.attributes?.values?.idle_timeout_state
=== ''Idle'') return ".42"; return ((states[''binary_sensor.snapmaker_u1_card_live_verbindung'']?.state
=== ''on'' && states[''sensor.snapmaker_u1_card_druckerwerte'']?.state
=== ''ready'' && [''standby'',''ready'',''complete'',''cancelled''].includes(states[''sensor.snapmaker_u1_card_druckstatus'']?.state)
&& states[''script.u1_fusion_v2_control'']?.state
=== ''off'') && (states[''sensor.snapmaker_u1_card_filamente'']?.attributes?.head_states
?? []).filter(s => s === ''active'').length ===
1) ? ''1'' : ''.46''; ]]]'
name:
- font-size: 12px
- font-weight: '650'
- white-space: normal
- line-height: '1.15'
- text-align: center
styles:
card:
- padding: 2px 0
- border: none
- box-shadow: none
- background: transparent
- border-radius: '0'
- min-width: '0'
grid:
- grid-template-areas: '"label first second third"'
- grid-template-columns: minmax(44px,.60fr) repeat(3,minmax(0,1fr))
- align-items: center
- gap: 6px
custom_fields:
label:
- min-width: '0'
- width: 100%
- justify-self: stretch
- text-align: left
first:
- min-width: '0'
- width: 100%
- justify-self: stretch
- text-align: left
second:
- min-width: '0'
- width: 100%
- justify-self: stretch
- text-align: left
third:
- min-width: '0'
- width: 100%
- justify-self: stretch
- text-align: left
- type: custom:button-card
show_icon: false
show_name: false
show_state: false
tap_action:
action: none
hold_action:
action: none
double_tap_action:
action: none
triggers_update:
- sensor.snapmaker_u1_card_filamente
- sensor.snapmaker_u1_card_druckerwerte
- sensor.snapmaker_u1_card_druckstatus
- binary_sensor.snapmaker_u1_card_live_verbindung
- script.u1_fusion_v2_control
custom_fields:
heading: |-
[[[
const online = states['binary_sensor.snapmaker_u1_card_live_verbindung']?.state === 'on';
const heads = states['sensor.snapmaker_u1_card_filamente']?.attributes?.head_states;
const allParked = online && Array.isArray(heads) && heads.length === 4 && heads.every(head => head === 'parked');
const pickupHint = allParked ? 'Pick up a tool before moving it to a preset position.
' : '';
return '' + pickupHint + 'Keep the motion path clear. Lower the bed if needed before moving the tool. The U1 may pick up a tool during homing.';
]]]
styles:
card:
- padding: 5px 0 1px
- border: none
- box-shadow: none
- background: transparent
- border-radius: '0'
- min-width: '0'
grid:
- grid-template-areas: '"heading"'
- grid-template-columns: minmax(0,1fr)
- align-items: center
- gap: 6px
custom_fields:
heading:
- min-width: '0'
- width: 100%
- justify-self: stretch
- text-align: left
- white-space: normal
- overflow-wrap: anywhere
- type: custom:button-card
show_icon: false
show_name: false
show_state: false
tap_action:
action: none
hold_action:
action: none
double_tap_action:
action: none
triggers_update:
- sensor.snapmaker_u1_card_filamente
- sensor.snapmaker_u1_card_druckerwerte
- sensor.snapmaker_u1_card_druckstatus
- binary_sensor.snapmaker_u1_card_live_verbindung
- script.u1_fusion_v2_control
custom_fields:
heading: Tools
& filament
park:
card:
type: custom:button-card
name: '[[[ const h = states[''sensor.snapmaker_u1_card_filamente'']?.attributes?.head_states;
const n = Array.isArray(h) ? h.indexOf(''active'') : -1;
return n >= 0 ? ''Dock T'' + n : ''Dock tool''; ]]]'
show_icon: false
show_state: false
triggers_update:
- binary_sensor.snapmaker_u1_card_live_verbindung
- sensor.snapmaker_u1_card_druckerwerte
- sensor.snapmaker_u1_card_druckstatus
- sensor.snapmaker_u1_card_filamente
- script.u1_fusion_v2_control
tap_action:
action: '[[[ if (states[''sensor.snapmaker_u1_card_druckerwerte'']?.attributes?.values?.idle_timeout_state
=== ''Idle'') return "none"; return (((states[''binary_sensor.snapmaker_u1_card_live_verbindung'']?.state
=== ''on'' && states[''sensor.snapmaker_u1_card_druckerwerte'']?.state
=== ''ready'' && [''standby'',''ready'',''complete'',''cancelled''].includes(states[''sensor.snapmaker_u1_card_druckstatus'']?.state)
&& states[''script.u1_fusion_v2_control'']?.state ===
''off'')) && Array.isArray(states[''sensor.snapmaker_u1_card_filamente'']?.attributes?.head_states)
&& states[''sensor.snapmaker_u1_card_filamente'']?.attributes?.head_states.length
=== 4 && states[''sensor.snapmaker_u1_card_filamente'']?.attributes?.head_states.every(v
=> v === ''parked'' || v === ''active'') && states[''sensor.snapmaker_u1_card_filamente'']?.attributes?.head_states.filter(v
=> v === ''active'').length === 1) ? ''call-service''
: ''none''; ]]]'
service: script.u1_fusion_v2_control
service_data:
operation: park
hold_action:
action: none
double_tap_action:
action: none
styles:
card:
- height: 42px
- min-width: '0'
- padding: 4px 5px
- box-shadow: none
- border-radius: 9px
- background: 'var(--secondary-background-color, #252525)'
- border: 1px solid var(--divider-color)
- opacity: '[[[ if (states[''sensor.snapmaker_u1_card_druckerwerte'']?.attributes?.values?.idle_timeout_state
=== ''Idle'') return ".42"; return (((states[''binary_sensor.snapmaker_u1_card_live_verbindung'']?.state
=== ''on'' && states[''sensor.snapmaker_u1_card_druckerwerte'']?.state
=== ''ready'' && [''standby'',''ready'',''complete'',''cancelled''].includes(states[''sensor.snapmaker_u1_card_druckstatus'']?.state)
&& states[''script.u1_fusion_v2_control'']?.state
=== ''off'')) && Array.isArray(states[''sensor.snapmaker_u1_card_filamente'']?.attributes?.head_states)
&& states[''sensor.snapmaker_u1_card_filamente'']?.attributes?.head_states.length
=== 4 && states[''sensor.snapmaker_u1_card_filamente'']?.attributes?.head_states.every(v
=> v === ''parked'' || v === ''active'') && states[''sensor.snapmaker_u1_card_filamente'']?.attributes?.head_states.filter(v
=> v === ''active'').length === 1) ? ''1'' : ''.46'';
]]]'
name:
- font-size: 12px
- font-weight: '650'
- white-space: normal
- line-height: '1.15'
- text-align: center
styles:
card:
- padding: 8px 0 2px
- border: none
- box-shadow: none
- background: transparent
- border-radius: '0'
- min-width: '0'
- border-top: 1px solid var(--divider-color)
grid:
- grid-template-areas: '"heading park"'
- grid-template-columns: minmax(0,1fr) minmax(98px,.55fr)
- align-items: center
- gap: 6px
custom_fields:
heading:
- min-width: '0'
- width: 100%
- justify-self: stretch
- text-align: left
park:
- min-width: '0'
- width: 100%
- justify-self: stretch
- text-align: left
- type: custom:button-card
show_icon: false
show_name: false
show_state: false
tap_action:
action: none
hold_action:
action: none
double_tap_action:
action: none
triggers_update:
- sensor.snapmaker_u1_card_filamente
- sensor.snapmaker_u1_card_druckerwerte
- sensor.snapmaker_u1_card_druckstatus
- binary_sensor.snapmaker_u1_card_live_verbindung
- script.u1_fusion_v2_control
- input_select.u1_fusion_v2_selected_head
custom_fields:
head0:
card:
type: custom:button-card
name: T0
show_name: true
show_icon: false
show_state: false
triggers_update:
- input_select.u1_fusion_v2_selected_head
- sensor.snapmaker_u1_card_filamente
- binary_sensor.snapmaker_u1_card_live_verbindung
tap_action:
action: call-service
service: input_select.select_option
service_data:
entity_id: input_select.u1_fusion_v2_selected_head
option: Kopf 1
hold_action:
action: none
double_tap_action:
action: none
styles:
card:
- height: 44px
- padding: 3px 2px
- border-radius: 8px
- box-shadow: none
- background: '[[[ return states[''input_select.u1_fusion_v2_selected_head'']?.state
=== ''Kopf 1'' ? ''color-mix(in srgb,#59b8e5 14%,var(--card-background-color))''
: ''var(--secondary-background-color)''; ]]]'
- border: '[[[ return states[''input_select.u1_fusion_v2_selected_head'']?.state
=== ''Kopf 1'' ? ''1px solid #59b8e5'' : ''1px solid
var(--divider-color)''; ]]]'
name:
- font-size: 12px
- font-weight: '700'
grid:
- grid-template-areas: '"n" "l"'
- grid-template-rows: auto auto
- align-content: center
- row-gap: 1px
label:
- font-size: 10px
- line-height: '1.05'
- white-space: normal
- text-align: center
- color: var(--secondary-text-color)
show_label: true
label: |-
[[[
const heads = states['sensor.snapmaker_u1_card_filamente']?.attributes?.head_states;
if (states['binary_sensor.snapmaker_u1_card_live_verbindung']?.state === 'on' && heads?.[0] === 'active') return 'Mounted';
return states['input_select.u1_fusion_v2_selected_head']?.state === 'Kopf 1' ? 'Selected' : '';
]]]
head1:
card:
type: custom:button-card
name: T1
show_name: true
show_icon: false
show_state: false
triggers_update:
- input_select.u1_fusion_v2_selected_head
- sensor.snapmaker_u1_card_filamente
- binary_sensor.snapmaker_u1_card_live_verbindung
tap_action:
action: call-service
service: input_select.select_option
service_data:
entity_id: input_select.u1_fusion_v2_selected_head
option: Kopf 2
hold_action:
action: none
double_tap_action:
action: none
styles:
card:
- height: 44px
- padding: 3px 2px
- border-radius: 8px
- box-shadow: none
- background: '[[[ return states[''input_select.u1_fusion_v2_selected_head'']?.state
=== ''Kopf 2'' ? ''color-mix(in srgb,#59b8e5 14%,var(--card-background-color))''
: ''var(--secondary-background-color)''; ]]]'
- border: '[[[ return states[''input_select.u1_fusion_v2_selected_head'']?.state
=== ''Kopf 2'' ? ''1px solid #59b8e5'' : ''1px solid
var(--divider-color)''; ]]]'
name:
- font-size: 12px
- font-weight: '700'
grid:
- grid-template-areas: '"n" "l"'
- grid-template-rows: auto auto
- align-content: center
- row-gap: 1px
label:
- font-size: 10px
- line-height: '1.05'
- white-space: normal
- text-align: center
- color: var(--secondary-text-color)
show_label: true
label: |-
[[[
const heads = states['sensor.snapmaker_u1_card_filamente']?.attributes?.head_states;
if (states['binary_sensor.snapmaker_u1_card_live_verbindung']?.state === 'on' && heads?.[1] === 'active') return 'Mounted';
return states['input_select.u1_fusion_v2_selected_head']?.state === 'Kopf 2' ? 'Selected' : '';
]]]
head2:
card:
type: custom:button-card
name: T2
show_name: true
show_icon: false
show_state: false
triggers_update:
- input_select.u1_fusion_v2_selected_head
- sensor.snapmaker_u1_card_filamente
- binary_sensor.snapmaker_u1_card_live_verbindung
tap_action:
action: call-service
service: input_select.select_option
service_data:
entity_id: input_select.u1_fusion_v2_selected_head
option: Kopf 3
hold_action:
action: none
double_tap_action:
action: none
styles:
card:
- height: 44px
- padding: 3px 2px
- border-radius: 8px
- box-shadow: none
- background: '[[[ return states[''input_select.u1_fusion_v2_selected_head'']?.state
=== ''Kopf 3'' ? ''color-mix(in srgb,#59b8e5 14%,var(--card-background-color))''
: ''var(--secondary-background-color)''; ]]]'
- border: '[[[ return states[''input_select.u1_fusion_v2_selected_head'']?.state
=== ''Kopf 3'' ? ''1px solid #59b8e5'' : ''1px solid
var(--divider-color)''; ]]]'
name:
- font-size: 12px
- font-weight: '700'
grid:
- grid-template-areas: '"n" "l"'
- grid-template-rows: auto auto
- align-content: center
- row-gap: 1px
label:
- font-size: 10px
- line-height: '1.05'
- white-space: normal
- text-align: center
- color: var(--secondary-text-color)
show_label: true
label: |-
[[[
const heads = states['sensor.snapmaker_u1_card_filamente']?.attributes?.head_states;
if (states['binary_sensor.snapmaker_u1_card_live_verbindung']?.state === 'on' && heads?.[2] === 'active') return 'Mounted';
return states['input_select.u1_fusion_v2_selected_head']?.state === 'Kopf 3' ? 'Selected' : '';
]]]
head3:
card:
type: custom:button-card
name: T3
show_name: true
show_icon: false
show_state: false
triggers_update:
- input_select.u1_fusion_v2_selected_head
- sensor.snapmaker_u1_card_filamente
- binary_sensor.snapmaker_u1_card_live_verbindung
tap_action:
action: call-service
service: input_select.select_option
service_data:
entity_id: input_select.u1_fusion_v2_selected_head
option: Kopf 4
hold_action:
action: none
double_tap_action:
action: none
styles:
card:
- height: 44px
- padding: 3px 2px
- border-radius: 8px
- box-shadow: none
- background: '[[[ return states[''input_select.u1_fusion_v2_selected_head'']?.state
=== ''Kopf 4'' ? ''color-mix(in srgb,#59b8e5 14%,var(--card-background-color))''
: ''var(--secondary-background-color)''; ]]]'
- border: '[[[ return states[''input_select.u1_fusion_v2_selected_head'']?.state
=== ''Kopf 4'' ? ''1px solid #59b8e5'' : ''1px solid
var(--divider-color)''; ]]]'
name:
- font-size: 12px
- font-weight: '700'
grid:
- grid-template-areas: '"n" "l"'
- grid-template-rows: auto auto
- align-content: center
- row-gap: 1px
label:
- font-size: 10px
- line-height: '1.05'
- white-space: normal
- text-align: center
- color: var(--secondary-text-color)
show_label: true
label: |-
[[[
const heads = states['sensor.snapmaker_u1_card_filamente']?.attributes?.head_states;
if (states['binary_sensor.snapmaker_u1_card_live_verbindung']?.state === 'on' && heads?.[3] === 'active') return 'Mounted';
return states['input_select.u1_fusion_v2_selected_head']?.state === 'Kopf 4' ? 'Selected' : '';
]]]
styles:
card:
- padding: 3px 0 1px
- border: none
- box-shadow: none
- background: transparent
- border-radius: '0'
- min-width: '0'
grid:
- grid-template-areas: '"head0 head1 head2 head3"'
- grid-template-columns: repeat(4,minmax(0,1fr))
- align-items: center
- gap: 6px
custom_fields:
head0:
- min-width: '0'
- width: 100%
- justify-self: stretch
- text-align: left
- white-space: normal
head1:
- min-width: '0'
- width: 100%
- justify-self: stretch
- text-align: left
- white-space: normal
head2:
- min-width: '0'
- width: 100%
- justify-self: stretch
- text-align: left
- white-space: normal
head3:
- min-width: '0'
- width: 100%
- justify-self: stretch
- text-align: left
- white-space: normal
- type: custom:button-card
show_icon: false
show_name: false
show_state: false
tap_action:
action: none
hold_action:
action: none
double_tap_action:
action: none
triggers_update:
- sensor.snapmaker_u1_card_filamente
- sensor.snapmaker_u1_card_druckerwerte
- sensor.snapmaker_u1_card_druckstatus
- binary_sensor.snapmaker_u1_card_live_verbindung
- script.u1_fusion_v2_control
- input_select.u1_fusion_v2_selected_head
custom_fields:
selection: |-
[[[
const value = states['input_select.u1_fusion_v2_selected_head']?.state ?? '';
const i = ["Kopf 1","Kopf 2","Kopf 3","Kopf 4"].indexOf(value);
if (i < 0) return 'Select a tool';
const data = states['sensor.snapmaker_u1_card_filamente']?.attributes;
const filamentSensor = states['sensor.snapmaker_u1_card_druckerwerte']?.attributes?.values?.['e' + i + '_filament'];
const online = states['binary_sensor.snapmaker_u1_card_live_verbindung']?.state === 'on';
const pos = online && data?.head_states?.[i] === 'active' ? 'mounted' : online && data?.head_states?.[i] === 'parked' ? 'docked' : 'Position unknown';
const filament = online && filamentSensor === 'on' ? 'Filament loaded' : online && filamentSensor === 'off' ? 'No filament loaded' : 'Filament status unknown';
return '' + 'T' + i + ' · ' + pos + ' · ' + filament + '';
]]]
styles:
card:
- padding: 2px 0
- border: none
- box-shadow: none
- background: transparent
- border-radius: '0'
- min-width: '0'
grid:
- grid-template-areas: '"selection"'
- grid-template-columns: minmax(0,1fr)
- align-items: center
- gap: 6px
custom_fields:
selection:
- min-width: '0'
- width: 100%
- justify-self: stretch
- text-align: left
- white-space: normal
- type: conditional
conditions:
- condition: state
entity: input_select.u1_fusion_v2_selected_head
state: Kopf 1
card:
type: custom:button-card
show_icon: false
show_name: false
show_state: false
tap_action:
action: none
hold_action:
action: none
double_tap_action:
action: none
triggers_update:
- sensor.snapmaker_u1_card_filamente
- sensor.snapmaker_u1_card_druckerwerte
- sensor.snapmaker_u1_card_druckstatus
- binary_sensor.snapmaker_u1_card_live_verbindung
- script.u1_fusion_v2_control
- input_select.u1_fusion_v2_selected_head
custom_fields:
pick:
card:
type: custom:button-card
name: '[[[ return states[''sensor.snapmaker_u1_card_filamente'']?.attributes?.head_states?.[0]
=== ''active'' ? ''Mounted'' : ''Pick up tool''; ]]]'
show_icon: false
show_state: false
triggers_update:
- binary_sensor.snapmaker_u1_card_live_verbindung
- sensor.snapmaker_u1_card_druckerwerte
- sensor.snapmaker_u1_card_druckstatus
- sensor.snapmaker_u1_card_filamente
- script.u1_fusion_v2_control
tap_action:
action: '[[[ if (states[''sensor.snapmaker_u1_card_druckerwerte'']?.attributes?.values?.idle_timeout_state
=== ''Idle'') return "none"; return (((states[''binary_sensor.snapmaker_u1_card_live_verbindung'']?.state
=== ''on'' && states[''sensor.snapmaker_u1_card_druckerwerte'']?.state
=== ''ready'' && [''standby'',''ready'',''complete'',''cancelled''].includes(states[''sensor.snapmaker_u1_card_druckstatus'']?.state)
&& states[''script.u1_fusion_v2_control'']?.state
=== ''off'')) && Array.isArray(states[''sensor.snapmaker_u1_card_filamente'']?.attributes?.head_states)
&& states[''sensor.snapmaker_u1_card_filamente'']?.attributes?.head_states.length
=== 4 && states[''sensor.snapmaker_u1_card_filamente'']?.attributes?.head_states.every(v
=> v === ''parked'' || v === ''active'') && states[''sensor.snapmaker_u1_card_filamente'']?.attributes?.head_states[0]
=== ''parked'') ? ''call-service'' : ''none''; ]]]'
service: script.u1_fusion_v2_control
service_data:
operation: pick
tool: 0
hold_action:
action: none
double_tap_action:
action: none
styles:
card:
- height: 44px
- min-width: '0'
- padding: 4px 5px
- box-shadow: none
- border-radius: 9px
- background: 'var(--secondary-background-color, #252525)'
- border: '[[[ return states[''sensor.snapmaker_u1_card_filamente'']?.attributes?.head_states?.[0]
=== ''active'' ? ''1px solid #ff8069'' : ''1px
solid var(--divider-color)''; ]]]'
- opacity: '[[[ if (states[''sensor.snapmaker_u1_card_druckerwerte'']?.attributes?.values?.idle_timeout_state
=== ''Idle'') return ".42"; return (((states[''binary_sensor.snapmaker_u1_card_live_verbindung'']?.state
=== ''on'' && states[''sensor.snapmaker_u1_card_druckerwerte'']?.state
=== ''ready'' && [''standby'',''ready'',''complete'',''cancelled''].includes(states[''sensor.snapmaker_u1_card_druckstatus'']?.state)
&& states[''script.u1_fusion_v2_control'']?.state
=== ''off'')) && Array.isArray(states[''sensor.snapmaker_u1_card_filamente'']?.attributes?.head_states)
&& states[''sensor.snapmaker_u1_card_filamente'']?.attributes?.head_states.length
=== 4 && states[''sensor.snapmaker_u1_card_filamente'']?.attributes?.head_states.every(v
=> v === ''parked'' || v === ''active'') && states[''sensor.snapmaker_u1_card_filamente'']?.attributes?.head_states[0]
=== ''parked'') || states[''sensor.snapmaker_u1_card_filamente'']?.attributes?.head_states?.[0]
=== ''active'' ? ''1'' : ''.46''; ]]]'
name:
- font-size: 12px
- font-weight: '650'
- white-space: normal
- line-height: '1.15'
- text-align: center
load:
card:
type: custom:button-card
name: Load filament
show_icon: false
show_state: false
triggers_update:
- binary_sensor.snapmaker_u1_card_live_verbindung
- sensor.snapmaker_u1_card_druckerwerte
- sensor.snapmaker_u1_card_druckstatus
- sensor.snapmaker_u1_card_filamente
- script.u1_fusion_v2_control
tap_action:
action: '[[[ if (states[''sensor.snapmaker_u1_card_druckerwerte'']?.attributes?.values?.idle_timeout_state
=== ''Idle'') return "none"; return ((states[''binary_sensor.snapmaker_u1_card_live_verbindung'']?.state
=== ''on'' && states[''sensor.snapmaker_u1_card_druckerwerte'']?.state
=== ''ready'' && [''standby'',''ready'',''complete'',''cancelled''].includes(states[''sensor.snapmaker_u1_card_druckstatus'']?.state)
&& states[''script.u1_fusion_v2_control'']?.state
=== ''off'') && states[''sensor.snapmaker_u1_card_druckerwerte'']?.attributes?.values?.e0_filament
=== ''off'') ? ''call-service'' : ''none''; ]]]'
service: script.u1_fusion_v2_control
service_data:
operation: load
tool: 0
confirmation:
text: Load T0? Have the filament ready at the inlet.
The U1 may move and heat the toolhead.
hold_action:
action: none
double_tap_action:
action: none
styles:
card:
- height: 44px
- min-width: '0'
- padding: 4px 5px
- box-shadow: none
- border-radius: 9px
- background: 'var(--secondary-background-color, #252525)'
- border: 1px solid var(--divider-color)
- opacity: '[[[ if (states[''sensor.snapmaker_u1_card_druckerwerte'']?.attributes?.values?.idle_timeout_state
=== ''Idle'') return ".42"; return ((states[''binary_sensor.snapmaker_u1_card_live_verbindung'']?.state
=== ''on'' && states[''sensor.snapmaker_u1_card_druckerwerte'']?.state
=== ''ready'' && [''standby'',''ready'',''complete'',''cancelled''].includes(states[''sensor.snapmaker_u1_card_druckstatus'']?.state)
&& states[''script.u1_fusion_v2_control'']?.state
=== ''off'') && states[''sensor.snapmaker_u1_card_druckerwerte'']?.attributes?.values?.e0_filament
=== ''off'') ? ''1'' : ''.46''; ]]]'
name:
- font-size: 12px
- font-weight: '650'
- white-space: normal
- line-height: '1.15'
- text-align: center
unload:
card:
type: custom:button-card
name: Unload filament
show_icon: false
show_state: false
triggers_update:
- binary_sensor.snapmaker_u1_card_live_verbindung
- sensor.snapmaker_u1_card_druckerwerte
- sensor.snapmaker_u1_card_druckstatus
- sensor.snapmaker_u1_card_filamente
- script.u1_fusion_v2_control
tap_action:
action: '[[[ if (states[''sensor.snapmaker_u1_card_druckerwerte'']?.attributes?.values?.idle_timeout_state
=== ''Idle'') return "none"; return ((states[''binary_sensor.snapmaker_u1_card_live_verbindung'']?.state
=== ''on'' && states[''sensor.snapmaker_u1_card_druckerwerte'']?.state
=== ''ready'' && [''standby'',''ready'',''complete'',''cancelled''].includes(states[''sensor.snapmaker_u1_card_druckstatus'']?.state)
&& states[''script.u1_fusion_v2_control'']?.state
=== ''off'') && states[''sensor.snapmaker_u1_card_druckerwerte'']?.attributes?.values?.e0_filament
=== ''on'') ? ''call-service'' : ''none''; ]]]'
service: script.u1_fusion_v2_control
service_data:
operation: unload
tool: 0
confirmation:
text: Unload T0? The U1 may move and heat the toolhead.
hold_action:
action: none
double_tap_action:
action: none
styles:
card:
- height: 44px
- min-width: '0'
- padding: 4px 5px
- box-shadow: none
- border-radius: 9px
- background: 'var(--secondary-background-color, #252525)'
- border: 1px solid var(--divider-color)
- opacity: '[[[ if (states[''sensor.snapmaker_u1_card_druckerwerte'']?.attributes?.values?.idle_timeout_state
=== ''Idle'') return ".42"; return ((states[''binary_sensor.snapmaker_u1_card_live_verbindung'']?.state
=== ''on'' && states[''sensor.snapmaker_u1_card_druckerwerte'']?.state
=== ''ready'' && [''standby'',''ready'',''complete'',''cancelled''].includes(states[''sensor.snapmaker_u1_card_druckstatus'']?.state)
&& states[''script.u1_fusion_v2_control'']?.state
=== ''off'') && states[''sensor.snapmaker_u1_card_druckerwerte'']?.attributes?.values?.e0_filament
=== ''on'') ? ''1'' : ''.46''; ]]]'
name:
- font-size: 12px
- font-weight: '650'
- white-space: normal
- line-height: '1.15'
- text-align: center
styles:
card:
- padding: 1px 0 0
- border: none
- box-shadow: none
- background: transparent
- border-radius: '0'
- min-width: '0'
grid:
- grid-template-areas: '"pick load unload"'
- grid-template-columns: repeat(3,minmax(0,1fr))
- align-items: center
- gap: 6px
custom_fields:
pick:
- min-width: '0'
- width: 100%
- justify-self: stretch
- text-align: left
- white-space: normal
load:
- min-width: '0'
- width: 100%
- justify-self: stretch
- text-align: left
- white-space: normal
unload:
- min-width: '0'
- width: 100%
- justify-self: stretch
- text-align: left
- white-space: normal
- type: conditional
conditions:
- condition: state
entity: input_select.u1_fusion_v2_selected_head
state: Kopf 2
card:
type: custom:button-card
show_icon: false
show_name: false
show_state: false
tap_action:
action: none
hold_action:
action: none
double_tap_action:
action: none
triggers_update:
- sensor.snapmaker_u1_card_filamente
- sensor.snapmaker_u1_card_druckerwerte
- sensor.snapmaker_u1_card_druckstatus
- binary_sensor.snapmaker_u1_card_live_verbindung
- script.u1_fusion_v2_control
- input_select.u1_fusion_v2_selected_head
custom_fields:
pick:
card:
type: custom:button-card
name: '[[[ return states[''sensor.snapmaker_u1_card_filamente'']?.attributes?.head_states?.[1]
=== ''active'' ? ''Mounted'' : ''Pick up tool''; ]]]'
show_icon: false
show_state: false
triggers_update:
- binary_sensor.snapmaker_u1_card_live_verbindung
- sensor.snapmaker_u1_card_druckerwerte
- sensor.snapmaker_u1_card_druckstatus
- sensor.snapmaker_u1_card_filamente
- script.u1_fusion_v2_control
tap_action:
action: '[[[ if (states[''sensor.snapmaker_u1_card_druckerwerte'']?.attributes?.values?.idle_timeout_state
=== ''Idle'') return "none"; return (((states[''binary_sensor.snapmaker_u1_card_live_verbindung'']?.state
=== ''on'' && states[''sensor.snapmaker_u1_card_druckerwerte'']?.state
=== ''ready'' && [''standby'',''ready'',''complete'',''cancelled''].includes(states[''sensor.snapmaker_u1_card_druckstatus'']?.state)
&& states[''script.u1_fusion_v2_control'']?.state
=== ''off'')) && Array.isArray(states[''sensor.snapmaker_u1_card_filamente'']?.attributes?.head_states)
&& states[''sensor.snapmaker_u1_card_filamente'']?.attributes?.head_states.length
=== 4 && states[''sensor.snapmaker_u1_card_filamente'']?.attributes?.head_states.every(v
=> v === ''parked'' || v === ''active'') && states[''sensor.snapmaker_u1_card_filamente'']?.attributes?.head_states[1]
=== ''parked'') ? ''call-service'' : ''none''; ]]]'
service: script.u1_fusion_v2_control
service_data:
operation: pick
tool: 1
hold_action:
action: none
double_tap_action:
action: none
styles:
card:
- height: 44px
- min-width: '0'
- padding: 4px 5px
- box-shadow: none
- border-radius: 9px
- background: 'var(--secondary-background-color, #252525)'
- border: '[[[ return states[''sensor.snapmaker_u1_card_filamente'']?.attributes?.head_states?.[1]
=== ''active'' ? ''1px solid #ff8069'' : ''1px
solid var(--divider-color)''; ]]]'
- opacity: '[[[ if (states[''sensor.snapmaker_u1_card_druckerwerte'']?.attributes?.values?.idle_timeout_state
=== ''Idle'') return ".42"; return (((states[''binary_sensor.snapmaker_u1_card_live_verbindung'']?.state
=== ''on'' && states[''sensor.snapmaker_u1_card_druckerwerte'']?.state
=== ''ready'' && [''standby'',''ready'',''complete'',''cancelled''].includes(states[''sensor.snapmaker_u1_card_druckstatus'']?.state)
&& states[''script.u1_fusion_v2_control'']?.state
=== ''off'')) && Array.isArray(states[''sensor.snapmaker_u1_card_filamente'']?.attributes?.head_states)
&& states[''sensor.snapmaker_u1_card_filamente'']?.attributes?.head_states.length
=== 4 && states[''sensor.snapmaker_u1_card_filamente'']?.attributes?.head_states.every(v
=> v === ''parked'' || v === ''active'') && states[''sensor.snapmaker_u1_card_filamente'']?.attributes?.head_states[1]
=== ''parked'') || states[''sensor.snapmaker_u1_card_filamente'']?.attributes?.head_states?.[1]
=== ''active'' ? ''1'' : ''.46''; ]]]'
name:
- font-size: 12px
- font-weight: '650'
- white-space: normal
- line-height: '1.15'
- text-align: center
load:
card:
type: custom:button-card
name: Load filament
show_icon: false
show_state: false
triggers_update:
- binary_sensor.snapmaker_u1_card_live_verbindung
- sensor.snapmaker_u1_card_druckerwerte
- sensor.snapmaker_u1_card_druckstatus
- sensor.snapmaker_u1_card_filamente
- script.u1_fusion_v2_control
tap_action:
action: '[[[ if (states[''sensor.snapmaker_u1_card_druckerwerte'']?.attributes?.values?.idle_timeout_state
=== ''Idle'') return "none"; return ((states[''binary_sensor.snapmaker_u1_card_live_verbindung'']?.state
=== ''on'' && states[''sensor.snapmaker_u1_card_druckerwerte'']?.state
=== ''ready'' && [''standby'',''ready'',''complete'',''cancelled''].includes(states[''sensor.snapmaker_u1_card_druckstatus'']?.state)
&& states[''script.u1_fusion_v2_control'']?.state
=== ''off'') && states[''sensor.snapmaker_u1_card_druckerwerte'']?.attributes?.values?.e1_filament
=== ''off'') ? ''call-service'' : ''none''; ]]]'
service: script.u1_fusion_v2_control
service_data:
operation: load
tool: 1
confirmation:
text: Load T1? Have the filament ready at the inlet.
The U1 may move and heat the toolhead.
hold_action:
action: none
double_tap_action:
action: none
styles:
card:
- height: 44px
- min-width: '0'
- padding: 4px 5px
- box-shadow: none
- border-radius: 9px
- background: 'var(--secondary-background-color, #252525)'
- border: 1px solid var(--divider-color)
- opacity: '[[[ if (states[''sensor.snapmaker_u1_card_druckerwerte'']?.attributes?.values?.idle_timeout_state
=== ''Idle'') return ".42"; return ((states[''binary_sensor.snapmaker_u1_card_live_verbindung'']?.state
=== ''on'' && states[''sensor.snapmaker_u1_card_druckerwerte'']?.state
=== ''ready'' && [''standby'',''ready'',''complete'',''cancelled''].includes(states[''sensor.snapmaker_u1_card_druckstatus'']?.state)
&& states[''script.u1_fusion_v2_control'']?.state
=== ''off'') && states[''sensor.snapmaker_u1_card_druckerwerte'']?.attributes?.values?.e1_filament
=== ''off'') ? ''1'' : ''.46''; ]]]'
name:
- font-size: 12px
- font-weight: '650'
- white-space: normal
- line-height: '1.15'
- text-align: center
unload:
card:
type: custom:button-card
name: Unload filament
show_icon: false
show_state: false
triggers_update:
- binary_sensor.snapmaker_u1_card_live_verbindung
- sensor.snapmaker_u1_card_druckerwerte
- sensor.snapmaker_u1_card_druckstatus
- sensor.snapmaker_u1_card_filamente
- script.u1_fusion_v2_control
tap_action:
action: '[[[ if (states[''sensor.snapmaker_u1_card_druckerwerte'']?.attributes?.values?.idle_timeout_state
=== ''Idle'') return "none"; return ((states[''binary_sensor.snapmaker_u1_card_live_verbindung'']?.state
=== ''on'' && states[''sensor.snapmaker_u1_card_druckerwerte'']?.state
=== ''ready'' && [''standby'',''ready'',''complete'',''cancelled''].includes(states[''sensor.snapmaker_u1_card_druckstatus'']?.state)
&& states[''script.u1_fusion_v2_control'']?.state
=== ''off'') && states[''sensor.snapmaker_u1_card_druckerwerte'']?.attributes?.values?.e1_filament
=== ''on'') ? ''call-service'' : ''none''; ]]]'
service: script.u1_fusion_v2_control
service_data:
operation: unload
tool: 1
confirmation:
text: Unload T1? The U1 may move and heat the toolhead.
hold_action:
action: none
double_tap_action:
action: none
styles:
card:
- height: 44px
- min-width: '0'
- padding: 4px 5px
- box-shadow: none
- border-radius: 9px
- background: 'var(--secondary-background-color, #252525)'
- border: 1px solid var(--divider-color)
- opacity: '[[[ if (states[''sensor.snapmaker_u1_card_druckerwerte'']?.attributes?.values?.idle_timeout_state
=== ''Idle'') return ".42"; return ((states[''binary_sensor.snapmaker_u1_card_live_verbindung'']?.state
=== ''on'' && states[''sensor.snapmaker_u1_card_druckerwerte'']?.state
=== ''ready'' && [''standby'',''ready'',''complete'',''cancelled''].includes(states[''sensor.snapmaker_u1_card_druckstatus'']?.state)
&& states[''script.u1_fusion_v2_control'']?.state
=== ''off'') && states[''sensor.snapmaker_u1_card_druckerwerte'']?.attributes?.values?.e1_filament
=== ''on'') ? ''1'' : ''.46''; ]]]'
name:
- font-size: 12px
- font-weight: '650'
- white-space: normal
- line-height: '1.15'
- text-align: center
styles:
card:
- padding: 1px 0 0
- border: none
- box-shadow: none
- background: transparent
- border-radius: '0'
- min-width: '0'
grid:
- grid-template-areas: '"pick load unload"'
- grid-template-columns: repeat(3,minmax(0,1fr))
- align-items: center
- gap: 6px
custom_fields:
pick:
- min-width: '0'
- width: 100%
- justify-self: stretch
- text-align: left
- white-space: normal
load:
- min-width: '0'
- width: 100%
- justify-self: stretch
- text-align: left
- white-space: normal
unload:
- min-width: '0'
- width: 100%
- justify-self: stretch
- text-align: left
- white-space: normal
- type: conditional
conditions:
- condition: state
entity: input_select.u1_fusion_v2_selected_head
state: Kopf 3
card:
type: custom:button-card
show_icon: false
show_name: false
show_state: false
tap_action:
action: none
hold_action:
action: none
double_tap_action:
action: none
triggers_update:
- sensor.snapmaker_u1_card_filamente
- sensor.snapmaker_u1_card_druckerwerte
- sensor.snapmaker_u1_card_druckstatus
- binary_sensor.snapmaker_u1_card_live_verbindung
- script.u1_fusion_v2_control
- input_select.u1_fusion_v2_selected_head
custom_fields:
pick:
card:
type: custom:button-card
name: '[[[ return states[''sensor.snapmaker_u1_card_filamente'']?.attributes?.head_states?.[2]
=== ''active'' ? ''Mounted'' : ''Pick up tool''; ]]]'
show_icon: false
show_state: false
triggers_update:
- binary_sensor.snapmaker_u1_card_live_verbindung
- sensor.snapmaker_u1_card_druckerwerte
- sensor.snapmaker_u1_card_druckstatus
- sensor.snapmaker_u1_card_filamente
- script.u1_fusion_v2_control
tap_action:
action: '[[[ if (states[''sensor.snapmaker_u1_card_druckerwerte'']?.attributes?.values?.idle_timeout_state
=== ''Idle'') return "none"; return (((states[''binary_sensor.snapmaker_u1_card_live_verbindung'']?.state
=== ''on'' && states[''sensor.snapmaker_u1_card_druckerwerte'']?.state
=== ''ready'' && [''standby'',''ready'',''complete'',''cancelled''].includes(states[''sensor.snapmaker_u1_card_druckstatus'']?.state)
&& states[''script.u1_fusion_v2_control'']?.state
=== ''off'')) && Array.isArray(states[''sensor.snapmaker_u1_card_filamente'']?.attributes?.head_states)
&& states[''sensor.snapmaker_u1_card_filamente'']?.attributes?.head_states.length
=== 4 && states[''sensor.snapmaker_u1_card_filamente'']?.attributes?.head_states.every(v
=> v === ''parked'' || v === ''active'') && states[''sensor.snapmaker_u1_card_filamente'']?.attributes?.head_states[2]
=== ''parked'') ? ''call-service'' : ''none''; ]]]'
service: script.u1_fusion_v2_control
service_data:
operation: pick
tool: 2
hold_action:
action: none
double_tap_action:
action: none
styles:
card:
- height: 44px
- min-width: '0'
- padding: 4px 5px
- box-shadow: none
- border-radius: 9px
- background: 'var(--secondary-background-color, #252525)'
- border: '[[[ return states[''sensor.snapmaker_u1_card_filamente'']?.attributes?.head_states?.[2]
=== ''active'' ? ''1px solid #ff8069'' : ''1px
solid var(--divider-color)''; ]]]'
- opacity: '[[[ if (states[''sensor.snapmaker_u1_card_druckerwerte'']?.attributes?.values?.idle_timeout_state
=== ''Idle'') return ".42"; return (((states[''binary_sensor.snapmaker_u1_card_live_verbindung'']?.state
=== ''on'' && states[''sensor.snapmaker_u1_card_druckerwerte'']?.state
=== ''ready'' && [''standby'',''ready'',''complete'',''cancelled''].includes(states[''sensor.snapmaker_u1_card_druckstatus'']?.state)
&& states[''script.u1_fusion_v2_control'']?.state
=== ''off'')) && Array.isArray(states[''sensor.snapmaker_u1_card_filamente'']?.attributes?.head_states)
&& states[''sensor.snapmaker_u1_card_filamente'']?.attributes?.head_states.length
=== 4 && states[''sensor.snapmaker_u1_card_filamente'']?.attributes?.head_states.every(v
=> v === ''parked'' || v === ''active'') && states[''sensor.snapmaker_u1_card_filamente'']?.attributes?.head_states[2]
=== ''parked'') || states[''sensor.snapmaker_u1_card_filamente'']?.attributes?.head_states?.[2]
=== ''active'' ? ''1'' : ''.46''; ]]]'
name:
- font-size: 12px
- font-weight: '650'
- white-space: normal
- line-height: '1.15'
- text-align: center
load:
card:
type: custom:button-card
name: Load filament
show_icon: false
show_state: false
triggers_update:
- binary_sensor.snapmaker_u1_card_live_verbindung
- sensor.snapmaker_u1_card_druckerwerte
- sensor.snapmaker_u1_card_druckstatus
- sensor.snapmaker_u1_card_filamente
- script.u1_fusion_v2_control
tap_action:
action: '[[[ if (states[''sensor.snapmaker_u1_card_druckerwerte'']?.attributes?.values?.idle_timeout_state
=== ''Idle'') return "none"; return ((states[''binary_sensor.snapmaker_u1_card_live_verbindung'']?.state
=== ''on'' && states[''sensor.snapmaker_u1_card_druckerwerte'']?.state
=== ''ready'' && [''standby'',''ready'',''complete'',''cancelled''].includes(states[''sensor.snapmaker_u1_card_druckstatus'']?.state)
&& states[''script.u1_fusion_v2_control'']?.state
=== ''off'') && states[''sensor.snapmaker_u1_card_druckerwerte'']?.attributes?.values?.e2_filament
=== ''off'') ? ''call-service'' : ''none''; ]]]'
service: script.u1_fusion_v2_control
service_data:
operation: load
tool: 2
confirmation:
text: Load T2? Have the filament ready at the inlet.
The U1 may move and heat the toolhead.
hold_action:
action: none
double_tap_action:
action: none
styles:
card:
- height: 44px
- min-width: '0'
- padding: 4px 5px
- box-shadow: none
- border-radius: 9px
- background: 'var(--secondary-background-color, #252525)'
- border: 1px solid var(--divider-color)
- opacity: '[[[ if (states[''sensor.snapmaker_u1_card_druckerwerte'']?.attributes?.values?.idle_timeout_state
=== ''Idle'') return ".42"; return ((states[''binary_sensor.snapmaker_u1_card_live_verbindung'']?.state
=== ''on'' && states[''sensor.snapmaker_u1_card_druckerwerte'']?.state
=== ''ready'' && [''standby'',''ready'',''complete'',''cancelled''].includes(states[''sensor.snapmaker_u1_card_druckstatus'']?.state)
&& states[''script.u1_fusion_v2_control'']?.state
=== ''off'') && states[''sensor.snapmaker_u1_card_druckerwerte'']?.attributes?.values?.e2_filament
=== ''off'') ? ''1'' : ''.46''; ]]]'
name:
- font-size: 12px
- font-weight: '650'
- white-space: normal
- line-height: '1.15'
- text-align: center
unload:
card:
type: custom:button-card
name: Unload filament
show_icon: false
show_state: false
triggers_update:
- binary_sensor.snapmaker_u1_card_live_verbindung
- sensor.snapmaker_u1_card_druckerwerte
- sensor.snapmaker_u1_card_druckstatus
- sensor.snapmaker_u1_card_filamente
- script.u1_fusion_v2_control
tap_action:
action: '[[[ if (states[''sensor.snapmaker_u1_card_druckerwerte'']?.attributes?.values?.idle_timeout_state
=== ''Idle'') return "none"; return ((states[''binary_sensor.snapmaker_u1_card_live_verbindung'']?.state
=== ''on'' && states[''sensor.snapmaker_u1_card_druckerwerte'']?.state
=== ''ready'' && [''standby'',''ready'',''complete'',''cancelled''].includes(states[''sensor.snapmaker_u1_card_druckstatus'']?.state)
&& states[''script.u1_fusion_v2_control'']?.state
=== ''off'') && states[''sensor.snapmaker_u1_card_druckerwerte'']?.attributes?.values?.e2_filament
=== ''on'') ? ''call-service'' : ''none''; ]]]'
service: script.u1_fusion_v2_control
service_data:
operation: unload
tool: 2
confirmation:
text: Unload T2? The U1 may move and heat the toolhead.
hold_action:
action: none
double_tap_action:
action: none
styles:
card:
- height: 44px
- min-width: '0'
- padding: 4px 5px
- box-shadow: none
- border-radius: 9px
- background: 'var(--secondary-background-color, #252525)'
- border: 1px solid var(--divider-color)
- opacity: '[[[ if (states[''sensor.snapmaker_u1_card_druckerwerte'']?.attributes?.values?.idle_timeout_state
=== ''Idle'') return ".42"; return ((states[''binary_sensor.snapmaker_u1_card_live_verbindung'']?.state
=== ''on'' && states[''sensor.snapmaker_u1_card_druckerwerte'']?.state
=== ''ready'' && [''standby'',''ready'',''complete'',''cancelled''].includes(states[''sensor.snapmaker_u1_card_druckstatus'']?.state)
&& states[''script.u1_fusion_v2_control'']?.state
=== ''off'') && states[''sensor.snapmaker_u1_card_druckerwerte'']?.attributes?.values?.e2_filament
=== ''on'') ? ''1'' : ''.46''; ]]]'
name:
- font-size: 12px
- font-weight: '650'
- white-space: normal
- line-height: '1.15'
- text-align: center
styles:
card:
- padding: 1px 0 0
- border: none
- box-shadow: none
- background: transparent
- border-radius: '0'
- min-width: '0'
grid:
- grid-template-areas: '"pick load unload"'
- grid-template-columns: repeat(3,minmax(0,1fr))
- align-items: center
- gap: 6px
custom_fields:
pick:
- min-width: '0'
- width: 100%
- justify-self: stretch
- text-align: left
- white-space: normal
load:
- min-width: '0'
- width: 100%
- justify-self: stretch
- text-align: left
- white-space: normal
unload:
- min-width: '0'
- width: 100%
- justify-self: stretch
- text-align: left
- white-space: normal
- type: conditional
conditions:
- condition: state
entity: input_select.u1_fusion_v2_selected_head
state: Kopf 4
card:
type: custom:button-card
show_icon: false
show_name: false
show_state: false
tap_action:
action: none
hold_action:
action: none
double_tap_action:
action: none
triggers_update:
- sensor.snapmaker_u1_card_filamente
- sensor.snapmaker_u1_card_druckerwerte
- sensor.snapmaker_u1_card_druckstatus
- binary_sensor.snapmaker_u1_card_live_verbindung
- script.u1_fusion_v2_control
- input_select.u1_fusion_v2_selected_head
custom_fields:
pick:
card:
type: custom:button-card
name: '[[[ return states[''sensor.snapmaker_u1_card_filamente'']?.attributes?.head_states?.[3]
=== ''active'' ? ''Mounted'' : ''Pick up tool''; ]]]'
show_icon: false
show_state: false
triggers_update:
- binary_sensor.snapmaker_u1_card_live_verbindung
- sensor.snapmaker_u1_card_druckerwerte
- sensor.snapmaker_u1_card_druckstatus
- sensor.snapmaker_u1_card_filamente
- script.u1_fusion_v2_control
tap_action:
action: '[[[ if (states[''sensor.snapmaker_u1_card_druckerwerte'']?.attributes?.values?.idle_timeout_state
=== ''Idle'') return "none"; return (((states[''binary_sensor.snapmaker_u1_card_live_verbindung'']?.state
=== ''on'' && states[''sensor.snapmaker_u1_card_druckerwerte'']?.state
=== ''ready'' && [''standby'',''ready'',''complete'',''cancelled''].includes(states[''sensor.snapmaker_u1_card_druckstatus'']?.state)
&& states[''script.u1_fusion_v2_control'']?.state
=== ''off'')) && Array.isArray(states[''sensor.snapmaker_u1_card_filamente'']?.attributes?.head_states)
&& states[''sensor.snapmaker_u1_card_filamente'']?.attributes?.head_states.length
=== 4 && states[''sensor.snapmaker_u1_card_filamente'']?.attributes?.head_states.every(v
=> v === ''parked'' || v === ''active'') && states[''sensor.snapmaker_u1_card_filamente'']?.attributes?.head_states[3]
=== ''parked'') ? ''call-service'' : ''none''; ]]]'
service: script.u1_fusion_v2_control
service_data:
operation: pick
tool: 3
hold_action:
action: none
double_tap_action:
action: none
styles:
card:
- height: 44px
- min-width: '0'
- padding: 4px 5px
- box-shadow: none
- border-radius: 9px
- background: 'var(--secondary-background-color, #252525)'
- border: '[[[ return states[''sensor.snapmaker_u1_card_filamente'']?.attributes?.head_states?.[3]
=== ''active'' ? ''1px solid #ff8069'' : ''1px
solid var(--divider-color)''; ]]]'
- opacity: '[[[ if (states[''sensor.snapmaker_u1_card_druckerwerte'']?.attributes?.values?.idle_timeout_state
=== ''Idle'') return ".42"; return (((states[''binary_sensor.snapmaker_u1_card_live_verbindung'']?.state
=== ''on'' && states[''sensor.snapmaker_u1_card_druckerwerte'']?.state
=== ''ready'' && [''standby'',''ready'',''complete'',''cancelled''].includes(states[''sensor.snapmaker_u1_card_druckstatus'']?.state)
&& states[''script.u1_fusion_v2_control'']?.state
=== ''off'')) && Array.isArray(states[''sensor.snapmaker_u1_card_filamente'']?.attributes?.head_states)
&& states[''sensor.snapmaker_u1_card_filamente'']?.attributes?.head_states.length
=== 4 && states[''sensor.snapmaker_u1_card_filamente'']?.attributes?.head_states.every(v
=> v === ''parked'' || v === ''active'') && states[''sensor.snapmaker_u1_card_filamente'']?.attributes?.head_states[3]
=== ''parked'') || states[''sensor.snapmaker_u1_card_filamente'']?.attributes?.head_states?.[3]
=== ''active'' ? ''1'' : ''.46''; ]]]'
name:
- font-size: 12px
- font-weight: '650'
- white-space: normal
- line-height: '1.15'
- text-align: center
load:
card:
type: custom:button-card
name: Load filament
show_icon: false
show_state: false
triggers_update:
- binary_sensor.snapmaker_u1_card_live_verbindung
- sensor.snapmaker_u1_card_druckerwerte
- sensor.snapmaker_u1_card_druckstatus
- sensor.snapmaker_u1_card_filamente
- script.u1_fusion_v2_control
tap_action:
action: '[[[ if (states[''sensor.snapmaker_u1_card_druckerwerte'']?.attributes?.values?.idle_timeout_state
=== ''Idle'') return "none"; return ((states[''binary_sensor.snapmaker_u1_card_live_verbindung'']?.state
=== ''on'' && states[''sensor.snapmaker_u1_card_druckerwerte'']?.state
=== ''ready'' && [''standby'',''ready'',''complete'',''cancelled''].includes(states[''sensor.snapmaker_u1_card_druckstatus'']?.state)
&& states[''script.u1_fusion_v2_control'']?.state
=== ''off'') && states[''sensor.snapmaker_u1_card_druckerwerte'']?.attributes?.values?.e3_filament
=== ''off'') ? ''call-service'' : ''none''; ]]]'
service: script.u1_fusion_v2_control
service_data:
operation: load
tool: 3
confirmation:
text: Load T3? Have the filament ready at the inlet.
The U1 may move and heat the toolhead.
hold_action:
action: none
double_tap_action:
action: none
styles:
card:
- height: 44px
- min-width: '0'
- padding: 4px 5px
- box-shadow: none
- border-radius: 9px
- background: 'var(--secondary-background-color, #252525)'
- border: 1px solid var(--divider-color)
- opacity: '[[[ if (states[''sensor.snapmaker_u1_card_druckerwerte'']?.attributes?.values?.idle_timeout_state
=== ''Idle'') return ".42"; return ((states[''binary_sensor.snapmaker_u1_card_live_verbindung'']?.state
=== ''on'' && states[''sensor.snapmaker_u1_card_druckerwerte'']?.state
=== ''ready'' && [''standby'',''ready'',''complete'',''cancelled''].includes(states[''sensor.snapmaker_u1_card_druckstatus'']?.state)
&& states[''script.u1_fusion_v2_control'']?.state
=== ''off'') && states[''sensor.snapmaker_u1_card_druckerwerte'']?.attributes?.values?.e3_filament
=== ''off'') ? ''1'' : ''.46''; ]]]'
name:
- font-size: 12px
- font-weight: '650'
- white-space: normal
- line-height: '1.15'
- text-align: center
unload:
card:
type: custom:button-card
name: Unload filament
show_icon: false
show_state: false
triggers_update:
- binary_sensor.snapmaker_u1_card_live_verbindung
- sensor.snapmaker_u1_card_druckerwerte
- sensor.snapmaker_u1_card_druckstatus
- sensor.snapmaker_u1_card_filamente
- script.u1_fusion_v2_control
tap_action:
action: '[[[ if (states[''sensor.snapmaker_u1_card_druckerwerte'']?.attributes?.values?.idle_timeout_state
=== ''Idle'') return "none"; return ((states[''binary_sensor.snapmaker_u1_card_live_verbindung'']?.state
=== ''on'' && states[''sensor.snapmaker_u1_card_druckerwerte'']?.state
=== ''ready'' && [''standby'',''ready'',''complete'',''cancelled''].includes(states[''sensor.snapmaker_u1_card_druckstatus'']?.state)
&& states[''script.u1_fusion_v2_control'']?.state
=== ''off'') && states[''sensor.snapmaker_u1_card_druckerwerte'']?.attributes?.values?.e3_filament
=== ''on'') ? ''call-service'' : ''none''; ]]]'
service: script.u1_fusion_v2_control
service_data:
operation: unload
tool: 3
confirmation:
text: Unload T3? The U1 may move and heat the toolhead.
hold_action:
action: none
double_tap_action:
action: none
styles:
card:
- height: 44px
- min-width: '0'
- padding: 4px 5px
- box-shadow: none
- border-radius: 9px
- background: 'var(--secondary-background-color, #252525)'
- border: 1px solid var(--divider-color)
- opacity: '[[[ if (states[''sensor.snapmaker_u1_card_druckerwerte'']?.attributes?.values?.idle_timeout_state
=== ''Idle'') return ".42"; return ((states[''binary_sensor.snapmaker_u1_card_live_verbindung'']?.state
=== ''on'' && states[''sensor.snapmaker_u1_card_druckerwerte'']?.state
=== ''ready'' && [''standby'',''ready'',''complete'',''cancelled''].includes(states[''sensor.snapmaker_u1_card_druckstatus'']?.state)
&& states[''script.u1_fusion_v2_control'']?.state
=== ''off'') && states[''sensor.snapmaker_u1_card_druckerwerte'']?.attributes?.values?.e3_filament
=== ''on'') ? ''1'' : ''.46''; ]]]'
name:
- font-size: 12px
- font-weight: '650'
- white-space: normal
- line-height: '1.15'
- text-align: center
styles:
card:
- padding: 1px 0 0
- border: none
- box-shadow: none
- background: transparent
- border-radius: '0'
- min-width: '0'
grid:
- grid-template-areas: '"pick load unload"'
- grid-template-columns: repeat(3,minmax(0,1fr))
- align-items: center
- gap: 6px
custom_fields:
pick:
- min-width: '0'
- width: 100%
- justify-self: stretch
- text-align: left
- white-space: normal
load:
- min-width: '0'
- width: 100%
- justify-self: stretch
- text-align: left
- white-space: normal
unload:
- min-width: '0'
- width: 100%
- justify-self: stretch
- text-align: left
- white-space: normal
card_mod:
style: 'ha-card { padding: 12px; min-width: 0; box-sizing: border-box;
box-shadow: none; border-radius: 14px; } #root { display: flex;
flex-direction: column; gap: 6px; }'
grid_options:
columns: full
rows: auto
visibility:
- condition: state
entity: sensor.snapmaker_u1_card_druckstatus
state_not:
- printing
- paused
- type: grid
column_span: 3
cards:
- type: heading
heading: Files & history
icon: mdi:file-document-multiple-outline
heading_style: title
grid_options:
columns: full
rows: auto
- type: custom:u1-fusion-showcase-ironoxx
filaments_sensor: sensor.snapmaker_u1_card_filamente
files_sensor: sensor.snapmaker_u1_card_druckdateien
camera: camera.snapmaker_u1_card_kamera
layout: tabs
controls_lock: 60
emergency_stop: hide
camera_direct: 'off'
camera_webrtc: 'off'
camera_mode: still
refresh: 3
camera_max_height: 420
show:
- queue
- files
- history
- stats
- timelapse
state_accent: false
card_mod:
style: |-
ha-card { border-radius: 14px; box-shadow: none; }
.head { display: none !important; }
.tab[aria-selected="true"] { color: #ff8069; border-bottom-color: #ff6347; }
.tab:focus-visible { outline-color: #ff8069; }
.tabs { flex-wrap: wrap; gap: 2px 4px; overflow: visible; }
@container u1 (max-width: 520px) { .tab span { display: inline; } .tab { padding: 8px 9px; } }
@media(max-width: 560px) { .panel { min-width: 0; } }
.layout[data-pane="files"] > :only-child { grid-column: 1 / -1; }
.panel:has(> .files > .file):not(:has(> .files > .file:nth-child(4))) { padding-block: 12px; gap: 8px; }
.files:has(> .file):not(:has(> .file:nth-child(4))) button.file { padding: 6px; gap: 4px; }
.files:has(> .file):not(:has(> .file:nth-child(4))) .file-thumb { height: 68px; aspect-ratio: auto; }
grid_options:
columns: 24
rows: auto
- type: custom:u1-fusion-showcase-ironoxx
filaments_sensor: sensor.snapmaker_u1_card_filamente
files_sensor: sensor.snapmaker_u1_card_druckdateien
camera: camera.snapmaker_u1_card_kamera
layout: scroll
controls_lock: 60
emergency_stop: hide
camera_direct: 'off'
camera_webrtc: 'off'
camera_mode: still
refresh: 3
camera_max_height: 420
show:
- layer
state_accent: false
card_mod:
style: |-
ha-card { border-radius: 14px; box-shadow: none; }
.head { display: none !important; }
@container style(--column-span: 3) {
:host { display: block; height: 100%; min-height: 260px; }
ha-card { box-sizing: border-box; height: 100%; }
.layout { flex: 1; min-height: 0; grid-template-rows: minmax(0, 1fr); }
.lv-panel { min-height: 0; height: 100%; display: flex; flex-direction: column; }
.lv { flex: 1 1 auto; min-height: 200px; aspect-ratio: auto; }
}
.panel > .panel-head .panel-title { font-size:16px; font-weight:700; line-height:1.25; color:var(--primary-text-color); }
grid_options:
columns: 12
rows: auto
visibility:
- condition: or
conditions:
- condition: state
entity: sensor.snapmaker_u1_card_druckstatus
state: printing
- condition: state
entity: sensor.snapmaker_u1_card_druckstatus
state: paused
- condition: state
entity: binary_sensor.snapmaker_u1_card_live_verbindung
state: 'on'
- type: markdown
title: Layer view
content: |-
**Inactive**
The layer view appears during a print when the printer is connected.
grid_options:
columns: 12
rows: auto
card_mod:
style:
.: ha-card { border-radius:14px; box-shadow:none; --ha-card-header-font-size:16px;
}
ha-card$: .card-header { font-weight:700; padding:14px 14px 0; }
visibility:
- condition: not
conditions:
- condition: and
conditions:
- condition: or
conditions:
- condition: state
entity: sensor.snapmaker_u1_card_druckstatus
state: printing
- condition: state
entity: sensor.snapmaker_u1_card_druckstatus
state: paused
- condition: state
entity: binary_sensor.snapmaker_u1_card_live_verbindung
state: 'on'
- title: Minimal
path: u1-minimal
type: sections
max_columns: 3
dense_section_placement: false
sections:
- type: grid
column_span: 3
cards:
- type: custom:button-card
template: u1_showcase_data
custom_fields:
content: |-
[[[
// A running HA client may have loaded its resource list before the Showcase was registered.
if (!customElements.get("u1-fusion-showcase-hero-v18") ||
!customElements.get("u1-fusion-showcase-ironoxx")) {
this._u1ShowcaseModule ??= import("/local/media/snapmaker-u1/showcase/u1-fusion-showcase.u1.js?v=559-20").catch(error => {
console.error("U1 Fusion Showcase resource failed to load", error);
});
}
const d = variables.d;
const tone = {neutral:'#a3a7ad',hot:'#ff6347',warn:'#f3be73',error:'#ff8377',ok:'#93cc9f'}[d.tone];
const tool = !d.known ? '' : d.active !== null ? `T${d.active} mounted` :
d.heads.every(head => head.state === 'parked') ? '4 tools docked' : 'Tool position unknown';
return `5 · Snapmaker U1
U1 Fusion Showcase
`;
]]]
styles:
card:
- background: transparent
- border: none
- padding: '0'
grid_options:
columns: full
rows: auto
- type: grid
cards:
- type: custom:u1-fusion-showcase-hero-v18
axis_limits:
x:
- 0
- 271
y:
- 0
- 335
z:
- -6
- 275
grid_options:
columns: full
rows: auto
card_mod:
style: |-
@media (min-width: 1200px) {
ha-card {
box-sizing: border-box;
--u1-overview-height: clamp(345px, calc(22vw + 64px), 410px);
min-height: var(--u1-overview-height);
}
}
show_print_actions: true
show_filament_heat: true
controls_source:
dashboard: 3d-printer
view: snapmaker-u1
- type: grid
cards:
- type: custom:u1-fusion-showcase-ironoxx
filaments_sensor: sensor.snapmaker_u1_card_filamente
files_sensor: sensor.snapmaker_u1_card_druckdateien
camera: camera.snapmaker_u1_card_kamera
layout: scroll
controls_lock: 60
emergency_stop: hide
camera_direct: 'off'
camera_webrtc: 'off'
camera_mode: still
refresh: 3
camera_max_height: 480
show:
- stage
camera_overlay: false
state_accent: false
card_mod:
style: |-
ha-card { border-radius: 14px; box-shadow: none; }
.head { display: none !important; }
ha-card { padding: 0; overflow: hidden; background: transparent; }
.panel.stage { margin: 0; }
.stage .thumb, .cam-state small { display: none !important; }
.stage-actions { padding: 8px 12px; }
.stage-actions button { min-height: 38px; }
ha-card {
background: var(--card-background-color);
border: 1px solid var(--divider-color);
border-radius: 14px;
padding: 0;
}
.panel.stage { border: none; border-radius: 0; background: transparent; }
.panel.stage::before {
content: "Printer camera";
display: block;
padding: 14px 14px 11px;
color: var(--primary-text-color);
font-size: 17px;
font-weight: 700;
}
.stage-actions button:not([data-act="light"]) { display: none; }
.stage-actions { padding: 8px; }
.stage-actions button { min-height: 36px; }
@media (min-width: 1200px) {
ha-card {
box-sizing: border-box;
--u1-overview-height: clamp(345px, calc(22vw + 64px), 410px);
min-height: var(--u1-overview-height);
}
}
@media (min-width: 1200px) { .stage .frame { min-height:calc(var(--u1-overview-height) - 111px); } }
camera_fit: contain
grid_options:
columns: full
rows: auto
- type: grid
cards:
- type: custom:button-card
template: u1_showcase_data
custom_fields:
content: |-
[[[
const d = variables.d;
const esc = s => String(s ?? '').replace(/[&<>"']/g,c=>({'&':'&','<':'<','>':'>','"':'"',"'":'''}[c]));
const decimal = (n,digits=0) => Number(n).toLocaleString('en-GB',{maximumFractionDigits:digits});
const positive = n => typeof n === 'number' && Number.isFinite(n) && n > 0;
const duration = minutes => {
if (!positive(minutes)) return '';
const m = Math.max(1,Math.round(minutes));
return m < 60 ? `${m} min` : `${Math.floor(m / 60)} h ${m % 60} min`;
};
const date = (value,options) => Number.isFinite(Date.parse(value)) ? new Date(value).toLocaleString('en-GB',options) : '';
const image = (...candidates) => candidates.find(p => typeof p === 'string' && /^\/snapmaker_u1_card\/thumbs\//.test(p));
const metric = (label,value) => value ? `${label}${esc(value)}` : '';
const result = {complete:'Completed',completed:'Completed',cancelled:'Cancelled',canceled:'Cancelled',error:'Error',failed:'Error',aborted:'Cancelled'};
const err = d.known && d.status === 'error';
const activeJob = d.running || err;
const last = d.known && !activeJob ? d.last : null;
const thumb = activeJob ? image(d.model?.thumb) : last ? image(last.thumb,d.lastModel?.thumb,last.photo) : undefined;
const pct = d.running && d.progress !== null ? Math.round(Math.max(0,Math.min(100,d.progress))) : null;
const short = v => v.replace(/\.(gcode|3mf)$/i,'').replace(/[_+]+/g,' ');
const filename = activeJob ? short(d.filename) : last ? short(last.name || last.file) : '';
const heading = activeJob ? 'Print job' : d.known ? 'Last print' : 'Print job';
const chip = activeJob ? d.label : last ? result[last.result] : '';
const finish = date(d.eta,{hour:'2-digit',minute:'2-digit'});
const ended = date(last?.ended,{day:'2-digit',month:'2-digit',hour:'2-digit',minute:'2-digit'});
const filament = positive(last?.filament_used) ? `${decimal(last.filament_used / 1000,2)} m` : '';
const layer = d.layer || d.layers ? `${d.layer ?? '—'} / ${d.layers ?? '—'}` : '';
const metrics = d.running
? metric('Layer',layer)+metric('ETA',finish)+metric('Remaining',duration(d.remaining))+metric('Elapsed',duration(d.elapsed))
: last ? metric('Duration',duration(last.duration / 60))+metric('Filament',filament) : '';
const statusText = err ? d.reason || 'The printer reported an error.'
: d.status === 'paused' && d.running ? d.reason || 'The print is waiting to resume.'
: !d.online ? 'Printer disconnected.'
: !d.known ? 'Print status is currently unknown.'
: !activeJob && !last ? 'No print has been recorded yet.' : '';
const tone = activeJob ? d.tone : last && ['complete','completed'].includes(last.result) ? 'ok' : 'neutral';
return `${heading}${chip ? `${chip}` : ''}
${pct === null ? '' : `${pct} %
`}
${(thumb || filename) ? `${thumb ? `
})
` : ''}
${esc(filename)}
${ended ? `
${esc(ended)}
` : ''}
` : ''}
${statusText ? `${esc(statusText)}
` : ''}
${metrics ? `${metrics}
` : ''}`;
]]]
grid_options:
columns: full
rows: auto
card_mod:
style: |-
@media (min-width: 1200px) {
ha-card {
box-sizing: border-box;
--u1-overview-height: clamp(345px, calc(22vw + 64px), 410px);
min-height: var(--u1-overview-height);
}
}
@media (min-width: 1200px) {
ha-card { min-height: calc(var(--u1-overview-height) - 57px); }
ha-card:not(:has(.u1-track)) .u1-job-main .u1-model {
height: clamp(105px, calc(22vw - 174px), 145px);
}
}
styles:
card:
- justify-content: flex-start
grid:
- grid-template-rows: max-content
- align-content: start
- align-items: start
- type: custom:button-card
template: u1_showcase_data
entity: button.snapmaker_u1_card_not_halt
name: Emergency stop
icon: mdi:alert-octagon
show_name: true
show_icon: true
tap_action:
action: |-
[[[
const available = entity?.state && entity.state !== 'unavailable';
return variables.d.online && available ? 'perform-action' : 'none';
]]]
perform_action: button.press
target:
entity_id: button.snapmaker_u1_card_not_halt
confirmation:
text: Trigger an emergency stop? Klipper stops immediately and switches
off the heaters and motors. A firmware restart is required afterward.
styles:
card:
- height: 40px
- border-radius: 999px
- padding: 0 7px
- box-shadow: none
- background: '[[[ return variables.d.running ? ''#a41622'' : ''#424448'';
]]]'
- border: '[[[ return variables.d.running ? ''1px solid #d94b52''
: ''1px solid #6b6d72''; ]]]'
- color: '#fff'
- opacity: '[[[ return variables.d.online && entity?.state && entity.state
!== ''unavailable'' ? ''1'' : ''.48''; ]]]'
grid:
- grid-template-areas: '"i n"'
- grid-template-columns: 22px max-content
- grid-template-rows: 1fr
- justify-content: center
- column-gap: 5px
icon:
- width: 18px
- color: '#fff'
name:
- font-size: 13px
- font-weight: '650'
grid_options:
columns: full
rows: auto
- type: custom:button-card
template: u1_showcase_data
entity: input_boolean.snapmaker_u1_cool_after_printing
show_name: false
show_icon: false
show_label: false
tap_action:
action: none
hold_action:
action: none
double_tap_action:
action: none
triggers_update:
- input_boolean.snapmaker_u1_cool_after_printing
- input_number.snapmaker_u1_cool_after_printing_minutes
- input_number.snapmaker_u1_cool_after_printing_speed
- input_boolean.snapmaker_u1_cool_after_printing_panel
- automation.snapmaker_u1_cool_after_printing
custom_fields:
tune:
card:
type: custom:button-card
entity: input_number.snapmaker_u1_cool_after_printing_minutes
name: Cooling after printing
show_name: true
show_icon: false
show_label: true
triggers_update:
- input_number.snapmaker_u1_cool_after_printing_minutes
- input_number.snapmaker_u1_cool_after_printing_speed
- automation.snapmaker_u1_cool_after_printing
label: '[[[
const mins = Math.round(Number(states[''input_number.snapmaker_u1_cool_after_printing_minutes'']?.state ?? 5));
const pct = Math.round(Number(states[''input_number.snapmaker_u1_cool_after_printing_speed'']?.state ?? 70));
const running = Number(states[''automation.snapmaker_u1_cool_after_printing'']?.attributes?.current ?? 0) > 0;
return running ? `Active · ${pct} %` : `${mins} min · ${pct} %`;
]]]'
tap_action:
action: perform-action
perform_action: input_boolean.toggle
target:
entity_id: input_boolean.snapmaker_u1_cool_after_printing_panel
styles:
card:
- padding: 4px 0
- border: none
- border-radius: '0'
- background: transparent
- box-shadow: none
- pointer-events: auto
grid:
- grid-template-areas: '"n l"'
- grid-template-columns: 1fr auto
- grid-template-rows: auto
- column-gap: 8px
- align-items: center
name:
- justify-self: start
- font-weight: '650'
- font-size: 13px
label:
- font-size: 12px
- font-weight: '600'
- color: var(--secondary-text-color)
switch:
card:
type: custom:button-card
entity: input_boolean.snapmaker_u1_cool_after_printing
triggers_update:
- input_boolean.snapmaker_u1_cool_after_printing
show_icon: false
show_name: false
show_label: true
label: '[[[ return states[''input_boolean.snapmaker_u1_cool_after_printing'']?.state === ''on'' ? ''On'' : ''Off''; ]]]'
tap_action:
action: perform-action
perform_action: input_boolean.toggle
target:
entity_id: input_boolean.snapmaker_u1_cool_after_printing
styles:
card:
- padding: 2px 9px
- border-radius: 999px
- box-shadow: none
- pointer-events: auto
- background: '[[[ return states[''input_boolean.snapmaker_u1_cool_after_printing'']?.state === ''on'' ? ''rgba(255, 128, 105, 0.16)'' : ''rgba(255, 255, 255, 0.06)''; ]]]'
- border: '[[[ return states[''input_boolean.snapmaker_u1_cool_after_printing'']?.state === ''on'' ? ''1px solid rgba(255, 128, 105, 0.45)'' : ''1px solid var(--divider-color)''; ]]]'
label:
- font-size: 11px
- font-weight: '700'
- color: '[[[ return states[''input_boolean.snapmaker_u1_cool_after_printing'']?.state === ''on'' ? ''#ff8069'' : ''var(--secondary-text-color)''; ]]]'
styles:
card:
- padding: 4px 10px 4px 12px
- boxShadow: none
grid:
- grid-template-areas: '"tune switch"'
- grid-template-columns: 1fr auto
- grid-template-rows: auto
- column-gap: 8px
- align-items: center
custom_fields:
tune:
- pointer-events: auto
switch:
- pointer-events: auto
grid_options:
columns: full
rows: auto
- type: conditional
conditions:
- condition: state
entity: input_boolean.snapmaker_u1_cool_after_printing_panel
state: 'on'
card:
type: custom:vertical-stack-in-card
card_mod:
style: 'ha-card { border: 1px solid rgba(255, 128, 105, 0.35); border-radius: 14px; background: var(--ha-card-background, var(--card-background-color)); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.32); overflow: hidden; }'
cards:
- type: custom:button-card
template: u1_showcase_data
name: Cool after printing · Settings
show_name: true
show_icon: false
show_label: true
label: ✕
tap_action:
action: perform-action
perform_action: input_boolean.turn_off
target:
entity_id: input_boolean.snapmaker_u1_cool_after_printing_panel
styles:
card:
- padding: 8px 12px 4px 12px
- border: none
- border-radius: '0'
- background: transparent
grid:
- grid-template-areas: '"n l"'
- grid-template-columns: 1fr auto
- grid-template-rows: auto
name:
- justify-self: start
- font-size: 12px
- font-weight: '700'
- color: '#ff8069'
label:
- font-size: 13px
- font-weight: '700'
- color: var(--secondary-text-color)
- type: entities
show_header_toggle: false
entities:
- type: custom:slider-entity-row
entity: input_number.snapmaker_u1_cool_after_printing_minutes
name: Time
min: 1
max: 15
step: 1
hide_state: false
- type: custom:slider-entity-row
entity: input_number.snapmaker_u1_cool_after_printing_speed
name: Fan speed
min: 40
max: 100
step: 5
hide_state: false
card_mod:
style: 'ha-card { box-shadow: none; --ha-card-border-width: 0px; background: transparent; } .card-content { padding: 2px 12px 6px 12px; }'
- type: custom:button-card
template: u1_showcase_data
name: Cools bed to 36 °C (stops early if reached). Best for PLA · off for ABS / large PETG.
show_name: true
show_icon: false
show_label: false
tap_action:
action: none
styles:
card:
- padding: 0 12px 10px 12px
- border: none
- border-radius: '0'
- background: transparent
grid:
- grid-template-areas: '"n"'
- grid-template-columns: 1fr
- grid-template-rows: auto
name:
- justify-self: start
- text-align: left
- white-space: normal
- font-size: 11px
- line-height: '1.35'
- color: var(--secondary-text-color)
grid_options:
columns: full
rows: auto
- type: grid
column_span: 3
cards:
- type: custom:u1-fusion-showcase-ironoxx
filaments_sensor: sensor.snapmaker_u1_card_filamente
files_sensor: sensor.snapmaker_u1_card_druckdateien
camera: camera.snapmaker_u1_card_kamera
layout: tabs
controls_lock: 60
emergency_stop: hide
camera_direct: 'off'
camera_webrtc: 'off'
camera_mode: still
refresh: 3
camera_max_height: 420
show:
- files
- history
- timelapse
state_accent: false
card_mod:
style: |-
ha-card { border-radius: 14px; box-shadow: none; }
.head { display: none !important; }
.tab[aria-selected="true"] { color: #ff8069; border-bottom-color: #ff6347; }
.tab:focus-visible { outline-color: #ff8069; }
.tabs { flex-wrap: wrap; gap: 2px 4px; overflow: visible; }
@container u1 (max-width: 520px) { .tab span { display: inline; } .tab { padding: 8px 9px; } }
@media(max-width: 560px) { .panel { min-width: 0; } }
.layout[data-pane="files"] > :only-child { grid-column: 1 / -1; }
.panel:has(> .files > .file):not(:has(> .files > .file:nth-child(4))) { padding-block: 12px; gap: 8px; }
.files:has(> .file):not(:has(> .file:nth-child(4))) button.file { padding: 6px; gap: 4px; }
.files:has(> .file):not(:has(> .file:nth-child(4))) .file-thumb { height: 68px; aspect-ratio: auto; }
grid_options:
columns: 24
rows: auto
files_limit: 4
timelapse_limit: 4
- type: custom:u1-fusion-showcase-ironoxx
filaments_sensor: sensor.snapmaker_u1_card_filamente
files_sensor: sensor.snapmaker_u1_card_druckdateien
camera: camera.snapmaker_u1_card_kamera
layout: scroll
controls_lock: 60
emergency_stop: hide
camera_direct: 'off'
camera_webrtc: 'off'
camera_mode: still
refresh: 3
camera_max_height: 420
show:
- layer
state_accent: false
card_mod:
style: |-
ha-card { border-radius: 14px; box-shadow: none; }
.head { display: none !important; }
@container style(--column-span: 3) {
:host { display: block; height: 100%; min-height: 260px; }
ha-card { box-sizing: border-box; height: 100%; }
.layout { flex: 1; min-height: 0; grid-template-rows: minmax(0, 1fr); }
.lv-panel { min-height: 0; height: 100%; display: flex; flex-direction: column; }
.lv { flex: 1 1 auto; min-height: 200px; aspect-ratio: auto; }
}
.panel > .panel-head .panel-title { font-size:16px; font-weight:700; line-height:1.25; color:var(--primary-text-color); }
grid_options:
columns: 12
rows: auto
visibility:
- condition: or
conditions:
- condition: state
entity: sensor.snapmaker_u1_card_druckstatus
state: printing
- condition: state
entity: sensor.snapmaker_u1_card_druckstatus
state: paused
- condition: state
entity: binary_sensor.snapmaker_u1_card_live_verbindung
state: 'on'
- type: markdown
title: Layer view
content: |-
**Inactive**
The layer view appears during a print when the printer is connected.
grid_options:
columns: 12
rows: auto
card_mod:
style:
.: ha-card { border-radius:14px; box-shadow:none; --ha-card-header-font-size:16px;
}
ha-card$: .card-header { font-weight:700; padding:14px 14px 0; }
visibility:
- condition: not
conditions:
- condition: and
conditions:
- condition: or
conditions:
- condition: state
entity: sensor.snapmaker_u1_card_druckstatus
state: printing
- condition: state
entity: sensor.snapmaker_u1_card_druckstatus
state: paused
- condition: state
entity: binary_sensor.snapmaker_u1_card_live_verbindung
state: 'on'
- title: Maintenance & Diagnostics
path: u1-maintenance
type: sections
max_columns: 3
dense_section_placement: false
sections:
- type: grid
column_span: 3
cards:
- type: custom:button-card
template: u1_showcase_data
custom_fields:
content: |-
[[[
// A running HA client may have loaded its resource list before the Showcase was registered.
if (!customElements.get("u1-fusion-showcase-hero-v18") ||
!customElements.get("u1-fusion-showcase-ironoxx")) {
this._u1ShowcaseModule ??= import("/local/media/snapmaker-u1/showcase/u1-fusion-showcase.u1.js?v=559-20").catch(error => {
console.error("U1 Fusion Showcase resource failed to load", error);
});
}
const d = variables.d;
const tone = {neutral:'#a3a7ad',hot:'#ff6347',warn:'#f3be73',error:'#ff8377',ok:'#93cc9f'}[d.tone];
const tool = !d.known ? '' : d.active !== null ? `T${d.active} mounted` :
d.heads.every(head => head.state === 'parked') ? '4 tools docked' : 'Tool position unknown';
return `5 · Snapmaker U1
U1 Fusion Showcase
`;
]]]
styles:
card:
- background: transparent
- border: none
- padding: '0'
grid_options:
columns: full
rows: auto
- type: grid
cards:
- filaments_sensor: sensor.snapmaker_u1_card_filamente
files_sensor: sensor.snapmaker_u1_card_druckdateien
camera: camera.snapmaker_u1_card_kamera
layout: scroll
controls_lock: 60
emergency_stop: hide
camera_direct: 'off'
camera_webrtc: 'off'
camera_mode: still
refresh: 3
camera_max_height: 420
show:
- console
state_accent: false
card_mod:
style: |-
ha-card { border-radius: 14px; box-shadow: none; }
.head { display: none !important; }
.panel > .panel-head .panel-title { font-size:16px; font-weight:700; line-height:1.25; color:var(--primary-text-color); }
type: custom:u1-fusion-showcase-ironoxx
grid_options:
columns: full
rows: auto
- filaments_sensor: sensor.snapmaker_u1_card_filamente
files_sensor: sensor.snapmaker_u1_card_druckdateien
camera: camera.snapmaker_u1_card_kamera
layout: scroll
controls_lock: 60
emergency_stop: hide
camera_direct: 'off'
camera_webrtc: 'off'
camera_mode: still
refresh: 3
camera_max_height: 420
show:
- maintenance
state_accent: false
card_mod:
style: |-
ha-card { border-radius: 14px; box-shadow: none; }
.head { display: none !important; }
.tab[aria-selected="true"] { color: #ff8069; border-bottom-color: #ff6347; }
.tab:focus-visible { outline-color: #ff8069; }
.tabs { flex-wrap: wrap; gap: 2px 4px; overflow: visible; }
@container u1 (max-width: 520px) { .tab span { display: inline; } .tab { padding: 8px 9px; } }
@media(max-width: 560px) { .panel { min-width: 0; } }
.layout[data-pane="files"] > :only-child { grid-column: 1 / -1; }
.panel > .panel-head .panel-title { font-size:16px; font-weight:700; line-height:1.25; color:var(--primary-text-color); }
@media (min-width: 1200px) { .m-list { gap:5px; } .m-top { margin-bottom:3px; } }
type: custom:u1-fusion-showcase-ironoxx
grid_options:
columns: full
rows: auto
- type: grid
cards:
- type: custom:config-template-card
entities:
- sensor.snapmaker_u1_card_druckstatus
- sensor.snapmaker_u1_card_filamente
- binary_sensor.snapmaker_u1_card_live_verbindung
variables:
RUNNING: states['binary_sensor.snapmaker_u1_card_live_verbindung']?.state
=== 'on' && ['printing','paused'].includes(states['sensor.snapmaker_u1_card_druckstatus']?.state)
HEAD: '(() => {const h=states[''sensor.snapmaker_u1_card_filamente'']?.attributes?.head_states
?? []; const i=h.indexOf(''active''); return vars.RUNNING && i >=
0 && i < 4 && i===h.lastIndexOf(''active'') ? i : -1;})()'
card:
type: custom:apexcharts-card
header:
show: true
title: Temperature history · °C
graph_span: 1h
apex_config:
chart:
height: '${RUNNING ? 186 : 155}'
toolbar:
show: false
animations:
enabled: false
legend:
show: true
position: bottom
fontSize: 12px
itemMargin:
horizontal: 7
vertical: 2
xaxis:
labels:
datetimeUTC: false
format: HH:mm
grid:
borderColor: var(--divider-color)
strokeDashArray: 3
stroke:
curve: straight
series:
- entity: sensor.snapmaker_u1_card_betttemperatur
name: Bed
color: '#78bbab'
stroke_width: 2
group_by:
func: avg
duration: 1min
show:
legend_value: false
- entity: sensor.snapmaker_u1_card_duse_1_temperatur
name: T0
color: '${HEAD === 0 ? ''#ff6347'' : ''#e3a477''}'
stroke_width: '${HEAD === 0 ? 3 : 1}'
group_by:
func: avg
duration: 1min
show:
legend_value: false
hidden_by_default: ${HEAD !== 0}
- entity: sensor.snapmaker_u1_card_duse_2_temperatur
name: T1
color: '${HEAD === 1 ? ''#ff6347'' : ''#b8c7d5''}'
stroke_width: '${HEAD === 1 ? 3 : 1}'
group_by:
func: avg
duration: 1min
show:
legend_value: false
hidden_by_default: ${HEAD !== 1}
- entity: sensor.snapmaker_u1_card_duse_3_temperatur
name: T2
color: '${HEAD === 2 ? ''#ff6347'' : ''#a998ce''}'
stroke_width: '${HEAD === 2 ? 3 : 1}'
group_by:
func: avg
duration: 1min
show:
legend_value: false
hidden_by_default: ${HEAD !== 2}
- entity: sensor.snapmaker_u1_card_duse_4_temperatur
name: T3
color: '${HEAD === 3 ? ''#ff6347'' : ''#e3c47b''}'
stroke_width: '${HEAD === 3 ? 3 : 1}'
group_by:
func: avg
duration: 1min
show:
legend_value: false
hidden_by_default: ${HEAD !== 3}
card_mod:
style: 'ha-card { border-radius:14px; box-shadow:none; } #header__title
{ font-size:16px; font-weight:700; line-height:1.25; color:var(--primary-text-color);
}'
experimental:
hidden_by_default: true
yaxis:
- min: 0
max: ~90
decimals: 0
apex_config:
tickAmount: 3
show: true
showAlways: true
showForNullSeries: true
grid_options:
columns: full
rows: auto
card_mod:
style:
apexcharts-card$: |-
#header__title { font-size:16px; font-weight:700; line-height:1.25; color:var(--primary-text-color); }
@media (min-width: 1200px) { ha-card { box-sizing:border-box; min-height:214px; } }
- filaments_sensor: sensor.snapmaker_u1_card_filamente
files_sensor: sensor.snapmaker_u1_card_druckdateien
camera: camera.snapmaker_u1_card_kamera
layout: scroll
controls_lock: 60
emergency_stop: hide
camera_direct: 'off'
camera_webrtc: 'off'
camera_mode: still
refresh: 3
camera_max_height: 420
show:
- mesh
state_accent: false
card_mod:
style: |-
ha-card { border-radius: 14px; box-shadow: none; }
.head { display: none !important; }
.ctl:has(input[data-num$="_speed_factor"]), .ctl:has(input[data-num$="_flow_factor"]) { display: none; }
.panel > .panel-head .panel-title { font-size:16px; font-weight:700; line-height:1.25; color:var(--primary-text-color); }
@media (min-width: 1200px) { .mesh { padding-block:18px 22px; } }
.mesh .tlegend { font-size:14px; line-height:1.35; gap:4px 18px; }
.mesh .tlegend i { width:12px; height:12px; }
@media (min-width:1200px) { .mesh .tlegend { padding-block:12px 13px; } }
type: custom:u1-fusion-showcase-ironoxx
grid_options:
columns: full
rows: auto
- type: grid
cards:
- filaments_sensor: sensor.snapmaker_u1_card_filamente
files_sensor: sensor.snapmaker_u1_card_druckdateien
camera: camera.snapmaker_u1_card_kamera
layout: scroll
controls_lock: 60
emergency_stop: hide
camera_direct: 'off'
camera_webrtc: 'off'
camera_mode: still
refresh: 3
camera_max_height: 420
show:
- system
state_accent: false
card_mod:
style: |-
ha-card { border-radius: 14px; box-shadow: none; }
.head { display: none !important; }
.tab[aria-selected="true"] { color: #ff8069; border-bottom-color: #ff6347; }
.tab:focus-visible { outline-color: #ff8069; }
.tabs { flex-wrap: wrap; gap: 2px 4px; overflow: visible; }
@container u1 (max-width: 520px) { .tab span { display: inline; } .tab { padding: 8px 9px; } }
@media(max-width: 560px) { .panel { min-width: 0; } }
.layout[data-pane="files"] > :only-child { grid-column: 1 / -1; }
.panel > details > summary { visibility:hidden; pointer-events:none; }
.panel > details > summary > :not(.caret) { visibility:visible; }
.panel > details > summary > .caret { display:none; }
.panel > details > summary > span { font-size:16px; font-weight:700; line-height:1.25; color:var(--primary-text-color); }
type: custom:u1-fusion-showcase-ironoxx
grid_options:
columns: full
rows: auto
compact: false
button_card_templates:
u1_showcase_data:
variables:
d: |-
[[[
const p = 'snapmaker_u1_card_';
const get = (suffix, domain = 'sensor') => states[`${domain}.${p}${suffix}`]?.state;
const attr = (suffix, key) => states[`sensor.${p}${suffix}`]?.attributes?.[key];
const valid = value => typeof value === 'string' && value.trim() && !['unknown','unavailable','none'].includes(value.toLowerCase());
const number = value => (typeof value === 'number' || valid(value)) && Number.isFinite(Number(value)) ? Number(value) : null;
const filaments = attr('filamente', 'slots') || [];
const toolStates = attr('filamente', 'head_states') || [];
const values = attr('druckerwerte', 'values') || {};
const status = get('druckstatus');
const online = get('live_verbindung', 'binary_sensor') === 'on' && valid(get('druckerwerte'));
const known = online && valid(status);
const running = known && ['printing','paused'].includes(status);
const mounted = [0,1,2,3].filter(i => toolStates[i] === 'active');
const active = known && mounted.length === 1 ? mounted[0] : null;
const files = attr('druckdateien', 'files') || [];
const filename = valid(values.filename) ? values.filename : '';
const model = filename ? files.find(file => file.path === filename) : null;
const prints = attr('druckhistorie', 'prints') || [];
const last = prints.find(job => ['complete','completed','cancelled','canceled','error','failed','aborted'].includes(job.result) && job.file) || null;
const lastModel = last ? files.find(file => file.path === last.file) : null;
const total = number(attr('schicht','total_layers'));
const layer = number(get('schicht'));
const errors = attr('druckermeldungen','errors') || [];
const message = values.current_print_message || values.printer_message;
const reason = ['paused','error'].includes(status)
? errors.find(item => item?.text?.en || item?.message)
: null;
const heads = [0,1,2,3].map(i => {
const spool = filaments.find(slot => slot.index === i);
const state = !known ? 'unknown' : active === i ? 'active' : toolStates[i] === 'parked' ? 'parked' : 'unknown';
const loaded = known && typeof spool?.loaded === 'boolean' ? spool.loaded : null;
const color = loaded && /^#[0-9a-f]{6}$/i.test(spool.color || '') ? spool.color : '#717780';
return { index:i, tool:`T${i}`, state, loaded, color,
material: loaded ? [spool.type, spool.sub_type].filter(valid).join(' ') : '',
current: number(get(`duse_${i+1}_temperatur`)), target: number(get(`duse_${i+1}_solltemperatur`,'number')) };
});
const labels = { standby:'Ready', ready:'Ready', printing:'Printing', paused:'Paused', complete:'Complete', cancelled:'Cancelled', error:'Error' };
const tone = !known ? 'neutral' : ({printing:'hot',paused:'warn',error:'error',complete:'ok',standby:'ok',ready:'ok'})[status] || 'neutral';
return {
online,known,controllable:known && get('druckerwerte') === 'ready',running,status,active,filename,model,last,lastModel,heads,tone,
label: !online ? 'Offline' : labels[status] || 'Status unknown',
progress: number(get('fortschritt')), layer: layer > 0 ? layer : null,
layers: total > 0 ? total : number(model?.layers),
elapsed: number(values.print_duration), remaining: number(get('restzeit')), eta: get('fertig_um'),
reason: reason?.text?.en || reason?.message || (valid(message) && !/^printer is ready[.!]?$/i.test(message) ? message : ''),
fan: number(get('bauteillufter','number')), speed: number(get('geschwindigkeit','number')),
bed: {current:number(get('betttemperatur')),target:number(get('bett_solltemperatur','number'))}
};
]]]
triggers_update: all
show_icon: false
show_name: false
show_state: false
tap_action:
action: none
hold_action:
action: none
double_tap_action:
action: none
styles:
card:
- background: var(--ha-card-background, var(--card-background-color))
- border-radius: 14px
- padding: 14px
- box-shadow: none
- border: 1px solid var(--divider-color)
- min-width: '0'
grid:
- grid-template-areas: '"content"'
- grid-template-columns: minmax(0, 1fr)
- grid-template-rows: auto
custom_fields:
content:
- width: 100%
- min-width: '0'
- white-space: normal
- text-align: left
- pointer-events: none