3 files
This commit is contained in:
@@ -28,260 +28,80 @@
|
||||
},
|
||||
"cards": [
|
||||
{
|
||||
"type": "button-card",
|
||||
"type": "tile",
|
||||
"entity": "sensor.sparkx_i7_cfs_box_1_slot_1_color",
|
||||
"name": "",
|
||||
"show_icon": false,
|
||||
"show_state": false,
|
||||
"show_name": false,
|
||||
"custom_fields": {
|
||||
"value": "{% 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 %}"
|
||||
},
|
||||
"styles": {
|
||||
"card": [
|
||||
{
|
||||
"background": "transparent"
|
||||
},
|
||||
{
|
||||
"box-shadow": "none"
|
||||
},
|
||||
{
|
||||
"border": "none"
|
||||
},
|
||||
{
|
||||
"padding": "0 2px"
|
||||
},
|
||||
{
|
||||
"text-align": "left"
|
||||
},
|
||||
{
|
||||
"justify-content": "flex-start"
|
||||
},
|
||||
{
|
||||
"align-items": "flex-start"
|
||||
}
|
||||
],
|
||||
"custom_fields": {
|
||||
"value": [
|
||||
{
|
||||
"text-align": "left"
|
||||
},
|
||||
{
|
||||
"font-size": "11px"
|
||||
},
|
||||
{
|
||||
"line-height": "1.1"
|
||||
},
|
||||
{
|
||||
"padding": "0"
|
||||
},
|
||||
{
|
||||
"margin": "0"
|
||||
},
|
||||
{
|
||||
"justify-content": "flex-start"
|
||||
},
|
||||
{
|
||||
"display": "flex"
|
||||
}
|
||||
]
|
||||
}
|
||||
"icon": "none",
|
||||
"state_content": [
|
||||
"state"
|
||||
],
|
||||
"grid_options": {
|
||||
"columns": 3
|
||||
},
|
||||
"tap_action": {
|
||||
"action": "none"
|
||||
}
|
||||
},
|
||||
"card_mod": {
|
||||
"style": "ha-card { padding: 0 4px; margin: 0; } .tile { padding: 0; } .tile__title { display: none; } .tile__state { text-align: left; justify-content: flex-start; font-size: 10px; line-height: 1; margin: 0; padding: 0; } .tile__icon { display: none; }"
|
||||
},
|
||||
"state_display": "{% 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 %}"
|
||||
},
|
||||
{
|
||||
"type": "button-card",
|
||||
"type": "tile",
|
||||
"entity": "sensor.sparkx_i7_cfs_box_1_slot_2_color",
|
||||
"name": "",
|
||||
"show_icon": false,
|
||||
"show_state": false,
|
||||
"show_name": false,
|
||||
"custom_fields": {
|
||||
"value": "{% 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 %}"
|
||||
},
|
||||
"styles": {
|
||||
"card": [
|
||||
{
|
||||
"background": "transparent"
|
||||
},
|
||||
{
|
||||
"box-shadow": "none"
|
||||
},
|
||||
{
|
||||
"border": "none"
|
||||
},
|
||||
{
|
||||
"padding": "0 2px"
|
||||
},
|
||||
{
|
||||
"text-align": "left"
|
||||
},
|
||||
{
|
||||
"justify-content": "flex-start"
|
||||
},
|
||||
{
|
||||
"align-items": "flex-start"
|
||||
}
|
||||
],
|
||||
"custom_fields": {
|
||||
"value": [
|
||||
{
|
||||
"text-align": "left"
|
||||
},
|
||||
{
|
||||
"font-size": "11px"
|
||||
},
|
||||
{
|
||||
"line-height": "1.1"
|
||||
},
|
||||
{
|
||||
"padding": "0"
|
||||
},
|
||||
{
|
||||
"margin": "0"
|
||||
},
|
||||
{
|
||||
"justify-content": "flex-start"
|
||||
},
|
||||
{
|
||||
"display": "flex"
|
||||
}
|
||||
]
|
||||
}
|
||||
"icon": "none",
|
||||
"state_content": [
|
||||
"state"
|
||||
],
|
||||
"grid_options": {
|
||||
"columns": 3
|
||||
},
|
||||
"tap_action": {
|
||||
"action": "none"
|
||||
}
|
||||
},
|
||||
"card_mod": {
|
||||
"style": "ha-card { padding: 0 4px; margin: 0; } .tile { padding: 0; } .tile__title { display: none; } .tile__state { text-align: left; justify-content: flex-start; font-size: 10px; line-height: 1; margin: 0; padding: 0; } .tile__icon { display: none; }"
|
||||
},
|
||||
"state_display": "{% 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 %}"
|
||||
},
|
||||
{
|
||||
"type": "button-card",
|
||||
"type": "tile",
|
||||
"entity": "sensor.sparkx_i7_cfs_box_1_slot_3_color",
|
||||
"name": "",
|
||||
"show_icon": false,
|
||||
"show_state": false,
|
||||
"show_name": false,
|
||||
"custom_fields": {
|
||||
"value": "{% 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 %}"
|
||||
},
|
||||
"styles": {
|
||||
"card": [
|
||||
{
|
||||
"background": "transparent"
|
||||
},
|
||||
{
|
||||
"box-shadow": "none"
|
||||
},
|
||||
{
|
||||
"border": "none"
|
||||
},
|
||||
{
|
||||
"padding": "0 2px"
|
||||
},
|
||||
{
|
||||
"text-align": "left"
|
||||
},
|
||||
{
|
||||
"justify-content": "flex-start"
|
||||
},
|
||||
{
|
||||
"align-items": "flex-start"
|
||||
}
|
||||
],
|
||||
"custom_fields": {
|
||||
"value": [
|
||||
{
|
||||
"text-align": "left"
|
||||
},
|
||||
{
|
||||
"font-size": "11px"
|
||||
},
|
||||
{
|
||||
"line-height": "1.1"
|
||||
},
|
||||
{
|
||||
"padding": "0"
|
||||
},
|
||||
{
|
||||
"margin": "0"
|
||||
},
|
||||
{
|
||||
"justify-content": "flex-start"
|
||||
},
|
||||
{
|
||||
"display": "flex"
|
||||
}
|
||||
]
|
||||
}
|
||||
"icon": "none",
|
||||
"state_content": [
|
||||
"state"
|
||||
],
|
||||
"grid_options": {
|
||||
"columns": 3
|
||||
},
|
||||
"tap_action": {
|
||||
"action": "none"
|
||||
}
|
||||
},
|
||||
"card_mod": {
|
||||
"style": "ha-card { padding: 0 4px; margin: 0; } .tile { padding: 0; } .tile__title { display: none; } .tile__state { text-align: left; justify-content: flex-start; font-size: 10px; line-height: 1; margin: 0; padding: 0; } .tile__icon { display: none; }"
|
||||
},
|
||||
"state_display": "{% 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 %}"
|
||||
},
|
||||
{
|
||||
"type": "button-card",
|
||||
"type": "tile",
|
||||
"entity": "sensor.sparkx_i7_cfs_box_1_slot_4_color",
|
||||
"name": "",
|
||||
"show_icon": false,
|
||||
"show_state": false,
|
||||
"show_name": false,
|
||||
"custom_fields": {
|
||||
"value": "{% 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 %}"
|
||||
},
|
||||
"styles": {
|
||||
"card": [
|
||||
{
|
||||
"background": "transparent"
|
||||
},
|
||||
{
|
||||
"box-shadow": "none"
|
||||
},
|
||||
{
|
||||
"border": "none"
|
||||
},
|
||||
{
|
||||
"padding": "0 2px"
|
||||
},
|
||||
{
|
||||
"text-align": "left"
|
||||
},
|
||||
{
|
||||
"justify-content": "flex-start"
|
||||
},
|
||||
{
|
||||
"align-items": "flex-start"
|
||||
}
|
||||
],
|
||||
"custom_fields": {
|
||||
"value": [
|
||||
{
|
||||
"text-align": "left"
|
||||
},
|
||||
{
|
||||
"font-size": "11px"
|
||||
},
|
||||
{
|
||||
"line-height": "1.1"
|
||||
},
|
||||
{
|
||||
"padding": "0"
|
||||
},
|
||||
{
|
||||
"margin": "0"
|
||||
},
|
||||
{
|
||||
"justify-content": "flex-start"
|
||||
},
|
||||
{
|
||||
"display": "flex"
|
||||
}
|
||||
]
|
||||
}
|
||||
"icon": "none",
|
||||
"state_content": [
|
||||
"state"
|
||||
],
|
||||
"grid_options": {
|
||||
"columns": 3
|
||||
},
|
||||
"tap_action": {
|
||||
"action": "none"
|
||||
}
|
||||
},
|
||||
"card_mod": {
|
||||
"style": "ha-card { padding: 0 4px; margin: 0; } .tile { padding: 0; } .tile__title { display: none; } .tile__state { text-align: left; justify-content: flex-start; font-size: 10px; line-height: 1; margin: 0; padding: 0; } .tile__icon { display: none; }"
|
||||
},
|
||||
"state_display": "{% 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 %}"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user