4 files
This commit is contained in:
@@ -0,0 +1,501 @@
|
|||||||
|
# ha_mcp_backup
|
||||||
|
schema_version: 1
|
||||||
|
domain: dashboard
|
||||||
|
entity_id: 3d-printer-cellphone
|
||||||
|
captured: '2026-10-16T20:21:43.818350+00:00'
|
||||||
|
tool: ha_config_set_dashboard
|
||||||
|
config:
|
||||||
|
views:
|
||||||
|
- sections:
|
||||||
|
- cards:
|
||||||
|
- card:
|
||||||
|
columns: 4
|
||||||
|
square: false
|
||||||
|
type: grid
|
||||||
|
card_param: cards
|
||||||
|
filter:
|
||||||
|
template: "{% set ns = namespace(cards=[]) %}{% set active_n = (states('sensor.sparkx_i7_active_filament_slot').split('_')[-1]\
|
||||||
|
\ | int(0)) if states('sensor.sparkx_i7_print_status') in ['printing',\
|
||||||
|
\ 'paused'] else 0 %}\n{% for n in [1, 2, 3, 4] %}\n {% set sp = namespace(ent='')\
|
||||||
|
\ %}\n {% for s in states.sensor %}\n {% if sp.ent == '' and s.entity_id.startswith('sensor.spoolman_spool_')\
|
||||||
|
\ %}\n {% set loc = (s.attributes.location | default('')) | lower\
|
||||||
|
\ %}\n {% if loc == ('cfs lite ' ~ n) %}\n {% set sp.ent =\
|
||||||
|
\ s.entity_id %}\n {% endif %}\n {% endif %}\n {% endfor %}\n\
|
||||||
|
\ {% set v = namespace(html='', label='Slot ' ~ n, border='transparent',\
|
||||||
|
\ wrap='', text='#111111', halo='rgba(255,255,255,0.95)') %}\n {% if\
|
||||||
|
\ sp.ent != '' %}\n {% set hex = state_attr(sp.ent, 'filament_color_hex')\
|
||||||
|
\ | default('44739e') %}\n {% set hex_clean = hex if hex.startswith('#')\
|
||||||
|
\ else '#' ~ hex %}\n {% set remain = (state_attr(sp.ent, 'remaining_weight')\
|
||||||
|
\ | default(states(sp.ent)) | float(0)) | round(1) %}\n {% set total\
|
||||||
|
\ = state_attr(sp.ent, 'filament_weight') | float(1000) %}\n {% set\
|
||||||
|
\ raw_pct = ((remain / total) * 100) | round(1) if total > 0 else 0 %}\n\
|
||||||
|
\ {% set pct = 0 if raw_pct < 0 else (100 if raw_pct > 100 else raw_pct)\
|
||||||
|
\ %}\n {% set rem_n = states(sp.ent) | float(-1) %}{% set tr = hex_clean[1:3]\
|
||||||
|
\ | int(0, 16) %}{% set tg = hex_clean[3:5] | int(0, 16) %}{% set tb =\
|
||||||
|
\ hex_clean[5:7] | int(0, 16) %}{% set lum = 0.2126 * tr + 0.7152 * tg\
|
||||||
|
\ + 0.0722 * tb %}{% set v.text = '#ffffff' if (pct >= 60 and lum <= 170)\
|
||||||
|
\ else '#111111' %}{% set v.halo = 'rgba(0,0,0,0.9)' if v.text == '#ffffff'\
|
||||||
|
\ else 'rgba(255,255,255,0.95)' %}\n {% set band = 2 if (rem_n >= 0\
|
||||||
|
\ and rem_n < 25) else (1 if (rem_n >= 0 and rem_n < 100) else 0) %}\n\
|
||||||
|
\ {% set v.wrap = ' warn-crit' if band == 2 else (' warn-low' if band\
|
||||||
|
\ == 1 else '') %}{% set v.wrap = v.wrap ~ ' active' if (n == active_n)\
|
||||||
|
\ else v.wrap %}\n {% set v.border = '#d0d0d0' if hex_clean | lower\
|
||||||
|
\ in ['#ffffff', '#fff'] else 'transparent' %}\n {% set v.html = \"\
|
||||||
|
<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 {% set v.label = 'Slot ' ~ n ~\
|
||||||
|
\ (' \u26A0' if band > 0 else '') %}\n {% else %}\n {% set v.html\
|
||||||
|
\ = \"<div class='tube-bg tube-empty'></div>\" %}\n {% set v.label\
|
||||||
|
\ = \"<span class='slot-warn'>Slot \" ~ n ~ \" \u2014 empty</span>\" %}\n\
|
||||||
|
\ {% endif %}\n {% set card = {\n \"type\": \"custom:button-card\"\
|
||||||
|
,\n \"entity\": sp.ent if sp.ent != '' else 'sensor.sparkx_i7_active_filament_slot',\n\
|
||||||
|
\ \"show_icon\": false,\n \"show_state\": false,\n \"show_name\"\
|
||||||
|
: false,\n \"custom_fields\": {\n \"tube\": \"<div class='tube-wrap\"\
|
||||||
|
\ ~ v.wrap ~ \"'>\" ~ v.html ~ \"<div class='slot-label'>\" ~ v.label\
|
||||||
|
\ ~ \"</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 {\"flex-direction\"\
|
||||||
|
: \"column\"},\n {\"align-items\": \"center\"}\n ]\n \
|
||||||
|
\ }\n },\n \"extra_styles\": \"\n .tube-wrap.active .tube-bg\
|
||||||
|
\ { box-shadow: 0 0 10px 2px var(--primary-color); } .tube-wrap.active\
|
||||||
|
\ .slot-label { color: var(--primary-color); font-weight: 800; } \
|
||||||
|
\ .tube-wrap {\n display: flex;\n flex-direction: column;\n\
|
||||||
|
\ align-items: center;\n width: 100%;\n }\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 \" ~ v.border ~\
|
||||||
|
\ \";\n display: flex;\n flex-direction: column;\n \
|
||||||
|
\ justify-content: flex-end;\n }\n .tube-empty {\n \
|
||||||
|
\ background: transparent;\n border: 2px dashed var(--error-color);\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: \" ~ v.text ~ \"; text-shadow: 0 0 3px \" ~ v.halo ~\
|
||||||
|
\ \", 0 0 6px \" ~ v.halo ~ \";\n pointer-events: none;\n \
|
||||||
|
\ z-index: 2;\n white-space: nowrap;\n }\n .slot-label\
|
||||||
|
\ {\n margin-top: 8px;\n font-size: 12px;\n font-weight:\
|
||||||
|
\ 700;\n letter-spacing: 0.3px;\n color: var(--secondary-text-color);\n\
|
||||||
|
\ }\n .slot-warn {\n color: var(--error-color);\n \
|
||||||
|
\ }\n .warn-low .tube-bg {\n background-color: #fff6df;\n\
|
||||||
|
\ outline: 2px solid var(--warning-color);\n }\n .warn-low\
|
||||||
|
\ .slot-label {\n color: var(--warning-color);\n }\n \
|
||||||
|
\ .warn-crit .tube-bg {\n background-color: #fdecea;\n outline:\
|
||||||
|
\ 2px solid var(--error-color);\n }\n .warn-crit .slot-label\
|
||||||
|
\ {\n color: var(--error-color);\n }\n \",\n \"tap_action\"\
|
||||||
|
: {\n \"action\": \"more-info\" if sp.ent != '' else \"none\"\n \
|
||||||
|
\ }\n } %}\n\n {% set ns.cards = ns.cards + [card] %}\n{% endfor %}\n\
|
||||||
|
{{ ns.cards }}\n"
|
||||||
|
type: custom:auto-entities
|
||||||
|
- type: horizontal-stack
|
||||||
|
grid_options:
|
||||||
|
columns: full
|
||||||
|
cards:
|
||||||
|
- type: custom:mushroom-template-card
|
||||||
|
entity: sensor.sparkx_i7_cfs_box_1_slot_1_color
|
||||||
|
name: ''
|
||||||
|
icon: none
|
||||||
|
primary: '{% 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) %}{{ live | round(1) }}g{% else %}{{ (states(''input_number.sparkx_i7_slot_1_grams'')
|
||||||
|
| float(0)) | round(1) }}g{% endif %}'
|
||||||
|
secondary: ''
|
||||||
|
card_mod:
|
||||||
|
style: 'ha-card { text-align: left; font-size: 11px; padding: 2px; }'
|
||||||
|
- type: custom:mushroom-template-card
|
||||||
|
entity: sensor.sparkx_i7_cfs_box_1_slot_2_color
|
||||||
|
name: ''
|
||||||
|
icon: none
|
||||||
|
primary: '{% 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) %}{{ live | round(1) }}g{% else %}{{ (states(''input_number.sparkx_i7_slot_2_grams'')
|
||||||
|
| float(0)) | round(1) }}g{% endif %}'
|
||||||
|
secondary: ''
|
||||||
|
card_mod:
|
||||||
|
style: 'ha-card { text-align: left; font-size: 11px; padding: 2px; }'
|
||||||
|
- type: custom:mushroom-template-card
|
||||||
|
entity: sensor.sparkx_i7_cfs_box_1_slot_3_color
|
||||||
|
name: ''
|
||||||
|
icon: none
|
||||||
|
primary: '{% 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) %}{{ live | round(1) }}g{% else %}{{ (states(''input_number.sparkx_i7_slot_3_grams'')
|
||||||
|
| float(0)) | round(1) }}g{% endif %}'
|
||||||
|
secondary: ''
|
||||||
|
card_mod:
|
||||||
|
style: 'ha-card { text-align: left; font-size: 11px; padding: 2px; }'
|
||||||
|
- type: custom:mushroom-template-card
|
||||||
|
entity: sensor.sparkx_i7_cfs_box_1_slot_4_color
|
||||||
|
name: ''
|
||||||
|
icon: none
|
||||||
|
primary: '{% 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) %}{{ live | round(1) }}g{% else %}{{ (states(''input_number.sparkx_i7_slot_4_grams'')
|
||||||
|
| float(0)) | round(1) }}g{% endif %}'
|
||||||
|
secondary: ''
|
||||||
|
card_mod:
|
||||||
|
style: 'ha-card { text-align: left; font-size: 11px; padding: 2px; }'
|
||||||
|
- entity: sensor.sparkx_i7_cfs_box_1_humidity
|
||||||
|
grid_options:
|
||||||
|
columns: 6
|
||||||
|
icon: mdi:water-percent
|
||||||
|
name: Humidity
|
||||||
|
type: tile
|
||||||
|
- entity: sensor.sparkx_i7_cfs_box_1_temperature
|
||||||
|
grid_options:
|
||||||
|
columns: 6
|
||||||
|
icon: mdi:thermometer
|
||||||
|
name: Temperature
|
||||||
|
type: tile
|
||||||
|
- cards:
|
||||||
|
- entity: sensor.sparkx_i7_active_filament_slot
|
||||||
|
grid_options:
|
||||||
|
columns: full
|
||||||
|
icon: mdi:magnet
|
||||||
|
icon_color: '{% set slot = states(''sensor.sparkx_i7_active_filament_slot'')
|
||||||
|
%}{% set c = states(''sensor.sparkx_i7_cfs_'' ~ (slot | lower | replace(''
|
||||||
|
'', ''_'')) ~ ''_color'') | replace(''#'', '''') | lower %}{% if c | length
|
||||||
|
== 6 %}#{{ c }}{% else %}var(--primary-color){% endif %}'
|
||||||
|
multiline_secondary: true
|
||||||
|
name: Next Deduction Match
|
||||||
|
primary: '{{ states(''sensor.sparkx_i7_active_filament_slot'') }}'
|
||||||
|
secondary: "{% set slot = states('sensor.sparkx_i7_active_filament_slot')\
|
||||||
|
\ %}\n{% set n = slot.split('_')[-1] %}\n{% set ce = 'sensor.sparkx_i7_cfs_'\
|
||||||
|
\ ~ (slot | lower | replace(' ', '_')) ~ '_color' %}\n{% set color = states(ce)\
|
||||||
|
\ | replace('#', '') | lower %}\n{% set ns = namespace(id='', rem=-1)\
|
||||||
|
\ %}\n{% for e in integration_entities('spoolman') %}\n{% if e.endswith('_color_hex')\
|
||||||
|
\ and (state_attr(e[:-10], 'location') | default('', true) | lower) ==\
|
||||||
|
\ ('cfs lite ' ~ n) and ns.id == '' %}\n{% set ns.id = states(e[:-10]\
|
||||||
|
\ ~ '_id') %}\n{% set ns.rem = states(e[:-10]) | float(-1) %}\n{% endif\
|
||||||
|
\ %}\n{% endfor %}\n{% if slot in ['', 'unknown', 'unavailable'] %}No\
|
||||||
|
\ slot latched\n{% elif ns.id == '' %}No spool assigned to CFS Lite {{\
|
||||||
|
\ n }}\n{% elif ns.rem < 0 %}Color #{{ color | upper }} \u2192 spool {{\
|
||||||
|
\ ns.id }} unreachable\n{% elif ns.rem == 0 %}Color #{{ color | upper\
|
||||||
|
\ }} \u2192 spool {{ ns.id }} is EMPTY\n{% else %}Color #{{ color | upper\
|
||||||
|
\ }} \u2192 spool {{ ns.id }} ({{ states('sensor.spoolman_spool_' ~ ns.id\
|
||||||
|
\ ~ '_filament_name') }} \xB7 {{ ns.rem | round(1) }} g left)\n{% endif\
|
||||||
|
\ %}\n"
|
||||||
|
type: custom:mushroom-template-card
|
||||||
|
grid_options:
|
||||||
|
columns: full
|
||||||
|
type: horizontal-stack
|
||||||
|
- heading: Last/Current Print Job
|
||||||
|
heading_style: title
|
||||||
|
icon: mdi:printer-3d
|
||||||
|
type: heading
|
||||||
|
- entity: sensor.sparkx_i7_used_material_length
|
||||||
|
grid_options:
|
||||||
|
columns: 6
|
||||||
|
rows: 1
|
||||||
|
icon: mdi:plus-minus
|
||||||
|
name: Used Material Total
|
||||||
|
type: tile
|
||||||
|
- entity: sensor.sparkx_moonraker_print_eta
|
||||||
|
features_position: bottom
|
||||||
|
grid_options:
|
||||||
|
columns: 6
|
||||||
|
rows: 1
|
||||||
|
name: Print ETA
|
||||||
|
type: tile
|
||||||
|
vertical: false
|
||||||
|
- entity: sensor.sparkx_i7_filament_weight_estimated
|
||||||
|
grid_options:
|
||||||
|
columns: 6
|
||||||
|
rows: auto
|
||||||
|
icon: "{% set st = states('sensor.sparkx_i7_print_status') %} {% if st in\
|
||||||
|
\ ['printing', 'paused'] %}\n mdi:printer-3d-nozzle\n{% else %}\n mdi:cash-multiple\n\
|
||||||
|
{% endif %}"
|
||||||
|
icon_color: "{% set st = states('sensor.sparkx_i7_print_status') %} {% if\
|
||||||
|
\ st in ['printing', 'paused'] %}\n blue\n{% else %}\n green\n{% endif\
|
||||||
|
\ %}"
|
||||||
|
multiline_secondary: true
|
||||||
|
primary: "{% set st = states('sensor.sparkx_i7_print_status') %}\n{% set w\
|
||||||
|
\ = states('sensor.sparkx_i7_filament_weight_estimated') %}\n{% if st in\
|
||||||
|
\ ['printing', 'paused'] %}\n {% if is_number(w) %}{{ w | float | round(1)\
|
||||||
|
\ }} g{% else %}weight unavailable{% endif %}\n{% else %}\n Last: {{ states('input_number.sparkx_i7_last_job_filament_weight')\
|
||||||
|
\ | float(0) | round(1) }} g\n{% endif %}\n"
|
||||||
|
secondary: "{% set st = states('sensor.sparkx_i7_print_status') %}\n{% set\
|
||||||
|
\ c = states('sensor.sparkx_i7_filament_cost') %}\n{% if st in ['printing',\
|
||||||
|
\ 'paused'] %}\n {% if is_number(c) %}{{ c | float | round(2) }} $ (live){%\
|
||||||
|
\ else %}cost unavailable{% endif %}\n{% else %}\n {{ states('input_number.sparkx_i7_last_job_cost')\
|
||||||
|
\ | float(0) | round(2) }} $ (last job)\n{% endif %}\n"
|
||||||
|
type: custom:mushroom-template-card
|
||||||
|
- entity: sensor.sparkx_i7_expected_material_length
|
||||||
|
grid_options:
|
||||||
|
columns: 6
|
||||||
|
rows: auto
|
||||||
|
icon: mdi:scale-balance
|
||||||
|
icon_color: '{% set gcm = states(''input_number.sparkx_i7_filament_g_cm'')
|
||||||
|
| float(0.0298) %}
|
||||||
|
|
||||||
|
{% set lencm = states(''sensor.sparkx_i7_expected_material_length'') | float(0)
|
||||||
|
%}
|
||||||
|
|
||||||
|
{% set wgt = states(''sensor.sparkx_i7_expected_material_weight'') | float(0)
|
||||||
|
%}
|
||||||
|
|
||||||
|
{% set job_g = ((wgt if wgt > 0 else lencm * gcm) | round(1)) %}
|
||||||
|
|
||||||
|
{% set used_g = ((states(''sensor.sparkx_i7_used_material_length'') | float(0))
|
||||||
|
* gcm) | round(1) %}
|
||||||
|
|
||||||
|
{% set rem_g = ([job_g - used_g, 0] | max) | round(1) %}
|
||||||
|
|
||||||
|
{% set gc = namespace(list=[]) %}
|
||||||
|
|
||||||
|
{% for p in (state_attr(''sensor.sparkx_i7_expected_material_length'',''color'')
|
||||||
|
| default('''', true) | string).split('';'') %}
|
||||||
|
|
||||||
|
{% set q = p | replace(''#'','''') | lower | trim %}
|
||||||
|
|
||||||
|
{% if q not in ['''',''none'',''unknown'',''unavailable''] %}{% set gc.list
|
||||||
|
= gc.list + [q] %}{% endif %}
|
||||||
|
|
||||||
|
{% endfor %}
|
||||||
|
|
||||||
|
{% set single = (gc.list | length) == 1 %}
|
||||||
|
|
||||||
|
{% set aslot = (states(''sensor.sparkx_i7_active_filament_slot'') | default('''',
|
||||||
|
true) | string).split(''_'')[-1] %}
|
||||||
|
|
||||||
|
{% set aslot = aslot if aslot in [''1'',''2'',''3'',''4''] else '''' %}
|
||||||
|
|
||||||
|
{% set s = namespace(short=false, ok=false, matched=0, active=false) %}
|
||||||
|
|
||||||
|
{% for n in [''1'',''2'',''3'',''4''] %}
|
||||||
|
|
||||||
|
{% set sp = namespace(id='''', rem=-1) %}
|
||||||
|
|
||||||
|
{% for e in integration_entities(''spoolman'') if e.endswith(''_color_hex'')
|
||||||
|
%}
|
||||||
|
|
||||||
|
{% if sp.id == '''' and (state_attr(e[:-10],''location'') | default('''',
|
||||||
|
true) | lower) == (''cfs lite '' ~ n) %}
|
||||||
|
|
||||||
|
{% set sp.id = e[:-10] %}
|
||||||
|
|
||||||
|
{% set sp.rem = states(e[:-10]) | float(-1) %}
|
||||||
|
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% endfor %}
|
||||||
|
|
||||||
|
{% if sp.id != '''' and sp.rem >= 0 %}
|
||||||
|
|
||||||
|
{% set s.matched = s.matched + 1 %}
|
||||||
|
|
||||||
|
{% if single %}
|
||||||
|
|
||||||
|
{% if n == aslot %}
|
||||||
|
|
||||||
|
{% set s.active = true %}
|
||||||
|
|
||||||
|
{% if sp.rem < job_g %}{% set s.short = true %}{% else %}{% set s.ok = true
|
||||||
|
%}{% endif %}
|
||||||
|
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% else %}
|
||||||
|
|
||||||
|
{% if sp.rem < job_g %}{% set s.short = true %}{% else %}{% set s.ok = true
|
||||||
|
%}{% endif %}
|
||||||
|
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% endfor %}
|
||||||
|
|
||||||
|
{% set active = (states(''sensor.sparkx_i7_print_status'') | default('''',
|
||||||
|
true)) in [''printing'',''paused''] %}
|
||||||
|
|
||||||
|
{% set v = namespace(state=''unknown'', label=''check unavailable'') %}
|
||||||
|
|
||||||
|
{% if not active %}
|
||||||
|
|
||||||
|
{% set v.state = ''idle'' %}
|
||||||
|
|
||||||
|
{% set v.label = ''no active print'' %}
|
||||||
|
|
||||||
|
{% elif job_g <= 0 %}
|
||||||
|
|
||||||
|
{% set v.state = ''none'' %}
|
||||||
|
|
||||||
|
{% set v.label = ''no slicer estimate yet'' %}
|
||||||
|
|
||||||
|
{% elif s.short %}
|
||||||
|
|
||||||
|
{% set v.state = ''short'' %}
|
||||||
|
|
||||||
|
{% set v.label = ''NOT ENOUGH'' %}
|
||||||
|
|
||||||
|
{% elif s.ok %}
|
||||||
|
|
||||||
|
{% set v.state = ''ok'' %}
|
||||||
|
|
||||||
|
{% set v.label = ''enough'' %}
|
||||||
|
|
||||||
|
{% elif single and aslot == '''' %}
|
||||||
|
|
||||||
|
{% set v.state = ''unknown'' %}
|
||||||
|
|
||||||
|
{% set v.label = ''no active CFS slot'' %}
|
||||||
|
|
||||||
|
{% elif single and not s.active %}
|
||||||
|
|
||||||
|
{% set v.state = ''unknown'' %}
|
||||||
|
|
||||||
|
{% set v.label = ''active slot has no spool'' %}
|
||||||
|
|
||||||
|
{% elif s.matched == 0 %}
|
||||||
|
|
||||||
|
{% set v.state = ''unknown'' %}
|
||||||
|
|
||||||
|
{% set v.label = ''no spool loaded'' %}
|
||||||
|
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if v.state == ''ok'' %}green{% elif v.state == ''short'' %}red{% elif
|
||||||
|
v.state in [''none'',''idle''] %}grey{% else %}orange{% endif %}'
|
||||||
|
multiline_secondary: true
|
||||||
|
name: Filament Sufficiency
|
||||||
|
primary: "{% set gcm = states('input_number.sparkx_i7_filament_g_cm') | float(0.0298)\
|
||||||
|
\ %}\n{% set lencm = states('sensor.sparkx_i7_expected_material_length')\
|
||||||
|
\ | float(0) %}\n{% set wgt = states('sensor.sparkx_i7_expected_material_weight')\
|
||||||
|
\ | float(0) %}\n{% set job_g = ((wgt if wgt > 0 else lencm * gcm) | round(1))\
|
||||||
|
\ %}\n{% set used_g = ((states('sensor.sparkx_i7_used_material_length')\
|
||||||
|
\ | float(0)) * gcm) | round(1) %}\n{% set rem_g = ([job_g - used_g, 0]\
|
||||||
|
\ | max) | round(1) %}\n{% set gc = namespace(list=[]) %}\n{% for p in (state_attr('sensor.sparkx_i7_expected_material_length','color')\
|
||||||
|
\ | default('', true) | string).split(';') %}\n{% set q = p | replace('#','')\
|
||||||
|
\ | lower | trim %}\n{% if q not in ['','none','unknown','unavailable']\
|
||||||
|
\ %}{% set gc.list = gc.list + [q] %}{% endif %}\n{% endfor %}\n{% set single\
|
||||||
|
\ = (gc.list | length) == 1 %}\n{% set aslot = (states('sensor.sparkx_i7_active_filament_slot')\
|
||||||
|
\ | default('', true) | string).split('_')[-1] %}\n{% set aslot = aslot\
|
||||||
|
\ if aslot in ['1','2','3','4'] else '' %}\n{% set s = namespace(short=false,\
|
||||||
|
\ ok=false, matched=0, active=false) %}\n{% for n in ['1','2','3','4'] %}\n\
|
||||||
|
{% set sp = namespace(id='', rem=-1) %}\n{% for e in integration_entities('spoolman')\
|
||||||
|
\ if e.endswith('_color_hex') %}\n{% if sp.id == '' and (state_attr(e[:-10],'location')\
|
||||||
|
\ | default('', true) | lower) == ('cfs lite ' ~ n) %}\n{% set sp.id = e[:-10]\
|
||||||
|
\ %}\n{% set sp.rem = states(e[:-10]) | float(-1) %}\n{% endif %}\n{% endfor\
|
||||||
|
\ %}\n{% if sp.id != '' and sp.rem >= 0 %}\n{% set s.matched = s.matched\
|
||||||
|
\ + 1 %}\n{% if single %}\n{% if n == aslot %}\n{% set s.active = true %}\n\
|
||||||
|
{% if sp.rem < job_g %}{% set s.short = true %}{% else %}{% set s.ok = true\
|
||||||
|
\ %}{% endif %}\n{% endif %}\n{% else %}\n{% if sp.rem < job_g %}{% set\
|
||||||
|
\ s.short = true %}{% else %}{% set s.ok = true %}{% endif %}\n{% endif\
|
||||||
|
\ %}\n{% endif %}\n{% endfor %}\n{% set active = (states('sensor.sparkx_i7_print_status')\
|
||||||
|
\ | default('', true)) in ['printing','paused'] %}\n{% set v = namespace(state='unknown',\
|
||||||
|
\ label='check unavailable') %}\n{% if not active %}\n{% set v.state = 'idle'\
|
||||||
|
\ %}\n{% set v.label = 'no active print' %}\n{% elif job_g <= 0 %}\n{% set\
|
||||||
|
\ v.state = 'none' %}\n{% set v.label = 'no slicer estimate yet' %}\n{%\
|
||||||
|
\ elif s.short %}\n{% set v.state = 'short' %}\n{% set v.label = 'NOT ENOUGH'\
|
||||||
|
\ %}\n{% elif s.ok %}\n{% set v.state = 'ok' %}\n{% set v.label = 'enough'\
|
||||||
|
\ %}\n{% elif single and aslot == '' %}\n{% set v.state = 'unknown' %}\n\
|
||||||
|
{% set v.label = 'no active CFS slot' %}\n{% elif single and not s.active\
|
||||||
|
\ %}\n{% set v.state = 'unknown' %}\n{% set v.label = 'active slot has no\
|
||||||
|
\ spool' %}\n{% elif s.matched == 0 %}\n{% set v.state = 'unknown' %}\n\
|
||||||
|
{% set v.label = 'no spool loaded' %}\n{% endif %}\n{% if v.state == 'idle'\
|
||||||
|
\ %}no active print{% else %}{{ job_g }} g needed \xB7 {{ used_g }} g used{%\
|
||||||
|
\ endif %}"
|
||||||
|
secondary: "{% set gcm = states('input_number.sparkx_i7_filament_g_cm') |\
|
||||||
|
\ float(0.0298) %}\n{% set lencm = states('sensor.sparkx_i7_expected_material_length')\
|
||||||
|
\ | float(0) %}\n{% set wgt = states('sensor.sparkx_i7_expected_material_weight')\
|
||||||
|
\ | float(0) %}\n{% set job_g = ((wgt if wgt > 0 else lencm * gcm) | round(1))\
|
||||||
|
\ %}\n{% set used_g = ((states('sensor.sparkx_i7_used_material_length')\
|
||||||
|
\ | float(0)) * gcm) | round(1) %}\n{% set rem_g = ([job_g - used_g, 0]\
|
||||||
|
\ | max) | round(1) %}\n{% set gc = namespace(list=[]) %}\n{% for p in (state_attr('sensor.sparkx_i7_expected_material_length','color')\
|
||||||
|
\ | default('', true) | string).split(';') %}\n{% set q = p | replace('#','')\
|
||||||
|
\ | lower | trim %}\n{% if q not in ['','none','unknown','unavailable']\
|
||||||
|
\ %}{% set gc.list = gc.list + [q] %}{% endif %}\n{% endfor %}\n{% set single\
|
||||||
|
\ = (gc.list | length) == 1 %}\n{% set aslot = (states('sensor.sparkx_i7_active_filament_slot')\
|
||||||
|
\ | default('', true) | string).split('_')[-1] %}\n{% set aslot = aslot\
|
||||||
|
\ if aslot in ['1','2','3','4'] else '' %}\n{% set s = namespace(short=false,\
|
||||||
|
\ ok=false, matched=0, active=false) %}\n{% for n in ['1','2','3','4'] %}\n\
|
||||||
|
{% set sp = namespace(id='', rem=-1) %}\n{% for e in integration_entities('spoolman')\
|
||||||
|
\ if e.endswith('_color_hex') %}\n{% if sp.id == '' and (state_attr(e[:-10],'location')\
|
||||||
|
\ | default('', true) | lower) == ('cfs lite ' ~ n) %}\n{% set sp.id = e[:-10]\
|
||||||
|
\ %}\n{% set sp.rem = states(e[:-10]) | float(-1) %}\n{% endif %}\n{% endfor\
|
||||||
|
\ %}\n{% if sp.id != '' and sp.rem >= 0 %}\n{% set s.matched = s.matched\
|
||||||
|
\ + 1 %}\n{% if single %}\n{% if n == aslot %}\n{% set s.active = true %}\n\
|
||||||
|
{% if sp.rem < job_g %}{% set s.short = true %}{% else %}{% set s.ok = true\
|
||||||
|
\ %}{% endif %}\n{% endif %}\n{% else %}\n{% if sp.rem < job_g %}{% set\
|
||||||
|
\ s.short = true %}{% else %}{% set s.ok = true %}{% endif %}\n{% endif\
|
||||||
|
\ %}\n{% endif %}\n{% endfor %}\n{% set active = (states('sensor.sparkx_i7_print_status')\
|
||||||
|
\ | default('', true)) in ['printing','paused'] %}\n{% set v = namespace(state='unknown',\
|
||||||
|
\ label='check unavailable') %}\n{% if not active %}\n{% set v.state = 'idle'\
|
||||||
|
\ %}\n{% set v.label = 'no active print' %}\n{% elif job_g <= 0 %}\n{% set\
|
||||||
|
\ v.state = 'none' %}\n{% set v.label = 'no slicer estimate yet' %}\n{%\
|
||||||
|
\ elif s.short %}\n{% set v.state = 'short' %}\n{% set v.label = 'NOT ENOUGH'\
|
||||||
|
\ %}\n{% elif s.ok %}\n{% set v.state = 'ok' %}\n{% set v.label = 'enough'\
|
||||||
|
\ %}\n{% elif single and aslot == '' %}\n{% set v.state = 'unknown' %}\n\
|
||||||
|
{% set v.label = 'no active CFS slot' %}\n{% elif single and not s.active\
|
||||||
|
\ %}\n{% set v.state = 'unknown' %}\n{% set v.label = 'active slot has no\
|
||||||
|
\ spool' %}\n{% elif s.matched == 0 %}\n{% set v.state = 'unknown' %}\n\
|
||||||
|
{% set v.label = 'no spool loaded' %}\n{% endif %}\n{% if v.state == 'idle'\
|
||||||
|
\ %}last job: {{ job_g }} g needed{% else %}{{ rem_g }} g left to print\
|
||||||
|
\ \xB7 {{ v.label }}{% endif %}"
|
||||||
|
type: custom:mushroom-template-card
|
||||||
|
- heading: Temperature
|
||||||
|
heading_style: title
|
||||||
|
icon: mdi:coolant-temperature
|
||||||
|
type: heading
|
||||||
|
- entity: sensor.sparkx_i7_nozzle_temperature
|
||||||
|
grid_options:
|
||||||
|
columns: 4
|
||||||
|
max: 300
|
||||||
|
min: 0
|
||||||
|
name: Nozzle
|
||||||
|
severity:
|
||||||
|
green: 0
|
||||||
|
red: 240
|
||||||
|
yellow: 180
|
||||||
|
type: gauge
|
||||||
|
unit: "\xB0C"
|
||||||
|
- entity: sensor.sparkx_i7_bed_temperature
|
||||||
|
grid_options:
|
||||||
|
columns: 4
|
||||||
|
max: 100
|
||||||
|
min: 0
|
||||||
|
name: Bed
|
||||||
|
severity:
|
||||||
|
green: 0
|
||||||
|
red: 100
|
||||||
|
yellow: 60
|
||||||
|
type: gauge
|
||||||
|
unit: "\xB0C"
|
||||||
|
- entity: sensor.sparkx_i7_real_time_flow
|
||||||
|
grid_options:
|
||||||
|
columns: 4
|
||||||
|
max: 40
|
||||||
|
min: 0
|
||||||
|
name: Flow
|
||||||
|
severity:
|
||||||
|
green: 0
|
||||||
|
red: 24
|
||||||
|
yellow: 12
|
||||||
|
type: gauge
|
||||||
|
type: grid
|
||||||
|
type: sections
|
||||||
@@ -4774,3 +4774,4 @@
|
|||||||
{"timestamp": "2026-10-16T20:20:20.033902+00:00", "tool_name": "ha_get_state", "parameters": {"entity_id": "automation.grafana_colour_sync_cfs_lite_slots", "fields": ["state", "attributes"], "attribute_keys": ["last_triggered"]}, "execution_time_ms": 347.69630432128906, "success": true, "error_message": null, "response_size_bytes": 436, "user_context": null}
|
{"timestamp": "2026-10-16T20:20:20.033902+00:00", "tool_name": "ha_get_state", "parameters": {"entity_id": "automation.grafana_colour_sync_cfs_lite_slots", "fields": ["state", "attributes"], "attribute_keys": ["last_triggered"]}, "execution_time_ms": 347.69630432128906, "success": true, "error_message": null, "response_size_bytes": 436, "user_context": null}
|
||||||
{"timestamp": "2026-10-16T20:20:32.926867+00:00", "tool_name": "ha_get_state", "parameters": {"entity_id": ["sensor.cfs_lite_1_remaining", "sensor.cfs_lite_2_remaining", "sensor.cfs_lite_3_remaining", "sensor.cfs_lite_4_remaining", "sensor.filament_storage_remaining"], "fields": ["entity_id", "state", "attributes"], "attribute_keys": ["friendly_name", "unit_of_measurement"]}, "execution_time_ms": 23.16761016845703, "success": true, "error_message": null, "response_size_bytes": 1316, "user_context": null}
|
{"timestamp": "2026-10-16T20:20:32.926867+00:00", "tool_name": "ha_get_state", "parameters": {"entity_id": ["sensor.cfs_lite_1_remaining", "sensor.cfs_lite_2_remaining", "sensor.cfs_lite_3_remaining", "sensor.cfs_lite_4_remaining", "sensor.filament_storage_remaining"], "fields": ["entity_id", "state", "attributes"], "attribute_keys": ["friendly_name", "unit_of_measurement"]}, "execution_time_ms": 23.16761016845703, "success": true, "error_message": null, "response_size_bytes": 1316, "user_context": null}
|
||||||
{"timestamp": "2026-10-16T20:20:32.927994+00:00", "tool_name": "ha_get_state", "parameters": {"entity_id": ["sensor.spoolman_spool_10", "sensor.spoolman_spool_4", "sensor.spoolman_spool_5", "sensor.spoolman_spool_8"], "fields": ["entity_id", "state", "attributes"], "attribute_keys": ["remaining_weight", "filament_weight", "filament_color_hex", "filament_name", "location"]}, "execution_time_ms": 23.519515991210938, "success": true, "error_message": null, "response_size_bytes": 1441, "user_context": null}
|
{"timestamp": "2026-10-16T20:20:32.927994+00:00", "tool_name": "ha_get_state", "parameters": {"entity_id": ["sensor.spoolman_spool_10", "sensor.spoolman_spool_4", "sensor.spoolman_spool_5", "sensor.spoolman_spool_8"], "fields": ["entity_id", "state", "attributes"], "attribute_keys": ["remaining_weight", "filament_weight", "filament_color_hex", "filament_name", "location"]}, "execution_time_ms": 23.519515991210938, "success": true, "error_message": null, "response_size_bytes": 1441, "user_context": null}
|
||||||
|
{"timestamp": "2026-10-16T20:21:51.838041+00:00", "tool_name": "ha_config_set_dashboard", "parameters": {"url_path": "3d-printer-cellphone", "config": null, "python_transform": "cards = config['views'][0]['sections'][0]['cards']\nif len(cards) > 1 and cards[1].get('type') == 'horizontal-stack':\n cards[1] = {\n \"type\": \"horizontal-stack\",\n \"grid_options\": {\"columns\": \"full\"},\n \"cards\": [\n {\"type\": \"custom:mushroom-template-card\", \"entity\": \"sensor.sparkx_i7_cfs_box_1_slot_1_color\", \"name\": \"\", \"icon\": \"none\", \"primary\": \"{% 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) %}{{ live | round(1) }}g{% else %}{{ (states('input_number.sparkx_i7_slot_1_grams') | float(0)) | round(1) }}g{% endif %}\", \"secondary\": \"\", \"card_mod\": {\"style\": \"ha-card { text-align: left; padding: 0 4px; font-size: 12px; line-height: 1.2; } .mushroom-state { text-align: left; }\"}},\n {\"type\": \"custom:mushroom-template-card\", \"entity\": \"sensor.sparkx_i7_cfs_box_1_slot_2_color\", \"name\": \"\", \"icon\": \"none\", \"primary\": \"{% 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) %}{{ live | round(1) }}g{% else %}{{ (states('input_number.sparkx_i7_slot_2_grams') | float(0)) | round(1) }}g{% endif %}\", \"secondary\": \"\", \"card_mod\": {\"style\": \"ha-card { text-align: left; padding: 0 4px; font-size: 12px; line-height: 1.2; } .mushroom-state { text-align: left; }\"}},\n {\"type\": \"custom:mushroom-template-card\", \"entity\": \"sensor.sparkx_i7_cfs_box_1_slot_3_color\", \"name\": \"\", \"icon\": \"none\", \"primary\": \"{% 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) %}{{ live | round(1) }}g{% else %}{{ (states('input_number.sparkx_i7_slot_3_grams') | float(0)) | round(1) }}g{% endif %}\", \"secondary\": \"\", \"card_mod\": {\"style\": \"ha-card { text-align: left; padding: 0 4px; font-size: 12px; line-height: 1.2; } .mushroom-state { text-align: left; }\"}},\n {\"type\": \"custom:mushroom-template-card\", \"entity\": \"sensor.sparkx_i7_cfs_box_1_slot_4_color\", \"name\": \"\", \"icon\": \"none\", \"primary\": \"{% 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) %}{{ live | round(1) }}g{% else %}{{ (states('input_number.sparkx_i7_slot_4_grams') | float(0)) | round(1) }}g{% endif %}\", \"secondary\": \"\", \"card_mod\": {\"style\": \"ha-card { text-align: left; padding: 0 4px; font-size: 12px; line-height: 1.2; } .mushroom-state { text-align: left; }\"}}\n ]\n }\nconfig['views'][0]['sections'][0]['cards'] = cards", "config_hash": "af79698d55c02670", "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": 7990.61918258667, "success": true, "error_message": null, "response_size_bytes": 35743, "user_context": null}
|
||||||
|
|||||||
@@ -35,7 +35,7 @@
|
|||||||
"primary": "{% 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) %}{{ live | round(1) }}g{% else %}{{ (states('input_number.sparkx_i7_slot_1_grams') | float(0)) | round(1) }}g{% endif %}",
|
"primary": "{% 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) %}{{ live | round(1) }}g{% else %}{{ (states('input_number.sparkx_i7_slot_1_grams') | float(0)) | round(1) }}g{% endif %}",
|
||||||
"secondary": "",
|
"secondary": "",
|
||||||
"card_mod": {
|
"card_mod": {
|
||||||
"style": "ha-card { text-align: left; font-size: 11px; padding: 2px; }"
|
"style": "ha-card { text-align: left; padding: 0 4px; font-size: 12px; line-height: 1.2; } .mushroom-state { text-align: left; }"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -46,7 +46,7 @@
|
|||||||
"primary": "{% 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) %}{{ live | round(1) }}g{% else %}{{ (states('input_number.sparkx_i7_slot_2_grams') | float(0)) | round(1) }}g{% endif %}",
|
"primary": "{% 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) %}{{ live | round(1) }}g{% else %}{{ (states('input_number.sparkx_i7_slot_2_grams') | float(0)) | round(1) }}g{% endif %}",
|
||||||
"secondary": "",
|
"secondary": "",
|
||||||
"card_mod": {
|
"card_mod": {
|
||||||
"style": "ha-card { text-align: left; font-size: 11px; padding: 2px; }"
|
"style": "ha-card { text-align: left; padding: 0 4px; font-size: 12px; line-height: 1.2; } .mushroom-state { text-align: left; }"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -57,7 +57,7 @@
|
|||||||
"primary": "{% 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) %}{{ live | round(1) }}g{% else %}{{ (states('input_number.sparkx_i7_slot_3_grams') | float(0)) | round(1) }}g{% endif %}",
|
"primary": "{% 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) %}{{ live | round(1) }}g{% else %}{{ (states('input_number.sparkx_i7_slot_3_grams') | float(0)) | round(1) }}g{% endif %}",
|
||||||
"secondary": "",
|
"secondary": "",
|
||||||
"card_mod": {
|
"card_mod": {
|
||||||
"style": "ha-card { text-align: left; font-size: 11px; padding: 2px; }"
|
"style": "ha-card { text-align: left; padding: 0 4px; font-size: 12px; line-height: 1.2; } .mushroom-state { text-align: left; }"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -68,7 +68,7 @@
|
|||||||
"primary": "{% 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) %}{{ live | round(1) }}g{% else %}{{ (states('input_number.sparkx_i7_slot_4_grams') | float(0)) | round(1) }}g{% endif %}",
|
"primary": "{% 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) %}{{ live | round(1) }}g{% else %}{{ (states('input_number.sparkx_i7_slot_4_grams') | float(0)) | round(1) }}g{% endif %}",
|
||||||
"secondary": "",
|
"secondary": "",
|
||||||
"card_mod": {
|
"card_mod": {
|
||||||
"style": "ha-card { text-align: left; font-size: 11px; padding: 2px; }"
|
"style": "ha-card { text-align: left; padding: 0 4px; font-size: 12px; line-height: 1.2; } .mushroom-state { text-align: left; }"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
+16
-16
@@ -4,7 +4,7 @@
|
|||||||
"state": "ON",
|
"state": "ON",
|
||||||
"led_brightness": 100,
|
"led_brightness": 100,
|
||||||
"countdown_to_turn_off": 0,
|
"countdown_to_turn_off": 0,
|
||||||
"voltage": 120.2,
|
"voltage": 120.7,
|
||||||
"countdown_to_turn_on": 0,
|
"countdown_to_turn_on": 0,
|
||||||
"ac_frequency": 60,
|
"ac_frequency": 60,
|
||||||
"power_factor": 0.11,
|
"power_factor": 0.11,
|
||||||
@@ -27,7 +27,7 @@
|
|||||||
"led_brightness": 100,
|
"led_brightness": 100,
|
||||||
"countdown_to_turn_off": 0,
|
"countdown_to_turn_off": 0,
|
||||||
"countdown_to_turn_on": 0,
|
"countdown_to_turn_on": 0,
|
||||||
"power": 2.3,
|
"power": 2.5,
|
||||||
"current": 0.1,
|
"current": 0.1,
|
||||||
"energy": 57.31,
|
"energy": 57.31,
|
||||||
"power_factor": 0.17,
|
"power_factor": 0.17,
|
||||||
@@ -45,10 +45,10 @@
|
|||||||
"state": "ON",
|
"state": "ON",
|
||||||
"led_brightness": 100,
|
"led_brightness": 100,
|
||||||
"countdown_to_turn_off": 0,
|
"countdown_to_turn_off": 0,
|
||||||
"voltage": 119.6,
|
"voltage": 120.2,
|
||||||
"countdown_to_turn_on": 0,
|
"countdown_to_turn_on": 0,
|
||||||
"energy": 110.72,
|
"energy": 110.72,
|
||||||
"power_factor": 0.88,
|
"power_factor": 0.31,
|
||||||
"ac_frequency": 60,
|
"ac_frequency": 60,
|
||||||
"update": {
|
"update": {
|
||||||
"state": "idle",
|
"state": "idle",
|
||||||
@@ -58,8 +58,8 @@
|
|||||||
"latest_release_notes": null
|
"latest_release_notes": null
|
||||||
},
|
},
|
||||||
"linkquality": 145,
|
"linkquality": 145,
|
||||||
"power": 83.9,
|
"power": 0.2,
|
||||||
"current": 0.83,
|
"current": 0.01,
|
||||||
"power_on_behavior": "on"
|
"power_on_behavior": "on"
|
||||||
},
|
},
|
||||||
"0xb40e060fffe031e3": {
|
"0xb40e060fffe031e3": {
|
||||||
@@ -74,11 +74,11 @@
|
|||||||
"led_brightness": 100,
|
"led_brightness": 100,
|
||||||
"countdown_to_turn_off": 0,
|
"countdown_to_turn_off": 0,
|
||||||
"countdown_to_turn_on": 0,
|
"countdown_to_turn_on": 0,
|
||||||
"voltage": 118.3,
|
"voltage": 118.8,
|
||||||
"state": "ON",
|
"state": "ON",
|
||||||
"ac_frequency": 60,
|
"ac_frequency": 60,
|
||||||
"energy": 224.74,
|
"energy": 224.75,
|
||||||
"power": 100.8,
|
"power": 99.8,
|
||||||
"current": 0.92,
|
"current": 0.92,
|
||||||
"power_factor": 0.39,
|
"power_factor": 0.39,
|
||||||
"update": {
|
"update": {
|
||||||
@@ -95,11 +95,11 @@
|
|||||||
"led_brightness": 100,
|
"led_brightness": 100,
|
||||||
"countdown_to_turn_off": 0,
|
"countdown_to_turn_off": 0,
|
||||||
"countdown_to_turn_on": 0,
|
"countdown_to_turn_on": 0,
|
||||||
"voltage": 119.8,
|
"voltage": 120.3,
|
||||||
"energy": 105.71,
|
"energy": 105.72,
|
||||||
"state": "ON",
|
"state": "ON",
|
||||||
"power": 55.4,
|
"power": 54.5,
|
||||||
"current": 0.59,
|
"current": 0.67,
|
||||||
"ac_frequency": 60,
|
"ac_frequency": 60,
|
||||||
"power_factor": 0.8,
|
"power_factor": 0.8,
|
||||||
"update": {
|
"update": {
|
||||||
@@ -136,7 +136,7 @@
|
|||||||
"0xffffb40e0608864e": {
|
"0xffffb40e0608864e": {
|
||||||
"led_brightness": 100,
|
"led_brightness": 100,
|
||||||
"countdown_to_turn_off": 0,
|
"countdown_to_turn_off": 0,
|
||||||
"voltage": 120,
|
"voltage": 120.5,
|
||||||
"energy": 39.11,
|
"energy": 39.11,
|
||||||
"countdown_to_turn_on": 0,
|
"countdown_to_turn_on": 0,
|
||||||
"state": "ON",
|
"state": "ON",
|
||||||
@@ -171,7 +171,7 @@
|
|||||||
},
|
},
|
||||||
"0xa4c1380d0679ffff": {
|
"0xa4c1380d0679ffff": {
|
||||||
"battery": 100,
|
"battery": 100,
|
||||||
"temperature": 10.6,
|
"temperature": 10.5,
|
||||||
"temperature_units": "celsius",
|
"temperature_units": "celsius",
|
||||||
"temperature_calibration": 0,
|
"temperature_calibration": 0,
|
||||||
"update": {
|
"update": {
|
||||||
@@ -224,7 +224,7 @@
|
|||||||
},
|
},
|
||||||
"0xb40e060fffe717c5": {
|
"0xb40e060fffe717c5": {
|
||||||
"battery": 100,
|
"battery": 100,
|
||||||
"occupancy": true,
|
"occupancy": false,
|
||||||
"tamper": false,
|
"tamper": false,
|
||||||
"battery_low": false,
|
"battery_low": false,
|
||||||
"linkquality": 145,
|
"linkquality": 145,
|
||||||
|
|||||||
Reference in New Issue
Block a user