.storage/lovelace.sparkx_i7

This commit is contained in:
Home Assistant Version Control
2026-10-09 22:40:56 +00:00
parent 1a827a617b
commit 1f5d02c600
+10 -36
View File
@@ -1042,43 +1042,17 @@
}
},
{
"preset": "spoolman",
"title": "Filament",
"group_by": "material",
"group_sort_by": "name",
"group_sort_direction": "asc",
"group_order": [],
"group_icon": "mdi:printer-3d-nozzle",
"group_title_actions": {},
"group_title_icons": {},
"group_title_colors": {},
"max_weight": 1000,
"hide_archived": true,
"sort_by": "remaining_weight",
"sort_direction": "asc",
"bar_direction": "horizontal",
"name_position": "bottom",
"show_name": true,
"show_group_title": true,
"value_position": "center",
"use_filament_color": true,
"custom_attribute_entities": [],
"custom_items": [],
"custom_max_value": 1000,
"custom_unit": "g",
"custom_label_id": "",
"tap_action": {
"action": "more-info"
"type": "custom:auto-entities",
"card": {
"type": "grid",
"columns": 4,
"square": false,
"title": "Filament"
},
"double_tap_action": {
"action": "none"
},
"hold_action": {
"action": "none"
},
"spool_actions": {},
"type": "custom:filament-card",
"spool_location": "CFS Lite"
"card_param": "cards",
"filter": {
"template": "{% set ns = namespace(cards=[]) %}\n{% for s in states.sensor %}\n {% if s.entity_id.startswith('sensor.spoolman_spool_') %}\n {% set loc = (s.attributes.location | default('')) | lower %}\n {% if 'cfs lite' in loc %}\n {% set hex = s.attributes.filament_color_hex | default('44739e') %}\n {% set hex_clean = hex if hex.startswith('#') else '#' ~ hex %}\n {% set remain = (s.attributes.remaining_weight | default(s.state) | float(0)) | round(1) %}\n {% set total = (s.attributes.initial_weight | default(1000) | float(1000)) %}\n {% set raw_pct = ((remain / total) * 100) | round(1) %}\n {% set pct = 0 if raw_pct < 0 else (100 if raw_pct > 100 else raw_pct) %}\n {% set border = '#d0d0d0' if hex_clean | lower in ['#ffffff', '#fff'] else 'transparent' %}\n\n {% set card = {\n \"type\": \"custom:button-card\",\n \"entity\": s.entity_id,\n \"show_icon\": false,\n \"show_state\": false,\n \"show_name\": false,\n \"custom_fields\": {\n \"tube\": \"<div class='tube-bg'><div class='tube-fill' style='height: \" ~ pct ~ \"%; background-color: \" ~ hex_clean ~ \";'></div><div class='tube-text'>\" ~ remain ~ \"g</div></div>\"\n },\n \"styles\": {\n \"card\": [\n {\"background\": \"transparent\"},\n {\"box-shadow\": \"none\"},\n {\"border\": \"none\"},\n {\"padding\": \"8px 2px\"},\n {\"display\": \"flex\"},\n {\"flex-direction\": \"column\"},\n {\"align-items\": \"center\"}\n ],\n \"custom_fields\": {\n \"tube\": [\n {\"width\": \"100%\"},\n {\"display\": \"flex\"},\n {\"justify-content\": \"center\"}\n ]\n }\n },\n \"extra_styles\": \"\n .tube-bg {\n position: relative;\n width: 60px;\n height: 180px;\n background-color: #dedede;\n border-radius: 20px;\n overflow: hidden;\n border: 1px solid \" ~ border ~ \";\n display: flex;\n flex-direction: column;\n justify-content: flex-end;\n }\n .tube-fill {\n width: 100%;\n border-radius: 0 0 19px 19px;\n }\n .tube-text {\n position: absolute;\n top: 48%;\n left: 50%;\n transform: translate(-50%, -50%);\n font-size: 13px;\n font-weight: 800;\n color: #111111;\n pointer-events: none;\n z-index: 2;\n white-space: nowrap;\n }\n \",\n \"tap_action\": {\n \"action\": \"more-info\"\n }\n } %}\n {% set ns.cards = ns.cards + [card] %}\n {% endif %}\n {% endif %}\n{% endfor %}\n{{ ns.cards }}"
}
}
]
},