.storage/lovelace.ender5_printer, zigbee2mqtt/state.json
This commit is contained in:
@@ -32,7 +32,6 @@
|
||||
"type": "button",
|
||||
"icon": "mdi:pause",
|
||||
"text": "Pause",
|
||||
"color": "",
|
||||
"tap_action": {
|
||||
"action": "perform-action",
|
||||
"perform_action": "switch.turn_on",
|
||||
@@ -57,7 +56,6 @@
|
||||
"type": "button",
|
||||
"icon": "mdi:play",
|
||||
"text": "Resume",
|
||||
"color": "",
|
||||
"tap_action": {
|
||||
"action": "perform-action",
|
||||
"perform_action": "switch.turn_off",
|
||||
@@ -127,7 +125,7 @@
|
||||
"action": "more-info"
|
||||
},
|
||||
"custom_fields": {
|
||||
"content": "[[[\n const sec = 'var(--secondary-text-color)';\n const pri = 'var(--primary-text-color)';\n return `\n <div style=\"position:absolute; top:10px; left:12px; right:12px; bottom:10px; display:flex; flex-direction:column; align-items:flex-start; justify-content:flex-start; gap:3px;\">\n <div style=\"display:flex; align-items:center; gap:4px;\">\n <ha-icon icon=\"mdi:printer-3d-nozzle\" style=\"color:#4CAF50; --mdc-icon-size:12px;\"></ha-icon>\n <span style=\"font-size:10px; color:${sec}; text-transform:uppercase; letter-spacing:0.05em;\">Nozzle</span>\n </div>\n <span style=\"font-size:18px; font-weight:600; color:${pri}; line-height:1;\">${Math.round(parseFloat(states['sensor.octoprint_tool_0_temperature']?.state) || 0) + '\\u00B0C / target ' + Math.round(parseFloat(states['sensor.octoprint_tool_0_target']?.state) || 0) + '\\u00B0C'}</span>\n </div>\n `;\n]]]"
|
||||
"content": "[[[\n const sec = 'var(--secondary-text-color)';\n const pri = 'var(--primary-text-color)';\n const v = (Math.round(parseFloat(states['sensor.octoprint_tool_0_temperature']?.state) || 0)) + '\\u00B0C';\n const s = 'target: ' + (Math.round(parseFloat(states['sensor.octoprint_tool_0_target']?.state) || 0)) + '\\u00B0C';\n return `\n <div style=\"position:absolute; top:10px; left:12px; right:12px; bottom:10px; display:flex; flex-direction:column; align-items:flex-start; justify-content:flex-start; gap:3px;\">\n <div style=\"display:flex; align-items:center; gap:4px;\">\n <ha-icon icon=\"mdi:printer-3d-nozzle\" style=\"color:#4CAF50; --mdc-icon-size:12px;\"></ha-icon>\n <span style=\"font-size:10px; color:${sec}; text-transform:uppercase; letter-spacing:0.05em;\">Nozzle</span>\n </div>\n <span style=\"font-size:18px; font-weight:600; color:${pri}; line-height:1;\">${v}</span>\n <span style=\"font-size:10px; color:${sec};\">${s}</span>\n </div>\n `;\n]]]"
|
||||
},
|
||||
"styles": {
|
||||
"card": [
|
||||
@@ -178,7 +176,7 @@
|
||||
"action": "more-info"
|
||||
},
|
||||
"custom_fields": {
|
||||
"content": "[[[\n const sec = 'var(--secondary-text-color)';\n const pri = 'var(--primary-text-color)';\n return `\n <div style=\"position:absolute; top:10px; left:12px; right:12px; bottom:10px; display:flex; flex-direction:column; align-items:flex-start; justify-content:flex-start; gap:3px;\">\n <div style=\"display:flex; align-items:center; gap:4px;\">\n <ha-icon icon=\"mdi:radiator\" style=\"color:#4CAF50; --mdc-icon-size:12px;\"></ha-icon>\n <span style=\"font-size:10px; color:${sec}; text-transform:uppercase; letter-spacing:0.05em;\">Print bed</span>\n </div>\n <span style=\"font-size:18px; font-weight:600; color:${pri}; line-height:1;\">${Math.round(parseFloat(states['sensor.octoprint_bed_temperature']?.state) || 0) + '\\u00B0C / target ' + Math.round(parseFloat(states['sensor.octoprint_bed_target']?.state) || 0) + '\\u00B0C'}</span>\n </div>\n `;\n]]]"
|
||||
"content": "[[[\n const sec = 'var(--secondary-text-color)';\n const pri = 'var(--primary-text-color)';\n const v = (Math.round(parseFloat(states['sensor.octoprint_bed_temperature']?.state) || 0)) + '\\u00B0C';\n const s = 'target: ' + (Math.round(parseFloat(states['sensor.octoprint_bed_target']?.state) || 0)) + '\\u00B0C';\n return `\n <div style=\"position:absolute; top:10px; left:12px; right:12px; bottom:10px; display:flex; flex-direction:column; align-items:flex-start; justify-content:flex-start; gap:3px;\">\n <div style=\"display:flex; align-items:center; gap:4px;\">\n <ha-icon icon=\"mdi:radiator\" style=\"color:#4CAF50; --mdc-icon-size:12px;\"></ha-icon>\n <span style=\"font-size:10px; color:${sec}; text-transform:uppercase; letter-spacing:0.05em;\">Print bed</span>\n </div>\n <span style=\"font-size:18px; font-weight:600; color:${pri}; line-height:1;\">${v}</span>\n <span style=\"font-size:10px; color:${sec};\">${s}</span>\n </div>\n `;\n]]]"
|
||||
},
|
||||
"styles": {
|
||||
"card": [
|
||||
@@ -280,7 +278,7 @@
|
||||
"action": "more-info"
|
||||
},
|
||||
"custom_fields": {
|
||||
"content": "[[[\n const sec = 'var(--secondary-text-color)';\n const pri = 'var(--primary-text-color)';\n return `\n <div style=\"position:absolute; top:10px; left:12px; right:12px; bottom:10px; display:flex; flex-direction:column; align-items:flex-start; justify-content:flex-start; gap:3px;\">\n <div style=\"display:flex; align-items:center; gap:4px;\">\n <ha-icon icon=\"mdi:axis-z-arrow\" style=\"color:#4CAF50; --mdc-icon-size:12px;\"></ha-icon>\n <span style=\"font-size:10px; color:${sec}; text-transform:uppercase; letter-spacing:0.05em;\">Height</span>\n </div>\n <span style=\"font-size:18px; font-weight:600; color:${pri}; line-height:1;\">${states['sensor.octoprint_current_z']?.state + ' mm'}</span>\n </div>\n `;\n]]]"
|
||||
"content": "[[[\n const sec = 'var(--secondary-text-color)';\n const pri = 'var(--primary-text-color)';\n const v = states['sensor.octoprint_current_z']?.state + ' mm';\n const s = '';\n return `\n <div style=\"position:absolute; top:10px; left:12px; right:12px; bottom:10px; display:flex; flex-direction:column; align-items:flex-start; justify-content:flex-start; gap:3px;\">\n <div style=\"display:flex; align-items:center; gap:4px;\">\n <ha-icon icon=\"mdi:axis-z-arrow\" style=\"color:#4CAF50; --mdc-icon-size:12px;\"></ha-icon>\n <span style=\"font-size:10px; color:${sec}; text-transform:uppercase; letter-spacing:0.05em;\">Height</span>\n </div>\n <span style=\"font-size:18px; font-weight:600; color:${pri}; line-height:1;\">${v}</span>\n <span style=\"font-size:10px; color:${sec};\">${s}</span>\n </div>\n `;\n]]]"
|
||||
},
|
||||
"styles": {
|
||||
"card": [
|
||||
@@ -463,54 +461,272 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "custom:button-card",
|
||||
"entity": "binary_sensor.octoprint_connected",
|
||||
"show_name": false,
|
||||
"show_icon": false,
|
||||
"tap_action": {
|
||||
"action": "none"
|
||||
},
|
||||
"custom_fields": {
|
||||
"content": "[[[\n const connected = states['binary_sensor.octoprint_connected']?.state === 'on';\n const printing = states['binary_sensor.octoprint_printing']?.state === 'on';\n const paused = states['binary_sensor.octoprint_paused']?.state === 'on';\n const health = Math.round((parseFloat(states['sensor.octoprint_serial_health_ratio']?.state) || 0) * 100);\n const prints = states['sensor.octoprint_printer_prints_today']?.state || '0';\n const ptime = states['sensor.octoprint_printer_print_time_today']?.state || '--';\n const fil = ((parseFloat(states['sensor.octoprint_filament_daily']?.state) || 0) / 10).toFixed(1);\n\n const row = (label, value, vc) => `\n <div style=\"display:grid; grid-template-columns:1fr auto; align-items:center; padding:5px 0; border-bottom:1px solid rgba(var(--rgb-primary-text-color),0.06); width:100%;\">\n <span style=\"font-size:12px; color:var(--secondary-text-color);\">${label}</span>\n <span style=\"font-size:12px; font-weight:500; color:${vc || 'var(--primary-text-color)'}; text-align:right;\">${value}</span>\n </div>`;\n return `\n <div style=\"position:absolute; top:14px; left:16px; right:16px; bottom:14px; display:flex; flex-direction:column;\">\n <div style=\"display:flex; align-items:center; gap:5px; margin-bottom:10px;\">\n <ha-icon icon=\"mdi:stethoscope\" style=\"color:#4CAF50; --mdc-icon-size:14px;\"></ha-icon>\n <span style=\"font-size:11px; color:var(--secondary-text-color); text-transform:uppercase; letter-spacing:0.05em;\">Diagnostics</span>\n </div>\n ${row('Connected', connected ? 'Yes' : 'No', connected ? '#4CAF50' : '#F44336')}\n ${row('Status', printing ? (paused ? 'Paused' : 'Printing') : 'Idle', printing ? '#4CAF50' : null)}\n ${row('Serial health', health + '%', health > 95 ? '#4CAF50' : health > 80 ? '#FF9800' : '#F44336')}\n ${row('Prints today', prints, null)}\n ${row('Time today', ptime + ' h', null)}\n ${row('Filament today', fil + ' m', null)}\n </div>\n `;\n ]]]"
|
||||
},
|
||||
"styles": {
|
||||
"card": [
|
||||
{
|
||||
"background": "var(--ha-card-background, var(--card-background-color))"
|
||||
"type": "horizontal-stack",
|
||||
"cards": [
|
||||
{
|
||||
"type": "custom:button-card",
|
||||
"entity": "binary_sensor.octoprint_connected",
|
||||
"show_name": false,
|
||||
"show_icon": false,
|
||||
"tap_action": {
|
||||
"action": "none"
|
||||
},
|
||||
{
|
||||
"border-radius": "12px"
|
||||
"custom_fields": {
|
||||
"content": "[[[\n const connected = states['binary_sensor.octoprint_connected']?.state === 'on';\n const printing = states['binary_sensor.octoprint_printing']?.state === 'on';\n const paused = states['binary_sensor.octoprint_paused']?.state === 'on';\n const health = Math.round((parseFloat(states['sensor.octoprint_serial_health_ratio']?.state) || 0) * 100);\n const prints = states['sensor.octoprint_printer_prints_today']?.state || '0';\n const ptime = states['sensor.octoprint_printer_print_time_today']?.state || '--';\n const fil = ((parseFloat(states['sensor.octoprint_filament_daily']?.state) || 0) / 10).toFixed(1);\n\n const row = (label, value, vc) => `\n <div style=\"display:grid; grid-template-columns:1fr auto; align-items:center; padding:5px 0; border-bottom:1px solid rgba(var(--rgb-primary-text-color),0.06); width:100%;\">\n <span style=\"font-size:12px; color:var(--secondary-text-color);\">${label}</span>\n <span style=\"font-size:12px; font-weight:500; color:${vc || 'var(--primary-text-color)'}; text-align:right;\">${value}</span>\n </div>`;\n return `\n <div style=\"position:absolute; top:14px; left:16px; right:16px; bottom:14px; display:flex; flex-direction:column;\">\n <div style=\"display:flex; align-items:center; gap:5px; margin-bottom:10px;\">\n <ha-icon icon=\"mdi:stethoscope\" style=\"color:#4CAF50; --mdc-icon-size:14px;\"></ha-icon>\n <span style=\"font-size:11px; color:var(--secondary-text-color); text-transform:uppercase; letter-spacing:0.05em;\">Diagnostics</span>\n </div>\n ${row('Connected', connected ? 'Yes' : 'No', connected ? '#4CAF50' : '#F44336')}\n ${row('Status', printing ? (paused ? 'Paused' : 'Printing') : 'Idle', printing ? '#4CAF50' : null)}\n ${row('Serial health', health + '%', health > 95 ? '#4CAF50' : health > 80 ? '#FF9800' : '#F44336')}\n ${row('Prints today', prints, null)}\n ${row('Time today', ptime + ' h', null)}\n ${row('Filament today', fil + ' m', null)}\n </div>\n `;\n ]]]"
|
||||
},
|
||||
{
|
||||
"padding": "0"
|
||||
},
|
||||
{
|
||||
"height": "74px"
|
||||
},
|
||||
{
|
||||
"position": "relative"
|
||||
},
|
||||
{
|
||||
"box-shadow": "none"
|
||||
},
|
||||
{
|
||||
"height": "190px"
|
||||
"styles": {
|
||||
"card": [
|
||||
{
|
||||
"background": "var(--ha-card-background, var(--card-background-color))"
|
||||
},
|
||||
{
|
||||
"border-radius": "12px"
|
||||
},
|
||||
{
|
||||
"padding": "0"
|
||||
},
|
||||
{
|
||||
"height": "74px"
|
||||
},
|
||||
{
|
||||
"position": "relative"
|
||||
},
|
||||
{
|
||||
"box-shadow": "none"
|
||||
},
|
||||
{
|
||||
"height": "190px"
|
||||
}
|
||||
],
|
||||
"custom_fields": {
|
||||
"content": [
|
||||
{
|
||||
"position": "absolute"
|
||||
},
|
||||
{
|
||||
"inset": "0"
|
||||
},
|
||||
{
|
||||
"padding": "0"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
],
|
||||
"custom_fields": {
|
||||
"content": [
|
||||
},
|
||||
{
|
||||
"type": "vertical-stack",
|
||||
"cards": [
|
||||
{
|
||||
"position": "absolute"
|
||||
"type": "horizontal-stack",
|
||||
"cards": [
|
||||
{
|
||||
"type": "custom:button-card",
|
||||
"entity": "switch.octoprint_connect_to_printer",
|
||||
"show_state": false,
|
||||
"tap_action": {
|
||||
"action": "toggle"
|
||||
},
|
||||
"name": "Connect",
|
||||
"icon": "mdi:lan-connect",
|
||||
"state": [
|
||||
{
|
||||
"value": "off",
|
||||
"name": "Disconnect",
|
||||
"icon": "mdi:lan-disconnect"
|
||||
}
|
||||
],
|
||||
"styles": {
|
||||
"card": [
|
||||
{
|
||||
"height": "91px"
|
||||
},
|
||||
{
|
||||
"border-radius": "12px"
|
||||
},
|
||||
{
|
||||
"box-shadow": "none"
|
||||
},
|
||||
{
|
||||
"border": "1px solid rgba(var(--rgb-primary-text-color), 0.08)"
|
||||
},
|
||||
{
|
||||
"background": "var(--ha-card-background, var(--card-background-color))"
|
||||
}
|
||||
],
|
||||
"name": [
|
||||
{
|
||||
"font-size": "11px",
|
||||
"font-weight": "500"
|
||||
}
|
||||
],
|
||||
"icon": [
|
||||
{
|
||||
"--mdc-icon-size": "26px"
|
||||
},
|
||||
{
|
||||
"margin-top": "6px"
|
||||
},
|
||||
{
|
||||
"color": "[[[ return states['switch.octoprint_connect_to_printer']?.state === 'on' ? '#4CAF50' : 'var(--secondary-text-color)'; ]]]"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "custom:button-card",
|
||||
"entity": "switch.octoprint_camera_snapshot",
|
||||
"show_state": false,
|
||||
"tap_action": {
|
||||
"action": "toggle"
|
||||
},
|
||||
"name": "Snapshots",
|
||||
"icon": "mdi:camera",
|
||||
"state": [
|
||||
{
|
||||
"value": "off",
|
||||
"name": "Snapshots",
|
||||
"icon": "mdi:camera-off"
|
||||
}
|
||||
],
|
||||
"styles": {
|
||||
"card": [
|
||||
{
|
||||
"height": "91px"
|
||||
},
|
||||
{
|
||||
"border-radius": "12px"
|
||||
},
|
||||
{
|
||||
"box-shadow": "none"
|
||||
},
|
||||
{
|
||||
"border": "1px solid rgba(var(--rgb-primary-text-color), 0.08)"
|
||||
},
|
||||
{
|
||||
"background": "var(--ha-card-background, var(--card-background-color))"
|
||||
}
|
||||
],
|
||||
"name": [
|
||||
{
|
||||
"font-size": "11px",
|
||||
"font-weight": "500"
|
||||
}
|
||||
],
|
||||
"icon": [
|
||||
{
|
||||
"--mdc-icon-size": "26px"
|
||||
},
|
||||
{
|
||||
"margin-top": "6px"
|
||||
},
|
||||
{
|
||||
"color": "[[[ return states['switch.octoprint_camera_snapshot']?.state === 'on' ? '#4CAF50' : 'var(--secondary-text-color)'; ]]]"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"inset": "0"
|
||||
},
|
||||
{
|
||||
"padding": "0"
|
||||
"type": "horizontal-stack",
|
||||
"cards": [
|
||||
{
|
||||
"type": "custom:button-card",
|
||||
"name": "GCode viewer",
|
||||
"icon": "mdi:cube-outline",
|
||||
"show_state": false,
|
||||
"tap_action": {
|
||||
"action": "url",
|
||||
"url_path": "https://ender5pro.duckdns.org/#gcode"
|
||||
},
|
||||
"styles": {
|
||||
"card": [
|
||||
{
|
||||
"height": "91px"
|
||||
},
|
||||
{
|
||||
"border-radius": "12px"
|
||||
},
|
||||
{
|
||||
"box-shadow": "none"
|
||||
},
|
||||
{
|
||||
"border": "1px solid rgba(var(--rgb-primary-text-color), 0.08)"
|
||||
},
|
||||
{
|
||||
"background": "var(--ha-card-background, var(--card-background-color))"
|
||||
}
|
||||
],
|
||||
"name": [
|
||||
{
|
||||
"font-size": "11px",
|
||||
"font-weight": "500"
|
||||
}
|
||||
],
|
||||
"icon": [
|
||||
{
|
||||
"--mdc-icon-size": "26px"
|
||||
},
|
||||
{
|
||||
"margin-top": "6px"
|
||||
},
|
||||
{
|
||||
"color": "#4CAF50"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "custom:button-card",
|
||||
"name": "Pretty GCode",
|
||||
"icon": "mdi:cube-scan",
|
||||
"show_state": false,
|
||||
"tap_action": {
|
||||
"action": "url",
|
||||
"url_path": "https://ender5pro.duckdns.org/#tab_plugin_prettygcode"
|
||||
},
|
||||
"styles": {
|
||||
"card": [
|
||||
{
|
||||
"height": "91px"
|
||||
},
|
||||
{
|
||||
"border-radius": "12px"
|
||||
},
|
||||
{
|
||||
"box-shadow": "none"
|
||||
},
|
||||
{
|
||||
"border": "1px solid rgba(var(--rgb-primary-text-color), 0.08)"
|
||||
},
|
||||
{
|
||||
"background": "var(--ha-card-background, var(--card-background-color))"
|
||||
}
|
||||
],
|
||||
"name": [
|
||||
{
|
||||
"font-size": "11px",
|
||||
"font-weight": "500"
|
||||
}
|
||||
],
|
||||
"icon": [
|
||||
{
|
||||
"--mdc-icon-size": "26px"
|
||||
},
|
||||
{
|
||||
"margin-top": "6px"
|
||||
},
|
||||
{
|
||||
"color": "#4CAF50"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user