This commit is contained in:
Home Assistant Version Control
2026-10-15 18:53:39 +00:00
parent 9ad5da69d0
commit 9d2c446156
3 changed files with 1442 additions and 4 deletions
File diff suppressed because it is too large Load Diff
+1
View File
@@ -4674,3 +4674,4 @@
{"timestamp": "2026-10-15T18:51:41.262166+00:00", "tool_name": "ha_get_state", "parameters": {"entity_id": ["sensor.sparkx_i7_active_filament_slot", "input_text.sparkx_i7_print_spool_latch"], "fields": ["state"], "attribute_keys": null}, "execution_time_ms": 4.412651062011719, "success": true, "error_message": null, "response_size_bytes": 529, "user_context": null}
{"timestamp": "2026-10-15T18:51:41.269254+00:00", "tool_name": "ha_config_get_dashboard", "parameters": {"url_path": "sparkx-i7", "list_only": false, "force_reload": false, "entity_id": null, "card_type": null, "heading": null, "include_config": false, "include_screenshot": false, "view_path": null, "query": "sparkx_i7_spoolman_length_checkpoint", "describe": false}, "execution_time_ms": 12.49551773071289, "success": true, "error_message": null, "response_size_bytes": 735, "user_context": null}
{"timestamp": "2026-10-15T18:51:56.969383+00:00", "tool_name": "ha_eval_template", "parameters": {"template": "{% set gcm = states('input_number.sparkx_i7_filament_g_cm') | float(0.0298) %}{% set cur = states('sensor.sparkx_i7_used_material_length') | float(0) %}{% set ck = states('input_number.sparkx_i7_spoolman_length_checkpoint') | float(0) %}{% set act = states('sensor.sparkx_i7_active_filament_slot') %}{% set st = states('sensor.sparkx_i7_print_status') %}state={{ st }} active={{ act }} cur={{ cur }} ck={{ ck }} gcm={{ gcm }}\n{% for n in ['1','2','3','4'] %}{% set booked = states('input_number.sparkx_i7_slot_' ~ n ~ '_grams') | float(0) %}{% set live = booked + ((([cur - ck, 0] | max) * gcm) if act == 'box_1_slot_' ~ n else 0) %}Slot {{ n }}: • This print so far: {{ live | round(1) }} g (booked {{ booked | round(1) }}, live-part {{ (live - booked) | round(1) }})\n{% endfor %}", "condition": null, "variables": null, "strict": false, "timeout": 3, "report_errors": true}, "execution_time_ms": 15.637636184692383, "success": true, "error_message": null, "response_size_bytes": 1598, "user_context": null}
{"timestamp": "2026-10-15T18:53:39.341295+00:00", "tool_name": "ha_config_set_dashboard", "parameters": {"url_path": "sparkx-i7", "config": null, "python_transform": "for n in ['1','2','3','4']: b = config['views'][2]['sections'][0]['cards'][int(n)+1]; old = \"{% if states('sensor.sparkx_i7_print_status') in ['printing', 'paused'] %}• This print so far: {{ (states('input_number.sparkx_i7_slot_\" + n + \"_grams') | float(0)) | round(1) }} g{% else %}• Last print: {{ (states('input_number.sparkx_i7_slot_\" + n + \"_grams') | float(0)) | round(1) }} g{% endif %}\"; new = \"{% if states('sensor.sparkx_i7_print_status') in ['printing', 'paused'] %}{% set gcm = states('input_number.sparkx_i7_filament_g_cm') | float(0.0298) %}{% set cur = states('sensor.sparkx_i7_used_material_length') | float(0) %}{% set ck = states('input_number.sparkx_i7_spoolman_length_checkpoint') | float(0) %}{% set booked = states('input_number.sparkx_i7_slot_\" + n + \"_grams') | float(0) %}{% set live = booked + ((([cur - ck, 0] | max) * gcm) if states('sensor.sparkx_i7_active_filament_slot') == 'box_1_slot_\" + n + \"' else 0) %}• This print so far: {{ live | round(1) }} g{% else %}• Last print: {{ (states('input_number.sparkx_i7_slot_\" + n + \"_grams') | float(0)) | round(1) }} g{% endif %}\"; b['secondary'] = b['secondary'].replace(old, new)", "config_hash": "4b14c852ae9f72b1", "title": null, "icon": null, "require_admin": null, "show_in_sidebar": null, "MandatoryBPS": true, "BestPracticeKey": null, "return_screenshot": false, "view_path": null, "patch": null}, "execution_time_ms": 6835.304021835327, "success": true, "error_message": null, "response_size_bytes": 33241, "user_context": null}
+4 -4
View File
@@ -856,7 +856,7 @@
"name": "Slot 1",
"picture": "{% set c = states('sensor.sparkx_i7_cfs_box_1_slot_1_color') | replace('#','') | lower %}{% set svg = '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"96\" height=\"96\"><rect width=\"96\" height=\"96\" rx=\"20\" fill=\"#' ~ c ~ '\" stroke=\"rgba(127,127,127,0.6)\" stroke-width=\"4\"/></svg>' %}{{ 'data:image/svg+xml;base64,' ~ svg | base64_encode if c | length == 6 else '' }}",
"primary": "{{ states('sensor.sparkx_i7_slot_1_color_name') }} (#{{ states('sensor.sparkx_i7_cfs_box_1_slot_1_color') | replace('#', '') | upper }})",
"secondary": "{% set color = states('sensor.sparkx_i7_cfs_box_1_slot_1_color') | replace('#', '') | lower %}{% set ns = namespace(id='') %}{% for e in integration_entities('spoolman') %}{% if e.endswith('_color_hex') and (state_attr(e[:-10], 'location') | default('', true) | lower) == 'cfs lite 1' %}{% set b = e[:-10] %}{% if (states(b) | float(0)) > 0 and ns.id == '' %}{% set ns.id = states(b ~ '_id') %}{% endif %}{% endif %}{% endfor %}{% if ns.id %}• Spool {{ ns.id }} · {{ states('sensor.spoolman_spool_' ~ ns.id ~ '_vendor') | default('?', true) }} · {{ states('sensor.spoolman_spool_' ~ ns.id ~ '_material') | default('?', true) }} · {{ (states('sensor.spoolman_spool_' ~ ns.id) | float(0)) | round(1) }} g left{% elif color in ['', 'unknown', 'unavailable'] %}• Slot color unavailable{% else %}• No spool with stock matches this color{% endif %}\n{% if states('sensor.sparkx_i7_print_status') in ['printing', 'paused'] %}• This print so far: {{ (states('input_number.sparkx_i7_slot_1_grams') | float(0)) | round(1) }} g{% else %}• Last print: {{ (states('input_number.sparkx_i7_slot_1_grams') | float(0)) | round(1) }} g{% endif %}",
"secondary": "{% set color = states('sensor.sparkx_i7_cfs_box_1_slot_1_color') | replace('#', '') | lower %}{% set ns = namespace(id='') %}{% for e in integration_entities('spoolman') %}{% if e.endswith('_color_hex') and (state_attr(e[:-10], 'location') | default('', true) | lower) == 'cfs lite 1' %}{% set b = e[:-10] %}{% if (states(b) | float(0)) > 0 and ns.id == '' %}{% set ns.id = states(b ~ '_id') %}{% endif %}{% endif %}{% endfor %}{% if ns.id %}• Spool {{ ns.id }} · {{ states('sensor.spoolman_spool_' ~ ns.id ~ '_vendor') | default('?', true) }} · {{ states('sensor.spoolman_spool_' ~ ns.id ~ '_material') | default('?', true) }} · {{ (states('sensor.spoolman_spool_' ~ ns.id) | float(0)) | round(1) }} g left{% elif color in ['', 'unknown', 'unavailable'] %}• Slot color unavailable{% else %}• No spool with stock matches this color{% endif %}\n{% if states('sensor.sparkx_i7_print_status') in ['printing', 'paused'] %}{% set gcm = states('input_number.sparkx_i7_filament_g_cm') | float(0.0298) %}{% set cur = states('sensor.sparkx_i7_used_material_length') | float(0) %}{% set ck = states('input_number.sparkx_i7_spoolman_length_checkpoint') | float(0) %}{% set booked = states('input_number.sparkx_i7_slot_1_grams') | float(0) %}{% set live = booked + ((([cur - ck, 0] | max) * gcm) if states('sensor.sparkx_i7_active_filament_slot') == 'box_1_slot_1' else 0) %}• This print so far: {{ live | round(1) }} g{% else %}• Last print: {{ (states('input_number.sparkx_i7_slot_1_grams') | float(0)) | round(1) }} g{% endif %}",
"type": "custom:mushroom-template-card"
},
{
@@ -870,7 +870,7 @@
"name": "Slot 2",
"picture": "{% set c = states('sensor.sparkx_i7_cfs_box_1_slot_2_color') | replace('#','') | lower %}{% set svg = '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"96\" height=\"96\"><rect width=\"96\" height=\"96\" rx=\"20\" fill=\"#' ~ c ~ '\" stroke=\"rgba(127,127,127,0.6)\" stroke-width=\"4\"/></svg>' %}{{ 'data:image/svg+xml;base64,' ~ svg | base64_encode if c | length == 6 else '' }}",
"primary": "{{ states('sensor.sparkx_i7_slot_2_color_name') }} (#{{ states('sensor.sparkx_i7_cfs_box_1_slot_2_color') | replace('#', '') | upper }})",
"secondary": "{% set color = states('sensor.sparkx_i7_cfs_box_1_slot_2_color') | replace('#', '') | lower %}{% set ns = namespace(id='') %}{% for e in integration_entities('spoolman') %}{% if e.endswith('_color_hex') and (state_attr(e[:-10], 'location') | default('', true) | lower) == 'cfs lite 2' %}{% set b = e[:-10] %}{% if (states(b) | float(0)) > 0 and ns.id == '' %}{% set ns.id = states(b ~ '_id') %}{% endif %}{% endif %}{% endfor %}{% if ns.id %}• Spool {{ ns.id }} · {{ states('sensor.spoolman_spool_' ~ ns.id ~ '_vendor') | default('?', true) }} · {{ states('sensor.spoolman_spool_' ~ ns.id ~ '_material') | default('?', true) }} · {{ (states('sensor.spoolman_spool_' ~ ns.id) | float(0)) | round(1) }} g left{% elif color in ['', 'unknown', 'unavailable'] %}• Slot color unavailable{% else %}• No spool with stock matches this color{% endif %}\n{% if states('sensor.sparkx_i7_print_status') in ['printing', 'paused'] %}• This print so far: {{ (states('input_number.sparkx_i7_slot_2_grams') | float(0)) | round(1) }} g{% else %}• Last print: {{ (states('input_number.sparkx_i7_slot_2_grams') | float(0)) | round(1) }} g{% endif %}",
"secondary": "{% set color = states('sensor.sparkx_i7_cfs_box_1_slot_2_color') | replace('#', '') | lower %}{% set ns = namespace(id='') %}{% for e in integration_entities('spoolman') %}{% if e.endswith('_color_hex') and (state_attr(e[:-10], 'location') | default('', true) | lower) == 'cfs lite 2' %}{% set b = e[:-10] %}{% if (states(b) | float(0)) > 0 and ns.id == '' %}{% set ns.id = states(b ~ '_id') %}{% endif %}{% endif %}{% endfor %}{% if ns.id %}• Spool {{ ns.id }} · {{ states('sensor.spoolman_spool_' ~ ns.id ~ '_vendor') | default('?', true) }} · {{ states('sensor.spoolman_spool_' ~ ns.id ~ '_material') | default('?', true) }} · {{ (states('sensor.spoolman_spool_' ~ ns.id) | float(0)) | round(1) }} g left{% elif color in ['', 'unknown', 'unavailable'] %}• Slot color unavailable{% else %}• No spool with stock matches this color{% endif %}\n{% if states('sensor.sparkx_i7_print_status') in ['printing', 'paused'] %}{% set gcm = states('input_number.sparkx_i7_filament_g_cm') | float(0.0298) %}{% set cur = states('sensor.sparkx_i7_used_material_length') | float(0) %}{% set ck = states('input_number.sparkx_i7_spoolman_length_checkpoint') | float(0) %}{% set booked = states('input_number.sparkx_i7_slot_2_grams') | float(0) %}{% set live = booked + ((([cur - ck, 0] | max) * gcm) if states('sensor.sparkx_i7_active_filament_slot') == 'box_1_slot_2' else 0) %}• This print so far: {{ live | round(1) }} g{% else %}• Last print: {{ (states('input_number.sparkx_i7_slot_2_grams') | float(0)) | round(1) }} g{% endif %}",
"type": "custom:mushroom-template-card"
},
{
@@ -884,7 +884,7 @@
"name": "Slot 3",
"picture": "{% set c = states('sensor.sparkx_i7_cfs_box_1_slot_3_color') | replace('#','') | lower %}{% set svg = '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"96\" height=\"96\"><rect width=\"96\" height=\"96\" rx=\"20\" fill=\"#' ~ c ~ '\" stroke=\"rgba(127,127,127,0.6)\" stroke-width=\"4\"/></svg>' %}{{ 'data:image/svg+xml;base64,' ~ svg | base64_encode if c | length == 6 else '' }}",
"primary": "{{ states('sensor.sparkx_i7_slot_3_color_name') }} (#{{ states('sensor.sparkx_i7_cfs_box_1_slot_3_color') | replace('#', '') | upper }})",
"secondary": "{% set color = states('sensor.sparkx_i7_cfs_box_1_slot_3_color') | replace('#', '') | lower %}{% set ns = namespace(id='') %}{% for e in integration_entities('spoolman') %}{% if e.endswith('_color_hex') and (state_attr(e[:-10], 'location') | default('', true) | lower) == 'cfs lite 3' %}{% set b = e[:-10] %}{% if (states(b) | float(0)) > 0 and ns.id == '' %}{% set ns.id = states(b ~ '_id') %}{% endif %}{% endif %}{% endfor %}{% if ns.id %}• Spool {{ ns.id }} · {{ states('sensor.spoolman_spool_' ~ ns.id ~ '_vendor') | default('?', true) }} · {{ states('sensor.spoolman_spool_' ~ ns.id ~ '_material') | default('?', true) }} · {{ (states('sensor.spoolman_spool_' ~ ns.id) | float(0)) | round(1) }} g left{% elif color in ['', 'unknown', 'unavailable'] %}• Slot color unavailable{% else %}• No spool with stock matches this color{% endif %}\n{% if states('sensor.sparkx_i7_print_status') in ['printing', 'paused'] %}• This print so far: {{ (states('input_number.sparkx_i7_slot_3_grams') | float(0)) | round(1) }} g{% else %}• Last print: {{ (states('input_number.sparkx_i7_slot_3_grams') | float(0)) | round(1) }} g{% endif %}",
"secondary": "{% set color = states('sensor.sparkx_i7_cfs_box_1_slot_3_color') | replace('#', '') | lower %}{% set ns = namespace(id='') %}{% for e in integration_entities('spoolman') %}{% if e.endswith('_color_hex') and (state_attr(e[:-10], 'location') | default('', true) | lower) == 'cfs lite 3' %}{% set b = e[:-10] %}{% if (states(b) | float(0)) > 0 and ns.id == '' %}{% set ns.id = states(b ~ '_id') %}{% endif %}{% endif %}{% endfor %}{% if ns.id %}• Spool {{ ns.id }} · {{ states('sensor.spoolman_spool_' ~ ns.id ~ '_vendor') | default('?', true) }} · {{ states('sensor.spoolman_spool_' ~ ns.id ~ '_material') | default('?', true) }} · {{ (states('sensor.spoolman_spool_' ~ ns.id) | float(0)) | round(1) }} g left{% elif color in ['', 'unknown', 'unavailable'] %}• Slot color unavailable{% else %}• No spool with stock matches this color{% endif %}\n{% if states('sensor.sparkx_i7_print_status') in ['printing', 'paused'] %}{% set gcm = states('input_number.sparkx_i7_filament_g_cm') | float(0.0298) %}{% set cur = states('sensor.sparkx_i7_used_material_length') | float(0) %}{% set ck = states('input_number.sparkx_i7_spoolman_length_checkpoint') | float(0) %}{% set booked = states('input_number.sparkx_i7_slot_3_grams') | float(0) %}{% set live = booked + ((([cur - ck, 0] | max) * gcm) if states('sensor.sparkx_i7_active_filament_slot') == 'box_1_slot_3' else 0) %}• This print so far: {{ live | round(1) }} g{% else %}• Last print: {{ (states('input_number.sparkx_i7_slot_3_grams') | float(0)) | round(1) }} g{% endif %}",
"type": "custom:mushroom-template-card"
},
{
@@ -898,7 +898,7 @@
"name": "Slot 4",
"picture": "{% set c = states('sensor.sparkx_i7_cfs_box_1_slot_4_color') | replace('#','') | lower %}{% set svg = '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"96\" height=\"96\"><rect width=\"96\" height=\"96\" rx=\"20\" fill=\"#' ~ c ~ '\" stroke=\"rgba(127,127,127,0.6)\" stroke-width=\"4\"/></svg>' %}{{ 'data:image/svg+xml;base64,' ~ svg | base64_encode if c | length == 6 else '' }}",
"primary": "{{ states('sensor.sparkx_i7_slot_4_color_name') }} (#{{ states('sensor.sparkx_i7_cfs_box_1_slot_4_color') | replace('#', '') | upper }})",
"secondary": "{% set color = states('sensor.sparkx_i7_cfs_box_1_slot_4_color') | replace('#', '') | lower %}{% set ns = namespace(id='') %}{% for e in integration_entities('spoolman') %}{% if e.endswith('_color_hex') and (state_attr(e[:-10], 'location') | default('', true) | lower) == 'cfs lite 4' %}{% set b = e[:-10] %}{% if (states(b) | float(0)) > 0 and ns.id == '' %}{% set ns.id = states(b ~ '_id') %}{% endif %}{% endif %}{% endfor %}{% if ns.id %}• Spool {{ ns.id }} · {{ states('sensor.spoolman_spool_' ~ ns.id ~ '_vendor') | default('?', true) }} · {{ states('sensor.spoolman_spool_' ~ ns.id ~ '_material') | default('?', true) }} · {{ (states('sensor.spoolman_spool_' ~ ns.id) | float(0)) | round(1) }} g left{% elif color in ['', 'unknown', 'unavailable'] %}• Slot color unavailable{% else %}• No spool with stock matches this color{% endif %}\n{% if states('sensor.sparkx_i7_print_status') in ['printing', 'paused'] %}• This print so far: {{ (states('input_number.sparkx_i7_slot_4_grams') | float(0)) | round(1) }} g{% else %}• Last print: {{ (states('input_number.sparkx_i7_slot_4_grams') | float(0)) | round(1) }} g{% endif %}",
"secondary": "{% set color = states('sensor.sparkx_i7_cfs_box_1_slot_4_color') | replace('#', '') | lower %}{% set ns = namespace(id='') %}{% for e in integration_entities('spoolman') %}{% if e.endswith('_color_hex') and (state_attr(e[:-10], 'location') | default('', true) | lower) == 'cfs lite 4' %}{% set b = e[:-10] %}{% if (states(b) | float(0)) > 0 and ns.id == '' %}{% set ns.id = states(b ~ '_id') %}{% endif %}{% endif %}{% endfor %}{% if ns.id %}• Spool {{ ns.id }} · {{ states('sensor.spoolman_spool_' ~ ns.id ~ '_vendor') | default('?', true) }} · {{ states('sensor.spoolman_spool_' ~ ns.id ~ '_material') | default('?', true) }} · {{ (states('sensor.spoolman_spool_' ~ ns.id) | float(0)) | round(1) }} g left{% elif color in ['', 'unknown', 'unavailable'] %}• Slot color unavailable{% else %}• No spool with stock matches this color{% endif %}\n{% if states('sensor.sparkx_i7_print_status') in ['printing', 'paused'] %}{% set gcm = states('input_number.sparkx_i7_filament_g_cm') | float(0.0298) %}{% set cur = states('sensor.sparkx_i7_used_material_length') | float(0) %}{% set ck = states('input_number.sparkx_i7_spoolman_length_checkpoint') | float(0) %}{% set booked = states('input_number.sparkx_i7_slot_4_grams') | float(0) %}{% set live = booked + ((([cur - ck, 0] | max) * gcm) if states('sensor.sparkx_i7_active_filament_slot') == 'box_1_slot_4' else 0) %}• This print so far: {{ live | round(1) }} g{% else %}• Last print: {{ (states('input_number.sparkx_i7_slot_4_grams') | float(0)) | round(1) }} g{% endif %}",
"type": "custom:mushroom-template-card"
},
{