diff --git a/.storage/lovelace.ender5_printer b/.storage/lovelace.ender5_printer index 806a2122..8577849b 100644 --- a/.storage/lovelace.ender5_printer +++ b/.storage/lovelace.ender5_printer @@ -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
\n
\n \n Nozzle\n
\n ${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'}\n
\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
\n
\n \n Nozzle\n
\n ${v}\n ${s}\n
\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
\n
\n \n Print bed\n
\n ${Math.round(parseFloat(states['sensor.octoprint_bed_temperature']?.state) || 0) + '\\u00B0C / target ' + Math.round(parseFloat(states['sensor.octoprint_bed_target']?.state) || 0) + '\\u00B0C'}\n
\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
\n
\n \n Print bed\n
\n ${v}\n ${s}\n
\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
\n
\n \n Height\n
\n ${states['sensor.octoprint_current_z']?.state + ' mm'}\n
\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
\n
\n \n Height\n
\n ${v}\n ${s}\n
\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
\n ${label}\n ${value}\n
`;\n return `\n
\n
\n \n Diagnostics\n
\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
\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
\n ${label}\n ${value}\n
`;\n return `\n
\n
\n \n Diagnostics\n
\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
\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" + } + ] + } + } + ] } ] } - } + ] } ] } diff --git a/zigbee2mqtt/state.json b/zigbee2mqtt/state.json index 60b13dc7..f2a3c59d 100644 --- a/zigbee2mqtt/state.json +++ b/zigbee2mqtt/state.json @@ -4,7 +4,7 @@ "state": "ON", "led_brightness": 100, "countdown_to_turn_off": 0, - "voltage": 122, + "voltage": 121.3, "countdown_to_turn_on": 0, "ac_frequency": 60, "power_factor": 0.14, @@ -27,10 +27,10 @@ "led_brightness": 100, "countdown_to_turn_off": 0, "countdown_to_turn_on": 0, - "power": 229.4, - "current": 1.94, - "energy": 31.91, - "power_factor": 0.98, + "power": 600.5, + "current": 12.67, + "energy": 31.98, + "power_factor": 0.39, "update": { "state": "idle", "installed_version": 268513381, @@ -45,10 +45,10 @@ "state": "ON", "led_brightness": 100, "countdown_to_turn_off": 0, - "voltage": 121.5, + "voltage": 120.8, "countdown_to_turn_on": 0, - "energy": 63.21, - "power_factor": 0.3, + "energy": 63.22, + "power_factor": 0.89, "ac_frequency": 60, "update": { "state": "idle", @@ -58,8 +58,8 @@ "latest_release_notes": null }, "linkquality": 134, - "power": 0.2, - "current": 0.01, + "power": 84, + "current": 0.81, "power_on_behavior": "on" }, "0xb40e060fffe031e3": { @@ -74,13 +74,13 @@ "led_brightness": 100, "countdown_to_turn_off": 0, "countdown_to_turn_on": 0, - "voltage": 120.8, + "voltage": 121, "state": "ON", "ac_frequency": 60, - "energy": 127.97, - "power": 97.9, - "current": 0.89, - "power_factor": 0.94, + "energy": 127.98, + "power": 0.8, + "current": 0.05, + "power_factor": 0.36, "update": { "state": "idle", "installed_version": 268513381, @@ -95,11 +95,11 @@ "led_brightness": 100, "countdown_to_turn_off": 0, "countdown_to_turn_on": 0, - "voltage": 121.1, - "energy": 59.86, + "voltage": 117.4, + "energy": 59.87, "state": "ON", - "power": 49.3, - "current": 0.49, + "power": 37.7, + "current": 0.43, "ac_frequency": 60, "power_factor": 0.73, "update": { @@ -114,7 +114,7 @@ }, "0xffffb40e060895b3": { "state": "ON", - "voltage": 121.8, + "voltage": 121.3, "ac_frequency": 60, "energy": 8.78, "current": 0.01, @@ -136,7 +136,7 @@ "0xffffb40e0608864e": { "led_brightness": 100, "countdown_to_turn_off": 0, - "voltage": 122.6, + "voltage": 122.5, "energy": 19.46, "countdown_to_turn_on": 0, "state": "ON", @@ -172,7 +172,7 @@ "0xffffb40e060893d8": { "state": "ON", "led_brightness": 100, - "voltage": 122.8, + "voltage": 122.7, "countdown_to_turn_off": 0, "countdown_to_turn_on": 0, "energy": 3.17, @@ -187,12 +187,12 @@ "latest_source": "https://raw.githubusercontent.com/Koenkk/zigbee-OTA/master/images/ThirdReality/SmartPlug_Zigbee_PROD_OTA_V101_1.01.01.ota", "latest_release_notes": null }, - "power_factor": 0.12, + "power_factor": 0.06, "power": 0.1 }, "0xa4c1380d0679ffff": { "battery": 100, - "temperature": 27.9, + "temperature": 27.8, "temperature_units": "celsius", "temperature_calibration": 0, "update": { @@ -245,7 +245,7 @@ }, "0xb40e060fffe717c5": { "battery": 100, - "occupancy": true, + "occupancy": false, "tamper": false, "battery_low": false, "linkquality": 72,