.storage/lovelace.sparkx_i7, zigbee2mqtt/state.json
This commit is contained in:
@@ -841,7 +841,7 @@
|
||||
},
|
||||
"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 }}"
|
||||
"template": "{% set ns = namespace(cards=[]) %}\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='') %}\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) %}\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 '') %}\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 ~ (' ⚠' 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 ~ \" — 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 {\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: #111111;\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"
|
||||
},
|
||||
|
||||
+18
-18
@@ -4,7 +4,7 @@
|
||||
"state": "ON",
|
||||
"led_brightness": 100,
|
||||
"countdown_to_turn_off": 0,
|
||||
"voltage": 120.3,
|
||||
"voltage": 120.8,
|
||||
"countdown_to_turn_on": 0,
|
||||
"ac_frequency": 60,
|
||||
"power_factor": 0.14,
|
||||
@@ -22,7 +22,7 @@
|
||||
},
|
||||
"0xffffb40e0607af27": {
|
||||
"state": "ON",
|
||||
"voltage": 119.6,
|
||||
"voltage": 120.2,
|
||||
"ac_frequency": 60,
|
||||
"led_brightness": 100,
|
||||
"countdown_to_turn_off": 0,
|
||||
@@ -47,8 +47,8 @@
|
||||
"countdown_to_turn_off": 0,
|
||||
"voltage": 119.9,
|
||||
"countdown_to_turn_on": 0,
|
||||
"energy": 109.76,
|
||||
"power_factor": 0.9,
|
||||
"energy": 109.78,
|
||||
"power_factor": 0.2,
|
||||
"ac_frequency": 60,
|
||||
"update": {
|
||||
"state": "idle",
|
||||
@@ -58,8 +58,8 @@
|
||||
"latest_release_notes": null
|
||||
},
|
||||
"linkquality": 145,
|
||||
"power": 90,
|
||||
"current": 0.86,
|
||||
"power": 0.2,
|
||||
"current": 0.01,
|
||||
"power_on_behavior": "on"
|
||||
},
|
||||
"0xb40e060fffe031e3": {
|
||||
@@ -74,13 +74,13 @@
|
||||
"led_brightness": 100,
|
||||
"countdown_to_turn_off": 0,
|
||||
"countdown_to_turn_on": 0,
|
||||
"voltage": 118.9,
|
||||
"voltage": 118.5,
|
||||
"state": "ON",
|
||||
"ac_frequency": 60,
|
||||
"energy": 222.87,
|
||||
"power": 0.8,
|
||||
"current": 0.05,
|
||||
"power_factor": 0.65,
|
||||
"energy": 222.9,
|
||||
"power": 96,
|
||||
"current": 0.88,
|
||||
"power_factor": 0.94,
|
||||
"update": {
|
||||
"state": "idle",
|
||||
"installed_version": 268513381,
|
||||
@@ -95,13 +95,13 @@
|
||||
"led_brightness": 100,
|
||||
"countdown_to_turn_off": 0,
|
||||
"countdown_to_turn_on": 0,
|
||||
"voltage": 120,
|
||||
"energy": 104.38,
|
||||
"voltage": 120.4,
|
||||
"energy": 104.4,
|
||||
"state": "ON",
|
||||
"power": 55.2,
|
||||
"current": 0.65,
|
||||
"power": 60.6,
|
||||
"current": 0.73,
|
||||
"ac_frequency": 60,
|
||||
"power_factor": 0.7,
|
||||
"power_factor": 0.81,
|
||||
"update": {
|
||||
"state": "idle",
|
||||
"installed_version": 268513381,
|
||||
@@ -136,7 +136,7 @@
|
||||
"0xffffb40e0608864e": {
|
||||
"led_brightness": 100,
|
||||
"countdown_to_turn_off": 0,
|
||||
"voltage": 120.6,
|
||||
"voltage": 120.7,
|
||||
"energy": 37.98,
|
||||
"countdown_to_turn_on": 0,
|
||||
"state": "ON",
|
||||
@@ -224,7 +224,7 @@
|
||||
},
|
||||
"0xb40e060fffe717c5": {
|
||||
"battery": 100,
|
||||
"occupancy": true,
|
||||
"occupancy": false,
|
||||
"tamper": false,
|
||||
"battery_low": false,
|
||||
"linkquality": 145,
|
||||
|
||||
Reference in New Issue
Block a user