.storage/lovelace.3d_printer_cellphone, zigbee2mqtt/state.json

This commit is contained in:
Home Assistant Version Control
2026-10-15 13:17:13 +00:00
parent fe530e8b02
commit a069024f9d
2 changed files with 55 additions and 55 deletions
+43 -43
View File
@@ -6,27 +6,25 @@
"config": {
"views": [
{
"type": "sections",
"sections": [
{
"type": "grid",
"cards": [
{
"type": "heading",
"heading": "Filament Usage",
"heading_style": "title"
"heading_style": "title",
"type": "heading"
},
{
"type": "custom:auto-entities",
"card": {
"type": "grid",
"columns": 4,
"square": false
"square": false,
"type": "grid"
},
"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 }}"
}
},
"type": "custom:auto-entities"
},
{
"entity": "sensor.sparkx_i7_cfs_box_1_humidity",
@@ -49,17 +47,17 @@
{
"cards": [
{
"type": "custom:mushroom-template-card",
"entity": "sensor.sparkx_i7_active_filament_slot",
"name": "Next Deduction Match",
"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 %}",
"primary": "{{ states('sensor.sparkx_i7_active_filament_slot') }}",
"secondary": "{% set slot = states('sensor.sparkx_i7_active_filament_slot') %}{% set ce = 'sensor.sparkx_i7_cfs_' ~ (slot | lower | replace(' ', '_')) ~ '_color' %}{% set color = states(ce) | replace('#', '') | lower %}{% set ns = namespace(id='') %}{% for e in integration_entities('spoolman') %}{% if e.endswith('_color_hex') and (states(e) | replace('#', '') | lower) == color and (state_attr(e[:-10], 'location') | default('', true) | lower) == 'cfs lite' %}{% 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 %}Color #{{ color | upper }} → spool {{ ns.id }} ({{ states('sensor.spoolman_spool_' ~ ns.id ~ '_filament_name') }} · {{ (states('sensor.spoolman_spool_' ~ ns.id) | float(0)) | round(1) }} g left){% elif slot in ['', 'unknown', 'unavailable'] %}No slot latched{% elif color in ['', 'unknown', 'unavailable'] %}Slot color unavailable{% else %}Color #{{ color | upper }} — no spool with stock{% endif %}",
"multiline_secondary": true,
"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') %}{% set ce = 'sensor.sparkx_i7_cfs_' ~ (slot | lower | replace(' ', '_')) ~ '_color' %}{% set color = states(ce) | 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 ' ~ slot.split('_')[-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 %}Color #{{ color | upper }} → spool {{ ns.id }} ({{ states('sensor.spoolman_spool_' ~ ns.id ~ '_filament_name') }} · {{ (states('sensor.spoolman_spool_' ~ ns.id) | float(0)) | round(1) }} g left){% elif slot in ['', 'unknown', 'unavailable'] %}No slot latched{% elif color in ['', 'unknown', 'unavailable'] %}Slot color unavailable{% else %}Color #{{ color | upper }} — no spool with stock{% endif %}",
"type": "custom:mushroom-template-card"
}
],
"grid_options": {
@@ -68,40 +66,39 @@
"type": "horizontal-stack"
},
{
"type": "heading",
"icon": "mdi:printer-3d",
"heading": "Last/Current Print Job",
"heading_style": "title"
"heading_style": "title",
"icon": "mdi:printer-3d",
"type": "heading"
},
{
"type": "tile",
"entity": "sensor.sparkx_i7_used_material_length",
"name": "Used Material Total (cm)",
"grid_options": {
"columns": 6,
"rows": 1
},
"icon": "mdi:plus-minus",
"grid_options": {
"columns": 6,
"rows": 1
}
"name": "Used Material Total (cm)",
"type": "tile"
},
{
"type": "tile",
"entity": "sensor.sparkx_moonraker_print_eta",
"features_position": "bottom",
"name": "Print ETA",
"vertical": false,
"features_position": "bottom"
"type": "tile",
"vertical": false
},
{
"type": "tile",
"entity": "sensor.sparkx_i7_filament_weight_estimated",
"name": "Current Job Weight (est.)",
"icon": "mdi:weight-gram",
"grid_options": {
"columns": 6,
"rows": 1
}
},
"icon": "mdi:weight-gram",
"name": "Current Job Weight (est.)",
"type": "tile"
},
{
"type": "custom:mushroom-template-card",
"entity": "sensor.sparkx_i7_filament_weight_estimated",
"grid_options": {
"columns": 6,
@@ -111,13 +108,14 @@
"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') %} {% if st in ['printing', 'paused'] %}\n {{ states('sensor.sparkx_i7_filament_weight_estimated') | round(1) }} g\n{% else %}\n Last: {{ states('input_number.sparkx_i7_last_job_filament_weight') | round(1) }} g\n{% endif %}",
"secondary": "{% set st = states('sensor.sparkx_i7_print_status') %} {% if st in ['printing', 'paused'] %}\n {{ states('sensor.sparkx_i7_filament_cost') | round(2) }} $ (live)\n{% else %}\n {{ states('input_number.sparkx_i7_last_job_cost') | round(2) }} $ (last job)\n{% endif %}"
"secondary": "{% set st = states('sensor.sparkx_i7_print_status') %} {% if st in ['printing', 'paused'] %}\n {{ states('sensor.sparkx_i7_filament_cost') | round(2) }} $ (live)\n{% else %}\n {{ states('input_number.sparkx_i7_last_job_cost') | round(2) }} $ (last job)\n{% endif %}",
"type": "custom:mushroom-template-card"
},
{
"type": "heading",
"icon": "mdi:coolant-temperature",
"heading": "Temperature",
"heading_style": "title",
"heading": "Temperature"
"icon": "mdi:coolant-temperature",
"type": "heading"
},
{
"entity": "sensor.sparkx_i7_nozzle_temperature",
@@ -158,17 +156,19 @@
},
"max": 20,
"min": 0,
"type": "gauge",
"name": "Flow",
"severity": {
"green": 0,
"yellow": 6,
"red": 12
"red": 12,
"yellow": 6
},
"name": "Flow"
"type": "gauge"
}
]
],
"type": "grid"
}
]
],
"type": "sections"
}
]
}
+12 -12
View File
@@ -22,15 +22,15 @@
},
"0xffffb40e0607af27": {
"state": "ON",
"voltage": 119.3,
"voltage": 118.9,
"ac_frequency": 60,
"led_brightness": 100,
"countdown_to_turn_off": 0,
"countdown_to_turn_on": 0,
"power": 2,
"power": 1.9,
"current": 0.09,
"energy": 57.08,
"power_factor": 0.17,
"power_factor": 0.19,
"update": {
"state": "idle",
"installed_version": 268513381,
@@ -74,13 +74,13 @@
"led_brightness": 100,
"countdown_to_turn_off": 0,
"countdown_to_turn_on": 0,
"voltage": 118.8,
"voltage": 118.3,
"state": "ON",
"ac_frequency": 60,
"energy": 222.54,
"power": 3.6,
"power": 1.1,
"current": 0.05,
"power_factor": 0.41,
"power_factor": 0.39,
"update": {
"state": "idle",
"installed_version": 268513381,
@@ -95,13 +95,13 @@
"led_brightness": 100,
"countdown_to_turn_off": 0,
"countdown_to_turn_on": 0,
"voltage": 119.2,
"voltage": 119,
"energy": 104.15,
"state": "ON",
"power": 69.1,
"current": 0.73,
"power": 51.4,
"current": 0.65,
"ac_frequency": 60,
"power_factor": 0.8,
"power_factor": 0.76,
"update": {
"state": "idle",
"installed_version": 268513381,
@@ -136,14 +136,14 @@
"0xffffb40e0608864e": {
"led_brightness": 100,
"countdown_to_turn_off": 0,
"voltage": 120.2,
"voltage": 119.7,
"energy": 37.39,
"countdown_to_turn_on": 0,
"state": "ON",
"current": 0.02,
"ac_frequency": 60,
"power": 0.3,
"power_factor": 0.14,
"power_factor": 0.2,
"update": {
"state": "idle",
"installed_version": 268513381,