{ "annotations": { "list": [ { "builtIn": 1, "datasource": { "type": "grafana", "uid": "-- Grafana --" }, "enable": true, "hide": true, "iconColor": "rgba(0, 211, 255, 1)", "name": "Annotations & Alerts", "type": "dashboard" } ] }, "editable": true, "fiscalYearStartMonth": 0, "graphTooltip": 0, "id": null, "links": [], "liveNow": true, "panels": [ { "collapsed": true, "gridPos": { "h": 1, "w": 24, "x": 0, "y": 0 }, "id": 2, "panels": [ { "description": "", "fieldConfig": { "defaults": {}, "overrides": [] }, "gridPos": { "h": 5, "w": 16, "x": 0, "y": 2302 }, "id": 3, "options": { "code": { "language": "plaintext", "showLineNumbers": false, "showMiniMap": false }, "content": "## Odoo dice qué orden está en curso. MESAVAULT muestra qué hizo realmente la máquina.\n\nLa demo convierte eventos de máquina en pérdidas, coste económico y acciones concretas:\n\n**dato → pérdida → euros → acción**", "mode": "markdown" }, "pluginVersion": "12.3.2", "title": "Odoo vs máquina", "type": "text" } ], "title": "Mensaje de negocio", "type": "row" }, { "collapsed": true, "gridPos": { "h": 1, "w": 24, "x": 0, "y": 1 }, "id": 4, "panels": [ { "datasource": { "type": "grafana-postgresql-datasource", "uid": "bfnbcasbm6hhca" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "mappings": [], "min": -1, "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": 0 }, { "color": "red", "value": 80 } ] }, "unit": "horas" }, "overrides": [] }, "gridPos": { "h": 6, "w": 4, "x": 0, "y": 247 }, "id": 5, "options": { "colorMode": "value", "graphMode": "area", "justifyMode": "auto", "orientation": "auto", "percentChangeColorMode": "standard", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "showPercentChange": false, "textMode": "auto", "wideLayout": true }, "pluginVersion": "12.3.2", "targets": [ { "dataset": "mesavault_hot", "datasource": { "type": "grafana-postgresql-datasource", "uid": "bfnbcasbm6hhca" }, "editorMode": "code", "format": "table", "rawQuery": true, "rawSql": "SELECT\r\n value AS \"Horas analizadas\"\r\nFROM mv_hot.edge_oee_kpi_cards_demo\r\nWHERE kpi = 'Horas analizadas';", "refId": "A", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } } ], "title": "Horas analizadas", "type": "stat" }, { "datasource": { "type": "grafana-postgresql-datasource", "uid": "bfnbcasbm6hhca" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": 0 }, { "color": "red", "value": 80 } ] }, "unit": "horas" }, "overrides": [] }, "gridPos": { "h": 6, "w": 4, "x": 4, "y": 247 }, "id": 6, "options": { "colorMode": "value", "graphMode": "area", "justifyMode": "auto", "orientation": "auto", "percentChangeColorMode": "standard", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "showPercentChange": false, "textMode": "auto", "wideLayout": true }, "pluginVersion": "12.3.2", "targets": [ { "dataset": "mesavault_hot", "datasource": { "type": "grafana-postgresql-datasource", "uid": "bfnbcasbm6hhca" }, "editorMode": "code", "format": "table", "rawQuery": true, "rawSql": "SELECT\r\n value AS \"Pérdidas clasificadas\"\r\nFROM mv_hot.edge_oee_kpi_cards_demo\r\nWHERE kpi = 'Pérdidas clasificadas';", "refId": "A", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } } ], "title": "Pérdidas clasificadas", "type": "stat" }, { "datasource": { "type": "grafana-postgresql-datasource", "uid": "bfnbcasbm6hhca" }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": 0 }, { "color": "red", "value": 80 } ] }, "unit": "currencyEUR" }, "overrides": [] }, "gridPos": { "h": 6, "w": 4, "x": 8, "y": 247 }, "id": 7, "options": { "colorMode": "value", "graphMode": "area", "justifyMode": "auto", "orientation": "auto", "percentChangeColorMode": "standard", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "showPercentChange": false, "textMode": "auto", "wideLayout": true }, "pluginVersion": "12.3.2", "targets": [ { "dataset": "mesavault_hot", "datasource": { "type": "grafana-postgresql-datasource", "uid": "bfnbcasbm6hhca" }, "editorMode": "code", "format": "table", "rawQuery": true, "rawSql": "SELECT\r\n value AS \"Coste estimado\"\r\nFROM mv_hot.edge_oee_kpi_cards_demo\r\nWHERE kpi = 'Coste estimado de pérdidas';", "refId": "A", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } } ], "title": "Coste estimado de pérdidas", "type": "stat" }, { "datasource": { "type": "grafana-postgresql-datasource", "uid": "bfnbcasbm6hhca" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": 0 }, { "color": "red", "value": 80 } ] } }, "overrides": [] }, "gridPos": { "h": 6, "w": 4, "x": 12, "y": 247 }, "id": 8, "options": { "colorMode": "value", "graphMode": "area", "justifyMode": "auto", "orientation": "auto", "percentChangeColorMode": "standard", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "showPercentChange": false, "textMode": "auto", "wideLayout": true }, "pluginVersion": "12.3.2", "targets": [ { "dataset": "mesavault_hot", "datasource": { "type": "grafana-postgresql-datasource", "uid": "bfnbcasbm6hhca" }, "editorMode": "code", "format": "table", "rawQuery": true, "rawSql": "SELECT\r\n value AS \"Discrepancias\"\r\nFROM mv_hot.edge_oee_kpi_cards_demo\r\nWHERE kpi = 'Órdenes con discrepancia Odoo/máquina';", "refId": "A", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } } ], "title": "Discrepancias Odoo/máquina", "type": "stat" }, { "datasource": { "type": "grafana-postgresql-datasource", "uid": "bfnbcasbm6hhca" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "fillOpacity": 80, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineWidth": 1, "scaleDistribution": { "type": "linear" }, "thresholdsStyle": { "mode": "off" } }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": 0 } ] }, "unit": "currencyEUR" }, "overrides": [] }, "gridPos": { "h": 10, "w": 16, "x": 0, "y": 931 }, "id": 9, "options": { "barRadius": 0, "barWidth": 0.8, "fullHighlight": false, "groupWidth": 0.7, "legend": { "calcs": [], "displayMode": "list", "placement": "bottom", "showLegend": true }, "orientation": "auto", "showValue": "auto", "stacking": "none", "tooltip": { "hideZeros": false, "mode": "single", "sort": "none" }, "xField": "Causa", "xTickLabelRotation": 0, "xTickLabelSpacing": 0 }, "pluginVersion": "12.3.2", "targets": [ { "dataset": "mesavault_hot", "datasource": { "type": "grafana-postgresql-datasource", "uid": "bfnbcasbm6hhca" }, "editorMode": "code", "format": "table", "rawQuery": true, "rawSql": "SELECT\r\n cause AS \"Causa\",\r\n monthly_cost_eur AS \"Coste €/mes\"\r\nFROM mv_hot.edge_oee_pareto_demo\r\nORDER BY ranking;", "refId": "A", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } } ], "title": "Pareto económico de pérdidas", "type": "barchart" }, { "datasource": { "type": "grafana-postgresql-datasource", "uid": "bfnbcasbm6hhca" }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "custom": { "align": "auto", "cellOptions": { "type": "auto" }, "footer": { "reducers": [] }, "inspect": false }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": 0 }, { "color": "red", "value": 80 } ] } }, "overrides": [ { "matcher": { "id": "byName", "options": "Ranking" }, "properties": [ { "id": "custom.width", "value": 67 } ] }, { "matcher": { "id": "byName", "options": "Causa" }, "properties": [ { "id": "custom.width", "value": 216 } ] }, { "matcher": { "id": "byName", "options": "Horas/mes" }, "properties": [ { "id": "custom.width", "value": 87 } ] }, { "matcher": { "id": "byName", "options": "Coste €/mes" }, "properties": [ { "id": "custom.width", "value": 100 } ] }, { "matcher": { "id": "byName", "options": "Acción recomendada" }, "properties": [ { "id": "custom.width", "value": 410 } ] }, { "matcher": { "id": "byName", "options": "Esfuerzo" }, "properties": [ { "id": "custom.width", "value": 112 } ] }, { "matcher": { "id": "byName", "options": "Prioridad" }, "properties": [ { "id": "custom.width", "value": 106 } ] } ] }, "gridPos": { "h": 3, "w": 16, "x": 0, "y": 941 }, "id": 10, "options": { "cellHeight": "sm", "showHeader": true, "sortBy": [] }, "pluginVersion": "12.3.2", "targets": [ { "dataset": "mesavault_hot", "datasource": { "type": "grafana-postgresql-datasource", "uid": "bfnbcasbm6hhca" }, "editorMode": "code", "format": "table", "rawQuery": true, "rawSql": "SELECT\r\n ranking AS \"Ranking\",\r\n cause AS \"Causa\",\r\n hours_month AS \"Horas/mes\",\r\n monthly_cost_eur AS \"Coste €/mes\",\r\n recommended_action AS \"Acción recomendada\",\r\n effort AS \"Esfuerzo\",\r\n priority AS \"Prioridad\",\r\n machine_focus AS \"Máquina foco\"\r\nFROM mv_hot.edge_oee_pareto_demo\r\nORDER BY ranking;", "refId": "A", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } } ], "title": "", "type": "table" }, { "datasource": { "type": "grafana-postgresql-datasource", "uid": "bfnbcasbm6hhca" }, "fieldConfig": { "defaults": { "color": { "mode": "continuous-GrYlRd" }, "custom": { "axisPlacement": "auto", "fillOpacity": 70, "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "insertNulls": false, "lineWidth": 0, "spanNulls": false }, "mappings": [ { "options": { "0": { "index": 0, "text": "Sin evento" }, "10": { "index": 1, "text": "Orden activa en Odoo" }, "20": { "index": 2, "text": "Preparación / búsqueda de bobina" }, "30": { "index": 3, "text": "Marcha real" }, "40": { "index": 4, "text": "Microparos" }, "50": { "index": 5, "text": "Cambio bobina" }, "60": { "index": 6, "text": "Paro" }, "90": { "index": 7, "text": "Otro evento" } }, "type": "value" } ], "thresholds": { "mode": "absolute", "steps": [ { "color": "purple", "value": 0 } ] } }, "overrides": [] }, "gridPos": { "h": 5, "w": 16, "x": 0, "y": 944 }, "id": 11, "options": { "alignValue": "left", "legend": { "displayMode": "list", "placement": "bottom", "showLegend": true }, "mergeValues": true, "rowHeight": 0.9, "showValue": "auto", "tooltip": { "hideZeros": false, "mode": "single", "sort": "none" } }, "pluginVersion": "12.3.2", "targets": [ { "dataset": "mesavault_hot", "datasource": { "type": "grafana-postgresql-datasource", "uid": "bfnbcasbm6hhca" }, "editorMode": "code", "format": "time_series", "rawQuery": true, "rawSql": "WITH odoo AS (\r\n SELECT\r\n o.odoo_start AS time,\r\n 'Odoo / OF00481' AS metric,\r\n 10::numeric AS value\r\n FROM mv_hot.edge_oee_orders_demo o\r\n WHERE o.order_id = 'OF00481'\r\n\r\n UNION ALL\r\n\r\n SELECT\r\n o.odoo_end + interval '1 second' AS time,\r\n 'Odoo / OF00481' AS metric,\r\n 0::numeric AS value\r\n FROM mv_hot.edge_oee_orders_demo o\r\n WHERE o.order_id = 'OF00481'\r\n),\r\n\r\nmachine_start AS (\r\n SELECT\r\n e.start_time AS time,\r\n 'Cortadora 0 / realidad máquina' AS metric,\r\n CASE\r\n WHEN e.event_type = 'PREPARATION' THEN 20\r\n WHEN e.event_type = 'RUNNING' THEN 30\r\n WHEN e.event_type = 'MICROSTOP' THEN 40\r\n WHEN e.event_type = 'STOP' AND e.cause = 'Cambio bobina' THEN 50\r\n WHEN e.event_type = 'STOP' THEN 60\r\n ELSE 90\r\n END::numeric AS value\r\n FROM mv_hot.edge_oee_events_demo e\r\n WHERE e.order_id = 'OF00481'\r\n),\r\n\r\nmachine_end AS (\r\n SELECT\r\n e.end_time + interval '1 second' AS time,\r\n 'Cortadora 0 / realidad máquina' AS metric,\r\n 0::numeric AS value\r\n FROM mv_hot.edge_oee_events_demo e\r\n WHERE e.order_id = 'OF00481'\r\n)\r\n\r\nSELECT\r\n time AS \"time\",\r\n metric,\r\n value\r\nFROM (\r\n SELECT * FROM odoo\r\n UNION ALL\r\n SELECT * FROM machine_start\r\n UNION ALL\r\n SELECT * FROM machine_end\r\n) q\r\nORDER BY \"time\", metric;", "refId": "A", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } } ], "title": "OF00481 — Odoo inicia orden, máquina arranca 22 min después", "type": "state-timeline" }, { "datasource": { "type": "grafana-postgresql-datasource", "uid": "bfnbcasbm6hhca" }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "custom": { "align": "auto", "cellOptions": { "type": "auto" }, "footer": { "reducers": [] }, "inspect": false }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": 0 }, { "color": "red", "value": 80 } ] } }, "overrides": [ { "matcher": { "id": "byName", "options": "Indicador" }, "properties": [ { "id": "custom.width", "value": 279 } ] }, { "matcher": { "id": "byName", "options": "Valor" }, "properties": [ { "id": "custom.width", "value": 50 } ] }, { "matcher": { "id": "byName", "options": "Unidad" }, "properties": [ { "id": "custom.width", "value": 67 } ] }, { "matcher": { "id": "byName", "options": "Estado" }, "properties": [ { "id": "custom.width", "value": 68 } ] }, { "matcher": { "id": "byName", "options": "Qué está mal" }, "properties": [ { "id": "custom.width", "value": 397 } ] }, { "matcher": { "id": "byName", "options": "Impacto probable" }, "properties": [ { "id": "custom.width", "value": 489 } ] }, { "matcher": { "id": "byName", "options": "Qué revisar / acción" }, "properties": [ { "id": "custom.width", "value": 388 } ] } ] }, "gridPos": { "h": 12, "w": 16, "x": 0, "y": 949 }, "id": 12, "options": { "cellHeight": "sm", "showHeader": true }, "pluginVersion": "12.3.2", "targets": [ { "dataset": "mesavault_hot", "datasource": { "type": "grafana-postgresql-datasource", "uid": "bfnbcasbm6hhca" }, "editorMode": "code", "format": "table", "rawQuery": true, "rawSql": "SELECT\r\n \"Indicador\",\r\n \"Valor\",\r\n \"Unidad\",\r\n \"Estado\",\r\n \"Qué está mal\",\r\n \"Impacto probable\",\r\n \"Qué revisar / acción\"\r\nFROM mv_hot.edge_oee_data_quality_dashboard_demo\r\nORDER BY sort_order;", "refId": "A", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } } ], "title": "Calidad del dato Odoo / máquina", "type": "table" }, { "datasource": { "type": "grafana-postgresql-datasource", "uid": "bfnbcasbm6hhca" }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "custom": { "align": "auto", "cellOptions": { "type": "auto" }, "footer": { "reducers": [] }, "inspect": false }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": 0 }, { "color": "red", "value": 80 } ] } }, "overrides": [ { "matcher": { "id": "byName", "options": "time" }, "properties": [ { "id": "custom.width", "value": 158 } ] }, { "matcher": { "id": "byName", "options": "A-series" }, "properties": [ { "id": "custom.width", "value": 69 } ] }, { "matcher": { "id": "byName", "options": "Causa" }, "properties": [ { "id": "custom.width", "value": 177 } ] }, { "matcher": { "id": "byName", "options": "Impacto estimado €/mes" }, "properties": [ { "id": "custom.width", "value": 182 } ] }, { "matcher": { "id": "byName", "options": "Esfuerzo" }, "properties": [ { "id": "custom.width", "value": 73 } ] }, { "matcher": { "id": "byName", "options": "Prioridad" }, "properties": [ { "id": "custom.width", "value": 75 } ] }, { "matcher": { "id": "byName", "options": "Payback ejemplo meses" }, "properties": [ { "id": "custom.width", "value": 177 } ] }, { "matcher": { "id": "byName", "options": "Inversión ejemplo €" }, "properties": [ { "id": "custom.width", "value": 146 } ] }, { "matcher": { "id": "byName", "options": "Acción recomendada" }, "properties": [ { "id": "custom.width", "value": 410 } ] } ] }, "gridPos": { "h": 10, "w": 16, "x": 0, "y": 961 }, "id": 13, "options": { "cellHeight": "sm", "showHeader": true, "sortBy": [] }, "pluginVersion": "12.3.2", "targets": [ { "dataset": "mesavault_hot", "datasource": { "type": "grafana-postgresql-datasource", "uid": "bfnbcasbm6hhca" }, "editorMode": "code", "format": "table", "rawQuery": true, "rawSql": "SELECT\r\n \"Causa\",\r\n \"Impacto estimado €/mes\",\r\n \"Esfuerzo\",\r\n \"Prioridad\",\r\n \"Acción recomendada\",\r\n \"Inversión ejemplo €\",\r\n \"Payback ejemplo meses\"\r\nFROM mv_hot.edge_oee_actions_demo;", "refId": "A", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } } ], "title": "Acciones recomendadas", "type": "table" }, { "datasource": { "type": "grafana-postgresql-datasource", "uid": "bfnbcasbm6hhca" }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "custom": { "align": "auto", "cellOptions": { "type": "auto" }, "footer": { "reducers": [] }, "inspect": false }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": 0 }, { "color": "red", "value": 80 } ] } }, "overrides": [ { "matcher": { "id": "byName", "options": "Orden" }, "properties": [ { "id": "custom.width", "value": 76 } ] }, { "matcher": { "id": "byName", "options": "Máquina" }, "properties": [ { "id": "custom.width", "value": 93 } ] }, { "matcher": { "id": "byName", "options": "Producto" }, "properties": [ { "id": "custom.width", "value": 115 } ] }, { "matcher": { "id": "byName", "options": "Reclamación" }, "properties": [ { "id": "custom.width", "value": 99 } ] }, { "matcher": { "id": "byName", "options": "Microparos" }, "properties": [ { "id": "custom.width", "value": 90 } ] }, { "matcher": { "id": "byName", "options": "Merma %" }, "properties": [ { "id": "custom.width", "value": 78 } ] }, { "matcher": { "id": "byName", "options": "Energía vs media %" }, "properties": [ { "id": "custom.width", "value": 147 } ] }, { "matcher": { "id": "byName", "options": "Interpretación" }, "properties": [ { "id": "custom.width", "value": 889 } ] }, { "matcher": { "id": "byName", "options": "Acción recomendada" }, "properties": [ { "id": "custom.width", "value": 949 } ] } ] }, "gridPos": { "h": 9, "w": 16, "x": 0, "y": 971 }, "id": 14, "options": { "cellHeight": "sm", "showHeader": true, "sortBy": [] }, "pluginVersion": "12.3.2", "targets": [ { "dataset": "mesavault_hot", "datasource": { "type": "grafana-postgresql-datasource", "uid": "bfnbcasbm6hhca" }, "editorMode": "code", "format": "table", "rawQuery": true, "rawSql": "SELECT\r\n order_id AS \"Orden\",\r\n machine_name AS \"Máquina\",\r\n product AS \"Producto\",\r\n claim AS \"Reclamación\",\r\n sealing_adjustment_stops AS \"Paros ajuste sellado\",\r\n sealing_adjustment_min AS \"Min ajuste sellado\",\r\n microstops_count AS \"Microparos\",\r\n scrap_pct AS \"Merma %\",\r\n energy_vs_avg_pct AS \"Energía vs media %\",\r\n interpretation AS \"Interpretación\",\r\n recommended_action AS \"Acción recomendada\"\r\nFROM mv_hot.edge_oee_quality_case_demo;", "refId": "A", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } } ], "title": "Caso calidad — Sellado débil OF00493", "type": "table" }, { "datasource": { "type": "grafana-postgresql-datasource", "uid": "bfnbcasbm6hhca" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 0, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "insertNulls": false, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "auto", "showValues": false, "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": 0 }, { "color": "red", "value": 80 } ] }, "unit": "kwatt" }, "overrides": [] }, "gridPos": { "h": 8, "w": 16, "x": 0, "y": 980 }, "id": 15, "options": { "legend": { "calcs": [], "displayMode": "list", "placement": "bottom", "showLegend": true }, "tooltip": { "hideZeros": false, "mode": "single", "sort": "none" } }, "pluginVersion": "12.3.2", "targets": [ { "dataset": "mesavault_hot", "datasource": { "type": "grafana-postgresql-datasource", "uid": "bfnbcasbm6hhca" }, "editorMode": "code", "format": "table", "rawQuery": true, "rawSql": "SELECT\r\n ts AS \"time\",\r\n power_kw AS \"Potencia kW\"\r\nFROM mv_hot.edge_oee_energy_demo\r\nWHERE machine_id = 'C2'\r\nORDER BY ts;", "refId": "A", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } } ], "title": "Energía durante OF00493 — Cortadora 2", "type": "timeseries" } ], "title": "KPIs de dirección", "type": "row" }, { "collapsed": false, "gridPos": { "h": 1, "w": 24, "x": 0, "y": 2 }, "id": 30, "panels": [], "title": "OEE — CORTADORA 01", "type": "row" }, { "datasource": { "type": "grafana-postgresql-datasource", "uid": "bfnbcasbm6hhca" }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "red", "value": 0 }, { "color": "green", "value": 80 } ] }, "unit": "percent" }, "overrides": [] }, "gridPos": { "h": 4, "w": 9, "x": 0, "y": 3 }, "id": 39, "options": { "colorMode": "value", "graphMode": "area", "justifyMode": "auto", "orientation": "auto", "percentChangeColorMode": "standard", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "showPercentChange": false, "textMode": "auto", "wideLayout": true }, "pluginVersion": "12.3.2", "targets": [ { "dataset": "mesavault_hot", "editorMode": "code", "format": "table", "rawQuery": true, "rawSql": "SELECT\r\n oee_pct AS \"OEE %\",\r\n availability_pct AS \"Disponibilidad %\",\r\n performance_pct AS \"Rendimiento %\",\r\n quality_pct AS \"Calidad %\"\r\nFROM mv_reports_ucepsa_demo.oee_kpis(\r\n $__timeFrom()::timestamptz,\r\n $__timeTo()::timestamptz\r\n);", "refId": "A", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } } ], "title": "OEE", "type": "stat" }, { "datasource": { "type": "grafana-postgresql-datasource", "uid": "bfnbcasbm6hhca" }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "decimals": 1, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "text", "value": 0 } ] } }, "overrides": [] }, "gridPos": { "h": 4, "w": 10, "x": 9, "y": 3 }, "id": 31, "options": { "colorMode": "value", "graphMode": "area", "justifyMode": "auto", "orientation": "auto", "percentChangeColorMode": "standard", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "showPercentChange": false, "textMode": "auto", "wideLayout": true }, "pluginVersion": "12.3.2", "targets": [ { "dataset": "mesavault_hot", "editorMode": "code", "format": "table", "rawQuery": true, "rawSql": "SELECT\r\n running_min AS \"Min marcha\",\r\n stop_min AS \"Min paro\",\r\n actual_cycles AS \"Ciclos\"\r\nFROM mv_reports_ucepsa_demo.oee_operational_data(\r\n $__timeFrom()::timestamptz,\r\n $__timeTo()::timestamptz\r\n);", "refId": "A", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } } ], "title": "Datos operativos", "type": "stat" }, { "datasource": { "type": "grafana-postgresql-datasource", "uid": "bfnbcasbm6hhca" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "fillOpacity": 80, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineWidth": 1, "scaleDistribution": { "type": "linear" }, "thresholdsStyle": { "mode": "off" } }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": 0 }, { "color": "red", "value": 80 } ] } }, "overrides": [] }, "gridPos": { "h": 9, "w": 19, "x": 0, "y": 7 }, "id": 37, "options": { "barRadius": 0, "barWidth": 0.97, "fullHighlight": false, "groupWidth": 0.7, "legend": { "calcs": [], "displayMode": "list", "placement": "bottom", "showLegend": true }, "orientation": "auto", "showValue": "auto", "stacking": "none", "tooltip": { "hideZeros": false, "mode": "single", "sort": "none" }, "xTickLabelRotation": 0, "xTickLabelSpacing": 0 }, "pluginVersion": "12.3.2", "targets": [ { "dataset": "mesavault_hot", "editorMode": "code", "format": "table", "rawQuery": true, "rawSql": "SELECT\r\n COALESCE(cause_name, 'Pendiente de clasificar') AS \"Causa\",\r\n ROUND(SUM(cost_eur)::numeric, 2) AS \"Coste €\",\r\n ROUND(SUM(duration_min)::numeric, 2) AS \"Minutos\"\r\nFROM mv_reports_ucepsa_demo.stops_recent\r\nWHERE machine_id = 'CORT-01'\r\n AND $__timeFilter(started_at)\r\nGROUP BY COALESCE(cause_name, 'Pendiente de clasificar')\r\nORDER BY \"Coste €\" DESC;", "refId": "A", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } } ], "title": "Pérdida real por causa", "type": "barchart" }, { "datasource": { "type": "grafana-postgresql-datasource", "uid": "bfnbcasbm6hhca" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 0, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "insertNulls": false, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "auto", "showValues": false, "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": 0 }, { "color": "red", "value": 80 } ] } }, "overrides": [] }, "gridPos": { "h": 6, "w": 19, "x": 0, "y": 16 }, "id": 33, "options": { "legend": { "calcs": [], "displayMode": "list", "placement": "bottom", "showLegend": true }, "tooltip": { "hideZeros": false, "mode": "single", "sort": "none" } }, "pluginVersion": "12.3.2", "targets": [ { "dataset": "mesavault_hot", "editorMode": "code", "format": "table", "rawQuery": true, "rawSql": "SELECT\r\n ts AS \"time\",\r\n cycle_rate_ppm AS \"Ciclos/min\",\r\n 10.0 AS \"Objetivo ciclos/min\"\r\nFROM mv_hot.edge_oee_live_telemetry\r\nWHERE $__timeFilter(ts)\r\n AND asset = 'revpi_oee_node_01'\r\n AND cycle_rate_ppm IS NOT NULL\r\nORDER BY ts;", "refId": "A", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } } ], "title": "Velocidad real — ciclos/min", "type": "timeseries" }, { "datasource": { "type": "grafana-postgresql-datasource", "uid": "bfnbcasbm6hhca" }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "custom": { "align": "auto", "cellOptions": { "type": "auto" }, "footer": { "reducers": [] }, "inspect": false }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": 0 }, { "color": "red", "value": 80 } ] } }, "overrides": [ { "matcher": { "id": "byName", "options": "ID" }, "properties": [ { "id": "custom.width", "value": 50 } ] } ] }, "gridPos": { "h": 6, "w": 19, "x": 0, "y": 22 }, "id": 36, "options": { "cellHeight": "sm", "showHeader": true, "sortBy": [] }, "pluginVersion": "12.3.2", "targets": [ { "dataset": "mesavault_hot", "editorMode": "code", "format": "table", "rawQuery": true, "rawSql": "SELECT\r\n id AS \"ID\",\r\n machine_id AS \"Máquina\",\r\n started_at AS \"Inicio\",\r\n ended_at AS \"Fin\",\r\n status AS \"Estado\",\r\n classification_status AS \"Clasificación\",\r\n COALESCE(cause_name, 'Pendiente') AS \"Causa\",\r\n operator_note AS \"Nota\",\r\n duration_min AS \"Duración min\",\r\n cost_eur AS \"Coste €\"\r\nFROM mv_hot.edge_oee_stops_recent\r\nWHERE $__timeFilter(started_at)\r\nORDER BY started_at DESC\r\nLIMIT 20;", "refId": "A", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } } ], "title": "Últimos paros clasificados / pendientes", "type": "table" }, { "collapsed": false, "gridPos": { "h": 1, "w": 24, "x": 0, "y": 28 }, "id": 55, "panels": [], "title": "Odoo vs máquina — Cortadora 01", "type": "row" }, { "datasource": { "type": "grafana-postgresql-datasource", "uid": "bfnbcasbm6hhca" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "mappings": [ { "options": { "0": { "color": "green", "index": 0, "text": "OK" }, "2": { "color": "red", "index": 1, "text": "Discrepancia" }, "3": { "color": "purple", "index": 2, "text": "Sin Telemetría" } }, "type": "value" } ], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": 0 } ] } }, "overrides": [] }, "gridPos": { "h": 5, "w": 4, "x": 0, "y": 29 }, "id": 57, "options": { "colorMode": "value", "graphMode": "area", "justifyMode": "auto", "orientation": "auto", "percentChangeColorMode": "standard", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "showPercentChange": false, "textMode": "auto", "wideLayout": true }, "pluginVersion": "12.3.2", "targets": [ { "dataset": "mesavault_hot", "editorMode": "code", "format": "table", "rawQuery": true, "rawSql": "SELECT\r\n CASE\r\n WHEN status_check IN ('OK', 'ORDEN_PREPARADA_MAQUINA_PARADA') THEN 0\r\n WHEN status_check = 'SIN_TELEMETRIA' THEN 3\r\n ELSE 2\r\n END AS \"Estado cruce\"\r\nFROM mv_reports_ucepsa_demo.odoo_vs_machine_demo;", "refId": "A", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } } ], "title": "Discrepancias Odoo/máquina", "type": "stat" }, { "datasource": { "type": "grafana-postgresql-datasource", "uid": "bfnbcasbm6hhca" }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [], "noValue": "No iniciada", "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": 0 }, { "color": "red", "value": 80 } ] }, "unit": "m" }, "overrides": [] }, "gridPos": { "h": 5, "w": 4, "x": 4, "y": 29 }, "id": 58, "options": { "colorMode": "value", "graphMode": "area", "justifyMode": "auto", "orientation": "auto", "percentChangeColorMode": "standard", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "showPercentChange": false, "textMode": "auto", "wideLayout": true }, "pluginVersion": "12.3.2", "targets": [ { "dataset": "mesavault_hot", "editorMode": "code", "format": "table", "rawQuery": true, "rawSql": "SELECT\r\n CASE\r\n WHEN odoo_is_started = true THEN start_delay_min\r\n ELSE NULL\r\n END AS \"Retraso inicio real\"\r\nFROM mv_reports_ucepsa_demo.odoo_vs_machine_demo;", "refId": "A", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } } ], "title": "Retraso inicio real", "type": "stat" }, { "datasource": { "type": "grafana-postgresql-datasource", "uid": "bfnbcasbm6hhca" }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "decimals": 2, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": 0 }, { "color": "red", "value": 0.1 } ] } }, "overrides": [] }, "gridPos": { "h": 5, "w": 7, "x": 0, "y": 34 }, "id": 59, "options": { "colorMode": "value", "graphMode": "area", "justifyMode": "auto", "orientation": "auto", "percentChangeColorMode": "standard", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "showPercentChange": false, "textMode": "auto", "wideLayout": true }, "pluginVersion": "12.3.2", "targets": [ { "dataset": "mesavault_hot", "editorMode": "code", "format": "table", "rawQuery": true, "rawSql": "SELECT\r\n stop_min AS \"Min paro en orden\",\r\n stop_cost_eur AS \"Coste paro en orden\"\r\nFROM mv_reports_ucepsa_demo.odoo_vs_machine_demo;", "refId": "A", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } } ], "title": "Paros dentro de orden", "type": "stat" }, { "datasource": { "type": "grafana-postgresql-datasource", "uid": "bfnbcasbm6hhca" }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "text", "value": 0 } ] } }, "overrides": [] }, "gridPos": { "h": 5, "w": 9, "x": 7, "y": 34 }, "id": 60, "options": { "colorMode": "value", "graphMode": "area", "justifyMode": "auto", "orientation": "auto", "percentChangeColorMode": "standard", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "showPercentChange": false, "textMode": "auto", "wideLayout": true }, "pluginVersion": "12.3.2", "targets": [ { "dataset": "mesavault_hot", "editorMode": "code", "format": "table", "rawQuery": true, "rawSql": "SELECT\r\n real_cycles AS \"Ciclos reales\",\r\n planned_cycles AS \"Ciclos planificados\",\r\n cycle_completion_pct AS \"% avance ciclos\"\r\nFROM mv_reports_ucepsa_demo.odoo_vs_machine_demo;", "refId": "A", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } } ], "title": "Ciclos reales vs planificados", "type": "stat" }, { "datasource": { "type": "grafana-postgresql-datasource", "uid": "bfnbcasbm6hhca" }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "custom": { "align": "auto", "cellOptions": { "type": "auto" }, "footer": { "reducers": [] }, "inspect": false }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": 0 }, { "color": "red", "value": 80 } ] } }, "overrides": [ { "matcher": { "id": "byName", "options": "Orden Odoo" }, "properties": [ { "id": "custom.width", "value": 112 } ] }, { "matcher": { "id": "byName", "options": "Producto" }, "properties": [ { "id": "custom.width", "value": 260 } ] }, { "matcher": { "id": "byName", "options": "Estado" }, "properties": [ { "id": "custom.width", "value": 72 } ] }, { "matcher": { "id": "byName", "options": "Máquina" }, "properties": [ { "id": "custom.width", "value": 72 } ] } ] }, "gridPos": { "h": 4, "w": 24, "x": 0, "y": 39 }, "id": 56, "options": { "cellHeight": "sm", "showHeader": true, "sortBy": [] }, "pluginVersion": "12.3.2", "targets": [ { "dataset": "mesavault_hot", "editorMode": "code", "format": "table", "rawQuery": true, "rawSql": "SELECT\r\n odoo_order_ref AS \"Orden Odoo\",\r\n product AS \"Producto\",\r\n odoo_state AS \"Estado\",\r\n machine_id AS \"Máquina\",\r\n CASE\r\n WHEN odoo_is_started = true THEN to_char(odoo_start, 'YYYY-MM-DD HH24:MI:SS')\r\n ELSE 'No iniciada'\r\n END AS \"Inicio Odoo\"\r\nFROM mv_reports_ucepsa_demo.odoo_current_order_demo;", "refId": "A", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } } ], "title": "Orden Odoo seleccionada", "type": "table" }, { "datasource": { "type": "grafana-postgresql-datasource", "uid": "bfnbcasbm6hhca" }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "custom": { "align": "auto", "cellOptions": { "type": "auto" }, "footer": { "reducers": [] }, "inspect": false }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": 0 }, { "color": "red", "value": 80 } ] } }, "overrides": [ { "matcher": { "id": "byName", "options": "Orden" }, "properties": [ { "id": "custom.width", "value": 115 } ] }, { "matcher": { "id": "byName", "options": "Estado Odoo" }, "properties": [ { "id": "custom.width", "value": 100 } ] }, { "matcher": { "id": "byName", "options": "Edad telemetría s" }, "properties": [ { "id": "custom.width", "value": 131 } ] }, { "matcher": { "id": "byName", "options": "Estado máquina" }, "properties": [ { "id": "custom.width", "value": 143 } ] }, { "matcher": { "id": "byName", "options": "Diagnóstico" }, "properties": [ { "id": "custom.width", "value": 330 } ] } ] }, "gridPos": { "h": 4, "w": 24, "x": 0, "y": 43 }, "id": 62, "options": { "cellHeight": "sm", "showHeader": true, "sortBy": [ { "desc": false, "displayName": "Estado máquina" } ] }, "pluginVersion": "12.3.2", "targets": [ { "dataset": "mesavault_hot", "editorMode": "code", "format": "table", "rawQuery": true, "rawSql": "SELECT\r\n odoo_order_ref AS \"Orden\",\r\n odoo_state AS \"Estado Odoo\",\r\n CASE\r\n WHEN machine_running THEN 'En marcha'\r\n ELSE 'Parada'\r\n END AS \"Estado máquina\",\r\n telemetry_age_s AS \"Edad telemetría s\",\r\n status_check AS \"Diagnóstico\"\r\nFROM mv_reports_ucepsa_demo.odoo_vs_machine_demo;", "refId": "A", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } } ], "title": "Estado Odoo / realidad", "type": "table" }, { "datasource": { "type": "grafana-postgresql-datasource", "uid": "bfnbcasbm6hhca" }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "custom": { "align": "auto", "cellOptions": { "type": "auto" }, "footer": { "reducers": [] }, "inspect": false }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": 0 }, { "color": "red", "value": 80 } ] } }, "overrides": [ { "matcher": { "id": "byName", "options": "Orden" }, "properties": [ { "id": "custom.width", "value": 115 } ] }, { "matcher": { "id": "byName", "options": "Hora chequeo" }, "properties": [ { "id": "custom.width", "value": 155 } ] }, { "matcher": { "id": "byName", "options": "Máquina" }, "properties": [ { "id": "custom.width", "value": 72 } ] }, { "matcher": { "id": "byName", "options": "Estado" }, "properties": [ { "id": "custom.width", "value": 331 } ] }, { "matcher": { "id": "byName", "options": "Descripción" }, "properties": [ { "id": "custom.width", "value": 633 } ] } ] }, "gridPos": { "h": 9, "w": 24, "x": 0, "y": 47 }, "id": 61, "options": { "cellHeight": "sm", "showHeader": true }, "pluginVersion": "12.3.2", "targets": [ { "dataset": "mesavault_hot", "editorMode": "code", "format": "table", "rawQuery": true, "rawSql": "SELECT\r\n checked_at AS \"Hora chequeo\",\r\n odoo_order_ref AS \"Orden\",\r\n product AS \"Producto\",\r\n machine_id AS \"Máquina\",\r\n status_check AS \"Estado\",\r\n descripcion AS \"Descripción\",\r\n start_delay_min AS \"Retraso min\",\r\n stop_count AS \"Nº paros\",\r\n stop_min AS \"Min paro\",\r\n stop_cost_eur AS \"Coste paro €\",\r\n cycle_completion_pct AS \"% avance ciclos\"\r\nFROM mv_reports_ucepsa_demo.odoo_discrepancies_demo;", "refId": "A", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } } ], "title": "Tabla de discrepancias", "type": "table" }, { "collapsed": true, "gridPos": { "h": 1, "w": 24, "x": 0, "y": 56 }, "id": 64, "panels": [ { "datasource": { "type": "grafana-postgresql-datasource", "uid": "bfnbcasbm6hhca" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "fillOpacity": 80, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineWidth": 1, "scaleDistribution": { "type": "linear" }, "thresholdsStyle": { "mode": "off" } }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": 0 }, { "color": "red", "value": 80 } ] }, "unit": "currencyEUR" }, "overrides": [] }, "gridPos": { "h": 9, "w": 11, "x": 0, "y": 248 }, "id": 66, "options": { "barRadius": 0, "barWidth": 0.97, "fullHighlight": false, "groupWidth": 0.7, "legend": { "calcs": [], "displayMode": "list", "placement": "bottom", "showLegend": true }, "orientation": "auto", "showValue": "auto", "stacking": "none", "tooltip": { "hideZeros": false, "mode": "single", "sort": "none" }, "xTickLabelRotation": 0, "xTickLabelSpacing": 0 }, "pluginVersion": "12.3.2", "targets": [ { "dataset": "mesavault_hot", "editorMode": "code", "format": "table", "rawQuery": true, "rawSql": "SELECT\r\n odoo_order_ref AS \"Orden\",\r\n stop_cost_eur AS \"Coste paro €\"\r\nFROM mv_reports_ucepsa_demo.odoo_workorders_reality_history\r\nWHERE stop_cost_eur > 0\r\nORDER BY stop_cost_eur DESC\r\nLIMIT 10;", "refId": "A", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } } ], "title": "Coste de paros por orden", "type": "barchart" }, { "datasource": { "type": "grafana-postgresql-datasource", "uid": "bfnbcasbm6hhca" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "fillOpacity": 80, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineWidth": 1, "scaleDistribution": { "type": "linear" }, "thresholdsStyle": { "mode": "off" } }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": 0 }, { "color": "red", "value": 80 } ] }, "unit": "m" }, "overrides": [ { "matcher": { "id": "byName", "options": "Min paro" }, "properties": [ { "id": "color", "value": { "fixedColor": "yellow", "mode": "fixed" } } ] } ] }, "gridPos": { "h": 9, "w": 13, "x": 11, "y": 248 }, "id": 67, "options": { "barRadius": 0, "barWidth": 0.97, "fullHighlight": false, "groupWidth": 0.7, "legend": { "calcs": [], "displayMode": "list", "placement": "bottom", "showLegend": true }, "orientation": "auto", "showValue": "auto", "stacking": "none", "tooltip": { "hideZeros": false, "mode": "single", "sort": "none" }, "xTickLabelRotation": 0, "xTickLabelSpacing": 0 }, "pluginVersion": "12.3.2", "targets": [ { "dataset": "mesavault_hot", "editorMode": "code", "format": "table", "rawQuery": true, "rawSql": "SELECT\r\n odoo_order_ref AS \"Orden\",\r\n stop_min AS \"Min paro\"\r\nFROM mv_reports_ucepsa_demo.odoo_workorders_reality_history\r\nWHERE stop_min > 0\r\nORDER BY stop_min DESC\r\nLIMIT 10;", "refId": "A", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } } ], "title": "Tiempo de paro por orden", "type": "barchart" }, { "datasource": { "type": "grafana-postgresql-datasource", "uid": "bfnbcasbm6hhca" }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "custom": { "align": "auto", "cellOptions": { "type": "auto" }, "footer": { "reducers": [] }, "inspect": false }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": 0 }, { "color": "red", "value": 80 } ] } }, "overrides": [] }, "gridPos": { "h": 4, "w": 24, "x": 0, "y": 257 }, "id": 63, "options": { "cellHeight": "sm", "showHeader": true }, "pluginVersion": "12.3.2", "targets": [ { "dataset": "mesavault_hot", "editorMode": "code", "format": "table", "rawQuery": true, "rawSql": "SELECT\r\n odoo_order_ref AS \"Orden\",\r\n product AS \"Producto\",\r\n odoo_state AS \"Estado\",\r\n machine_id AS \"Máquina\",\r\n odoo_start AS \"Inicio Odoo\",\r\n odoo_end AS \"Fin Odoo\",\r\n real_cycles AS \"Ciclos reales\",\r\n planned_cycles AS \"Ciclos planificados\",\r\n cycle_completion_pct AS \"% avance\",\r\n stop_count AS \"Nº paros\",\r\n stop_min AS \"Min paro\",\r\n stop_cost_eur AS \"Coste paro €\",\r\n status_check AS \"Diagnóstico\"\r\nFROM mv_reports_ucepsa_demo.odoo_last_finished_order_demo;", "refId": "A", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } } ], "title": "Última orden finalizada", "type": "table" }, { "datasource": { "type": "grafana-postgresql-datasource", "uid": "bfnbcasbm6hhca" }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "custom": { "align": "auto", "cellOptions": { "type": "auto" }, "footer": { "reducers": [] }, "inspect": false }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": 0 }, { "color": "red", "value": 80 } ] } }, "overrides": [] }, "gridPos": { "h": 17, "w": 24, "x": 0, "y": 261 }, "id": 65, "options": { "cellHeight": "sm", "showHeader": true }, "pluginVersion": "12.3.2", "targets": [ { "dataset": "mesavault_hot", "editorMode": "code", "format": "table", "rawQuery": true, "rawSql": "SELECT\r\n odoo_order_ref AS \"Orden\",\r\n odoo_state AS \"Estado\",\r\n product AS \"Producto\",\r\n machine_id AS \"Máquina\",\r\n odoo_start AS \"Inicio Odoo\",\r\n odoo_end AS \"Fin Odoo\",\r\n real_cycles AS \"Ciclos reales\",\r\n planned_cycles AS \"Ciclos planificados\",\r\n cycle_completion_pct AS \"% avance\",\r\n stop_count AS \"Nº paros\",\r\n stop_min AS \"Min paro\",\r\n stop_cost_eur AS \"Coste paro €\",\r\n status_check AS \"Diagnóstico\",\r\n descripcion AS \"Descripción\"\r\nFROM mv_reports_ucepsa_demo.odoo_workorders_reality_history\r\nORDER BY COALESCE(odoo_end, odoo_start, snapshot_at) DESC\r\nLIMIT 20;", "refId": "A", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } } ], "title": "Histórico de órdenes", "type": "table" } ], "title": "Histórico Odoo vs máquina — Cortadora 01", "type": "row" }, { "collapsed": true, "gridPos": { "h": 1, "w": 24, "x": 0, "y": 57 }, "id": 29, "panels": [ { "datasource": { "type": "grafana-postgresql-datasource", "uid": "bfnbcasbm6hhca" }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [ { "options": { "0": { "color": "red", "index": 0, "text": "Parada" }, "1": { "color": "green", "index": 1, "text": "En Marcha" }, "2": { "color": "yellow", "index": 2, "text": "Desconocido" }, "3": { "color": "semi-dark-purple", "index": 3, "text": "Sin telemetría" } }, "type": "value" } ], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": 0 }, { "color": "red", "value": 80 } ] } }, "overrides": [] }, "gridPos": { "h": 6, "w": 4, "x": 0, "y": 700 }, "id": 25, "options": { "colorMode": "value", "graphMode": "area", "justifyMode": "auto", "orientation": "auto", "percentChangeColorMode": "standard", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "showPercentChange": false, "textMode": "auto", "wideLayout": true }, "pluginVersion": "12.3.2", "targets": [ { "dataset": "mesavault_hot", "editorMode": "code", "format": "table", "rawQuery": true, "rawSql": "SELECT\r\n CASE\r\n WHEN age_s > 120 THEN 3\r\n WHEN machine_running = true THEN 1\r\n WHEN machine_running = false THEN 0\r\n ELSE 2\r\n END AS \"Estado máquina\"\r\nFROM mv_reports_ucepsa_demo.latest_machine_state_fast;", "refId": "A", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } } ], "title": "Estado actual máquina demo", "type": "stat" }, { "datasource": { "type": "grafana-postgresql-datasource", "uid": "bfnbcasbm6hhca" }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [ { "options": { "": { "index": 0, "text": "Sin paro abierto" } }, "type": "value" } ], "thresholds": { "mode": "absolute", "steps": [ { "color": "text", "value": 0 }, { "color": "semi-dark-yellow", "value": 5 }, { "color": "red", "value": 15 } ] }, "unit": "m" }, "overrides": [] }, "gridPos": { "h": 6, "w": 4, "x": 4, "y": 700 }, "id": 47, "options": { "colorMode": "value", "graphMode": "area", "justifyMode": "auto", "orientation": "auto", "percentChangeColorMode": "standard", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "showPercentChange": false, "textMode": "auto", "wideLayout": true }, "pluginVersion": "12.3.2", "targets": [ { "dataset": "mesavault_hot", "editorMode": "code", "format": "table", "rawQuery": true, "rawSql": "SELECT\r\n COALESCE((\r\n SELECT current_duration_min\r\n FROM mv_reports_ucepsa_demo.open_stops\r\n WHERE machine_id = 'CORT-01'\r\n ORDER BY started_at DESC\r\n LIMIT 1\r\n ), 0) AS \"Duración paro actual\";", "refId": "A", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } } ], "title": "Duración paro actual", "type": "stat" }, { "datasource": { "type": "grafana-postgresql-datasource", "uid": "bfnbcasbm6hhca" }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "text", "value": 0 }, { "color": "red", "value": 1 } ] }, "unit": "currencyEUR" }, "overrides": [] }, "gridPos": { "h": 6, "w": 4, "x": 8, "y": 700 }, "id": 48, "options": { "colorMode": "value", "graphMode": "area", "justifyMode": "auto", "orientation": "auto", "percentChangeColorMode": "standard", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "showPercentChange": false, "textMode": "auto", "wideLayout": true }, "pluginVersion": "12.3.2", "targets": [ { "dataset": "mesavault_hot", "editorMode": "code", "format": "table", "rawQuery": true, "rawSql": "SELECT\r\n COALESCE((\r\n SELECT current_cost_eur\r\n FROM mv_reports_ucepsa_demo.open_stops\r\n WHERE machine_id = 'CORT-01'\r\n ORDER BY started_at DESC\r\n LIMIT 1\r\n ), 0) AS \"Coste paro actual\";", "refId": "A", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } } ], "title": "Coste paro actual", "type": "stat" }, { "datasource": { "type": "grafana-postgresql-datasource", "uid": "bfnbcasbm6hhca" }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "text", "value": 0 }, { "color": "#EAB839", "value": 5 }, { "color": "green", "value": 8 } ] } }, "overrides": [] }, "gridPos": { "h": 6, "w": 4, "x": 12, "y": 700 }, "id": 49, "options": { "colorMode": "value", "graphMode": "area", "justifyMode": "auto", "orientation": "auto", "percentChangeColorMode": "standard", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "showPercentChange": false, "textMode": "auto", "wideLayout": true }, "pluginVersion": "12.3.2", "targets": [ { "dataset": "mesavault_hot", "editorMode": "code", "format": "table", "rawQuery": true, "rawSql": "SELECT\r\n cycle_rate_ppm AS \"Ciclos/min\"\r\nFROM mv_reports_ucepsa_demo.latest_machine_snapshot;", "refId": "A", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } } ], "title": "Ciclos/min actual", "type": "stat" }, { "datasource": { "type": "grafana-postgresql-datasource", "uid": "bfnbcasbm6hhca" }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "text", "value": 0 }, { "color": "green", "value": 1 } ] } }, "overrides": [] }, "gridPos": { "h": 6, "w": 4, "x": 16, "y": 700 }, "id": 50, "options": { "colorMode": "value", "graphMode": "area", "justifyMode": "auto", "orientation": "auto", "percentChangeColorMode": "standard", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "showPercentChange": false, "textMode": "auto", "wideLayout": true }, "pluginVersion": "12.3.2", "targets": [ { "dataset": "mesavault_hot", "editorMode": "code", "format": "table", "rawQuery": true, "rawSql": "SELECT\r\n cycle_pulse_count AS \"Pulsos acumulados\"\r\nFROM mv_reports_ucepsa_demo.latest_machine_snapshot;", "refId": "A", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } } ], "title": "Pulsos acumulados", "type": "stat" }, { "datasource": { "type": "grafana-postgresql-datasource", "uid": "bfnbcasbm6hhca" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisPlacement": "hidden", "fillOpacity": 70, "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "insertNulls": false, "lineWidth": 0, "spanNulls": false }, "mappings": [ { "options": { "0": { "color": "purple", "index": 0, "text": "Sin Telemetría" }, "1": { "color": "green", "index": 1, "text": "En marcha" }, "2": { "color": "red", "index": 2, "text": "Parada - causa pendiente" }, "3": { "color": "semi-dark-yellow", "index": 3, "text": "Parada - causa clasificada" } }, "type": "value" } ], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": 0 }, { "color": "red", "value": 80 } ] } }, "overrides": [] }, "gridPos": { "h": 4, "w": 24, "x": 0, "y": 706 }, "id": 51, "options": { "alignValue": "left", "legend": { "displayMode": "list", "placement": "bottom", "showLegend": true }, "mergeValues": true, "rowHeight": 0.9, "showValue": "auto", "tooltip": { "hideZeros": false, "mode": "single", "sort": "none" } }, "pluginVersion": "12.3.2", "targets": [ { "dataset": "mesavault_hot", "editorMode": "code", "format": "table", "rawQuery": true, "rawSql": "WITH limits AS (\r\n SELECT\r\n $__timeFrom()::timestamptz AS t_from,\r\n LEAST($__timeTo()::timestamptz, now()) AS t_to,\r\n $__timeTo()::timestamptz AS grafana_to\r\n),\r\nbuckets AS (\r\n SELECT\r\n generate_series(\r\n t_from,\r\n t_to,\r\n interval '10 seconds'\r\n ) AS bucket\r\n FROM limits\r\n),\r\nstates AS (\r\n SELECT\r\n b.bucket AS \"time\",\r\n CASE\r\n -- 0. Si no hay telemetría reciente, el estado de máquina es desconocido.\r\n WHEN NOT EXISTS (\r\n SELECT 1\r\n FROM mv_hot.edge_oee_eastron_readings r\r\n WHERE r.asset = 'revpi_oee_node_01'\r\n AND r.ingest_ts > b.bucket - interval '30 seconds'\r\n AND r.ingest_ts <= b.bucket + interval '1 second'\r\n )\r\n THEN 0\r\n\r\n -- 2/3. Si hay un paro solapando ese bucket, mostrar estado de paro.\r\n WHEN EXISTS (\r\n SELECT 1\r\n FROM mv_reports_ucepsa_demo.stops_recent s\r\n WHERE s.machine_id = 'CORT-01'\r\n AND s.started_at <= b.bucket\r\n AND COALESCE(s.ended_at, now()) > b.bucket\r\n AND s.classification_status = 'PENDING'\r\n )\r\n THEN 2\r\n\r\n WHEN EXISTS (\r\n SELECT 1\r\n FROM mv_reports_ucepsa_demo.stops_recent s\r\n WHERE s.machine_id = 'CORT-01'\r\n AND s.started_at <= b.bucket\r\n AND COALESCE(s.ended_at, now()) > b.bucket\r\n AND s.classification_status = 'CLASSIFIED'\r\n )\r\n THEN 3\r\n\r\n -- 1. Hay telemetría y no hay paro abierto en ese instante.\r\n ELSE 1\r\n END AS \"CORT-01\"\r\n FROM buckets b\r\n),\r\ncutoff AS (\r\n SELECT\r\n t_to + interval '1 second' AS \"time\",\r\n NULL::int AS \"CORT-01\"\r\n FROM limits\r\n WHERE t_to < grafana_to\r\n)\r\nSELECT *\r\nFROM states\r\n\r\nUNION ALL\r\n\r\nSELECT *\r\nFROM cutoff\r\n\r\nORDER BY \"time\";", "refId": "A", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } } ], "title": "Timeline estado máquina CORT-01", "type": "state-timeline" }, { "datasource": { "type": "grafana-postgresql-datasource", "uid": "bfnbcasbm6hhca" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisPlacement": "hidden", "fillOpacity": 70, "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "insertNulls": false, "lineWidth": 0, "spanNulls": false }, "mappings": [ { "options": { "0": { "color": "red", "index": 0, "text": "OFF / Paro" }, "1": { "color": "green", "index": 1, "text": "ON / Marcha" }, "2": { "color": "purple", "index": 2, "text": "Sin Telemetría" } }, "type": "value" } ], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": 0 }, { "color": "red", "value": 80 } ] } }, "overrides": [] }, "gridPos": { "h": 4, "w": 24, "x": 0, "y": 710 }, "id": 54, "options": { "alignValue": "left", "legend": { "displayMode": "list", "placement": "bottom", "showLegend": true }, "mergeValues": true, "rowHeight": 0.9, "showValue": "auto", "tooltip": { "hideZeros": false, "mode": "single", "sort": "none" } }, "pluginVersion": "12.3.2", "targets": [ { "dataset": "mesavault_hot", "editorMode": "code", "format": "table", "rawQuery": true, "rawSql": "WITH limits AS (\r\n SELECT\r\n $__timeFrom()::timestamptz AS t_from,\r\n LEAST($__timeTo()::timestamptz, now()) AS t_to,\r\n $__timeTo()::timestamptz AS grafana_to\r\n),\r\nbuckets AS (\r\n SELECT\r\n generate_series(\r\n t_from,\r\n t_to,\r\n interval '10 seconds'\r\n ) AS bucket\r\n FROM limits\r\n),\r\nstates AS (\r\n SELECT\r\n b.bucket AS \"time\",\r\n CASE\r\n WHEN NOT EXISTS (\r\n SELECT 1\r\n FROM mv_hot.edge_oee_eastron_readings r\r\n WHERE r.asset = 'revpi_oee_node_01'\r\n AND r.ingest_ts > b.bucket - interval '30 seconds'\r\n AND r.ingest_ts <= b.bucket + interval '1 second'\r\n )\r\n THEN 2\r\n\r\n WHEN (\r\n SELECT\r\n CASE\r\n WHEN (r.payload_json ->> 'machine_running')::boolean = true THEN 1\r\n WHEN (r.payload_json ->> 'machine_running')::boolean = false THEN 0\r\n ELSE 2\r\n END\r\n FROM mv_hot.edge_oee_eastron_readings r\r\n WHERE r.asset = 'revpi_oee_node_01'\r\n AND r.ingest_ts <= b.bucket\r\n ORDER BY r.ingest_ts DESC\r\n LIMIT 1\r\n ) = 1\r\n THEN 1\r\n\r\n ELSE 0\r\n END AS \"I_1 automático\"\r\n FROM buckets b\r\n),\r\ncutoff AS (\r\n SELECT\r\n t_to + interval '1 second' AS \"time\",\r\n NULL::int AS \"I_1 automático\"\r\n FROM limits\r\n WHERE t_to < grafana_to\r\n)\r\nSELECT *\r\nFROM states\r\n\r\nUNION ALL\r\n\r\nSELECT *\r\nFROM cutoff\r\n\r\nORDER BY \"time\";", "refId": "A", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } } ], "title": "Eventos I_1 — Arranque / Paro", "type": "state-timeline" }, { "datasource": { "type": "grafana-postgresql-datasource", "uid": "bfnbcasbm6hhca" }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "custom": { "align": "auto", "cellOptions": { "type": "auto" }, "footer": { "reducers": [] }, "inspect": false }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": 0 }, { "color": "red", "value": 80 } ] } }, "overrides": [] }, "gridPos": { "h": 6, "w": 24, "x": 0, "y": 714 }, "id": 26, "options": { "cellHeight": "sm", "showHeader": true }, "pluginVersion": "12.3.2", "targets": [ { "dataset": "mesavault_hot", "editorMode": "code", "format": "table", "rawQuery": true, "rawSql": "SELECT\r\n id AS \"ID paro\",\r\n machine_id AS \"Máquina\",\r\n started_at AS \"Inicio\",\r\n current_duration_min AS \"Duración actual min\",\r\n current_cost_eur AS \"Coste actual €\",\r\n classification_status AS \"Clasificación\",\r\n COALESCE(cause_name, 'Pendiente') AS \"Causa\",\r\n operator_note AS \"Nota\"\r\nFROM mv_reports_ucepsa_demo.open_stops\r\nWHERE machine_id = 'CORT-01'\r\nORDER BY started_at DESC;", "refId": "A", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } } ], "title": "Paro abierto", "type": "table" }, { "datasource": { "type": "grafana-postgresql-datasource", "uid": "bfnbcasbm6hhca" }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "custom": { "align": "auto", "cellOptions": { "type": "auto" }, "footer": { "reducers": [] }, "inspect": false }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": 0 }, { "color": "red", "value": 80 } ] } }, "overrides": [] }, "gridPos": { "h": 8, "w": 24, "x": 0, "y": 720 }, "id": 27, "options": { "cellHeight": "sm", "showHeader": true }, "pluginVersion": "12.3.2", "targets": [ { "dataset": "mesavault_hot", "editorMode": "code", "format": "table", "rawQuery": true, "rawSql": "SELECT\r\n id AS \"ID\",\r\n machine_id AS \"Máquina\",\r\n started_at AS \"Inicio\",\r\n ended_at AS \"Fin\",\r\n status AS \"Estado\",\r\n classification_status AS \"Clasificación\",\r\n COALESCE(cause_name, 'Pendiente') AS \"Causa\",\r\n operator_note AS \"Nota\",\r\n duration_min AS \"Duración min\",\r\n cost_eur AS \"Coste €\"\r\nFROM mv_reports_ucepsa_demo.stops_recent\r\nWHERE machine_id = 'CORT-01'\r\n AND $__timeFilter(started_at)\r\nORDER BY started_at DESC\r\nLIMIT 20;", "refId": "A", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } } ], "title": "Últimos paros", "type": "table" }, { "datasource": { "type": "grafana-postgresql-datasource", "uid": "bfnbcasbm6hhca" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "fillOpacity": 80, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineWidth": 1, "scaleDistribution": { "type": "linear" }, "thresholdsStyle": { "mode": "off" } }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": 0 }, { "color": "red", "value": 80 } ] } }, "overrides": [] }, "gridPos": { "h": 12, "w": 12, "x": 0, "y": 728 }, "id": 28, "options": { "barRadius": 0, "barWidth": 0.97, "fullHighlight": false, "groupWidth": 0.7, "legend": { "calcs": [], "displayMode": "list", "placement": "bottom", "showLegend": true }, "orientation": "auto", "showValue": "auto", "stacking": "none", "tooltip": { "hideZeros": false, "mode": "single", "sort": "none" }, "xTickLabelRotation": 0, "xTickLabelSpacing": 0 }, "pluginVersion": "12.3.2", "targets": [ { "dataset": "mesavault_hot", "editorMode": "code", "format": "table", "rawQuery": true, "rawSql": "SELECT\r\n cause_name AS \"Causa\",\r\n total_cost_eur AS \"Coste €\"\r\nFROM mv_reports_ucepsa_demo.stop_summary\r\nORDER BY total_cost_eur DESC;", "refId": "A", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } } ], "title": "Coste por causa", "type": "barchart" }, { "datasource": { "type": "grafana-postgresql-datasource", "uid": "bfnbcasbm6hhca" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "fillOpacity": 80, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineWidth": 1, "scaleDistribution": { "type": "linear" }, "thresholdsStyle": { "mode": "off" } }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": 0 }, { "color": "red", "value": 80 } ] } }, "overrides": [ { "matcher": { "id": "byName", "options": "Minutos" }, "properties": [ { "id": "color", "value": { "fixedColor": "semi-dark-yellow", "mode": "fixed" } } ] } ] }, "gridPos": { "h": 12, "w": 12, "x": 12, "y": 728 }, "id": 52, "options": { "barRadius": 0, "barWidth": 0.97, "fullHighlight": false, "groupWidth": 0.7, "legend": { "calcs": [], "displayMode": "list", "placement": "bottom", "showLegend": true }, "orientation": "auto", "showValue": "auto", "stacking": "none", "tooltip": { "hideZeros": false, "mode": "single", "sort": "none" }, "xTickLabelRotation": 0, "xTickLabelSpacing": 0 }, "pluginVersion": "12.3.2", "targets": [ { "dataset": "mesavault_hot", "editorMode": "code", "format": "table", "rawQuery": true, "rawSql": "SELECT\r\n cause_name AS \"Causa\",\r\n total_min AS \"Minutos\"\r\nFROM mv_reports_ucepsa_demo.stop_summary\r\nORDER BY total_min DESC;", "refId": "A", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } } ], "title": "Coste por causa", "type": "barchart" }, { "datasource": { "type": "grafana-postgresql-datasource", "uid": "bfnbcasbm6hhca" }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "custom": { "align": "auto", "cellOptions": { "type": "auto" }, "footer": { "reducers": [] }, "inspect": false }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": 0 }, { "color": "red", "value": 80 } ] } }, "overrides": [] }, "gridPos": { "h": 13, "w": 24, "x": 0, "y": 740 }, "id": 24, "options": { "cellHeight": "sm", "showHeader": true }, "pluginVersion": "12.3.2", "targets": [ { "dataset": "mesavault_hot", "editorMode": "code", "format": "table", "rawQuery": true, "rawSql": "SELECT\r\n event_ts AS \"Hora evento\",\r\n asset AS \"Nodo\",\r\n machine_id AS \"Máquina\",\r\n CASE\r\n WHEN event_name = 'machine_started' THEN 'Arranque'\r\n WHEN event_name = 'machine_stopped' THEN 'Paro'\r\n ELSE event_name\r\n END AS \"Evento\",\r\n previous_auto_signal AS \"Estado anterior\",\r\n new_auto_signal AS \"Estado nuevo\",\r\n machine_running AS \"Máquina en marcha\",\r\n reason_pending AS \"Causa pendiente\",\r\n cycle_pulse_count AS \"Pulsos acumulados\",\r\n cycle_rate_ppm AS \"Ciclos/min\"\r\nFROM mv_reports_ucepsa_demo.node_events_recent\r\nWHERE $__timeFilter(event_ts)\r\nORDER BY event_ts DESC\r\nLIMIT 50;", "refId": "A", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } } ], "title": "Eventos reales de máquina — RevPi", "type": "table" } ], "title": "Estado de máquina CORTADORA 01", "type": "row" }, { "collapsed": true, "gridPos": { "h": 1, "w": 24, "x": 0, "y": 58 }, "id": 16, "panels": [ { "datasource": { "type": "grafana-postgresql-datasource", "uid": "bfnbcasbm6hhca" }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [ { "options": { "0": { "color": "green", "index": 0, "text": "OK" }, "1": { "color": "semi-dark-yellow", "index": 1, "text": "Warning" }, "2": { "color": "purple", "index": 2, "text": "Sin Telemetría" } }, "type": "value" } ], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": 0 }, { "color": "red", "value": 80 } ] } }, "overrides": [] }, "gridPos": { "h": 6, "w": 4, "x": 0, "y": 832 }, "id": 17, "options": { "colorMode": "value", "graphMode": "area", "justifyMode": "auto", "orientation": "auto", "percentChangeColorMode": "standard", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "showPercentChange": false, "textMode": "auto", "wideLayout": true }, "pluginVersion": "12.3.2", "targets": [ { "dataset": "mesavault_hot", "editorMode": "code", "format": "table", "rawQuery": true, "rawSql": "SELECT\r\n CASE\r\n WHEN comm_ok = false THEN 3\r\n WHEN age_s > 120 THEN 2\r\n WHEN age_s > 30 THEN 1\r\n ELSE 0\r\n END AS \"Estado captura\"\r\nFROM mv_reports_ucepsa_demo.energy_latest;", "refId": "A", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } } ], "title": "Estado comunicación", "type": "stat" }, { "datasource": { "type": "grafana-postgresql-datasource", "uid": "bfnbcasbm6hhca" }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": 0 }, { "color": "red", "value": 80 } ] }, "unit": "s" }, "overrides": [] }, "gridPos": { "h": 6, "w": 4, "x": 4, "y": 832 }, "id": 18, "options": { "colorMode": "value", "graphMode": "area", "justifyMode": "auto", "orientation": "auto", "percentChangeColorMode": "standard", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "showPercentChange": false, "textMode": "auto", "wideLayout": true }, "pluginVersion": "12.3.2", "targets": [ { "dataset": "mesavault_hot", "editorMode": "code", "format": "table", "rawQuery": true, "rawSql": "SELECT\r\n age_s AS \"Edad último dato\"\r\nFROM mv_reports_ucepsa_demo.energy_latest;", "refId": "A", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } } ], "title": "Edad último dato", "type": "stat" }, { "datasource": { "type": "grafana-postgresql-datasource", "uid": "bfnbcasbm6hhca" }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "red", "value": 0 }, { "color": "green", "value": 220 } ] } }, "overrides": [ { "matcher": { "id": "byName", "options": "L1 V" }, "properties": [] }, { "matcher": { "id": "byName", "options": "L2 V" }, "properties": [] }, { "matcher": { "id": "byName", "options": "L3 V" }, "properties": [] }, { "matcher": { "id": "byName", "options": "Hz" }, "properties": [] } ] }, "gridPos": { "h": 6, "w": 4, "x": 8, "y": 832 }, "id": 21, "options": { "colorMode": "value", "graphMode": "area", "justifyMode": "auto", "orientation": "auto", "percentChangeColorMode": "standard", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "showPercentChange": false, "textMode": "auto", "wideLayout": true }, "pluginVersion": "12.3.2", "targets": [ { "dataset": "mesavault_hot", "editorMode": "code", "format": "table", "rawQuery": true, "rawSql": "SELECT\r\n voltage_l1_v AS \"Tensión L1\"\r\nFROM mv_reports_ucepsa_demo.energy_latest;", "refId": "A", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } } ], "title": "Tensión L1", "type": "stat" }, { "datasource": { "type": "grafana-postgresql-datasource", "uid": "bfnbcasbm6hhca" }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": 0 }, { "color": "red", "value": 80 } ] }, "unit": "amp" }, "overrides": [ { "matcher": { "id": "byName", "options": "L1 A" }, "properties": [] }, { "matcher": { "id": "byName", "options": "L2 A" }, "properties": [] }, { "matcher": { "id": "byName", "options": "L3 A" }, "properties": [] } ] }, "gridPos": { "h": 6, "w": 4, "x": 12, "y": 832 }, "id": 22, "options": { "colorMode": "value", "graphMode": "area", "justifyMode": "auto", "orientation": "auto", "percentChangeColorMode": "standard", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "showPercentChange": false, "textMode": "auto", "wideLayout": true }, "pluginVersion": "12.3.2", "targets": [ { "dataset": "mesavault_hot", "editorMode": "code", "format": "table", "rawQuery": true, "rawSql": "SELECT\r\n current_l1_a AS \"Corriente L1\"\r\nFROM mv_reports_ucepsa_demo.energy_latest;", "refId": "A", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } } ], "title": "Corriente L1", "type": "stat" }, { "datasource": { "type": "grafana-postgresql-datasource", "uid": "bfnbcasbm6hhca" }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": 0 }, { "color": "red", "value": 80 } ] }, "unit": "watt" }, "overrides": [] }, "gridPos": { "h": 6, "w": 4, "x": 0, "y": 838 }, "id": 19, "options": { "colorMode": "value", "graphMode": "area", "justifyMode": "auto", "orientation": "auto", "percentChangeColorMode": "standard", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "showPercentChange": false, "textMode": "auto", "wideLayout": true }, "pluginVersion": "12.3.2", "targets": [ { "dataset": "mesavault_hot", "editorMode": "code", "format": "table", "rawQuery": true, "rawSql": "SELECT\r\n power_total_kw * 1000 AS \"Potencia total\"\r\nFROM mv_reports_ucepsa_demo.energy_latest;", "refId": "A", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } } ], "title": "Potencia total", "type": "stat" }, { "datasource": { "type": "grafana-postgresql-datasource", "uid": "bfnbcasbm6hhca" }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": 0 }, { "color": "red", "value": 80 } ] }, "unit": "watth" }, "overrides": [] }, "gridPos": { "h": 6, "w": 4, "x": 4, "y": 838 }, "id": 20, "options": { "colorMode": "value", "graphMode": "area", "justifyMode": "auto", "orientation": "auto", "percentChangeColorMode": "standard", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "showPercentChange": false, "textMode": "auto", "wideLayout": true }, "pluginVersion": "12.3.2", "targets": [ { "dataset": "mesavault_hot", "editorMode": "code", "format": "table", "rawQuery": true, "rawSql": "SELECT\r\n import_kwh * 1000 AS \"Energía acumulada\"\r\nFROM mv_reports_ucepsa_demo.energy_latest;", "refId": "A", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } } ], "title": "Energía acumulada", "type": "stat" }, { "datasource": { "type": "grafana-postgresql-datasource", "uid": "bfnbcasbm6hhca" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 0, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "insertNulls": false, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "auto", "showValues": false, "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": 0 }, { "color": "red", "value": 80 } ] }, "unit": "watt" }, "overrides": [] }, "gridPos": { "h": 6, "w": 8, "x": 8, "y": 838 }, "id": 41, "options": { "legend": { "calcs": [], "displayMode": "list", "placement": "bottom", "showLegend": true }, "tooltip": { "hideZeros": false, "mode": "single", "sort": "none" } }, "pluginVersion": "12.3.2", "targets": [ { "dataset": "mesavault_hot", "editorMode": "code", "format": "table", "rawQuery": true, "rawSql": "SELECT\r\n $__time(time),\r\n power_w AS \"Potencia W\"\r\nFROM mv_reports_ucepsa_demo.energy_power_timeseries\r\nWHERE $__timeFilter(time)\r\nORDER BY time;", "refId": "A", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } } ], "title": "Evolución de potencia", "type": "timeseries" }, { "datasource": { "type": "grafana-postgresql-datasource", "uid": "bfnbcasbm6hhca" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 0, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "insertNulls": false, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "auto", "showValues": false, "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": 0 }, { "color": "red", "value": 80 } ] }, "unit": "watth" }, "overrides": [] }, "gridPos": { "h": 7, "w": 8, "x": 0, "y": 844 }, "id": 42, "options": { "legend": { "calcs": [], "displayMode": "list", "placement": "bottom", "showLegend": true }, "tooltip": { "hideZeros": false, "mode": "single", "sort": "none" } }, "pluginVersion": "12.3.2", "targets": [ { "dataset": "mesavault_hot", "editorMode": "code", "format": "table", "rawQuery": true, "rawSql": "SELECT\r\n $__time(time),\r\n import_wh AS \"Energía acumulada Wh\"\r\nFROM mv_reports_ucepsa_demo.energy_import_timeseries\r\nWHERE $__timeFilter(time)\r\nORDER BY time;", "refId": "A", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } } ], "title": "Energía acumulada", "type": "timeseries" }, { "datasource": { "type": "grafana-postgresql-datasource", "uid": "bfnbcasbm6hhca" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": -1, "barWidthFactor": 1, "drawStyle": "bars", "fillOpacity": 0, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "insertNulls": false, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "auto", "showValues": false, "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": 0 }, { "color": "red", "value": 80 } ] } }, "overrides": [] }, "gridPos": { "h": 7, "w": 8, "x": 8, "y": 844 }, "id": 43, "options": { "legend": { "calcs": [], "displayMode": "list", "placement": "bottom", "showLegend": true }, "tooltip": { "hideZeros": false, "mode": "single", "sort": "none" } }, "pluginVersion": "12.3.2", "targets": [ { "dataset": "mesavault_hot", "editorMode": "code", "format": "time_series", "rawQuery": true, "rawSql": "WITH raw AS (\r\n SELECT\r\n time,\r\n import_wh,\r\n LAG(import_wh) OVER (ORDER BY time) AS prev_import_wh\r\n FROM mv_reports_ucepsa_demo.energy_import_timeseries\r\n WHERE $__timeFilter(time)\r\n)\r\nSELECT\r\n $__time(time),\r\n ROUND(GREATEST(import_wh - prev_import_wh, 0)::numeric, 4) AS \"Consumo incremental Wh\"\r\nFROM raw\r\nWHERE prev_import_wh IS NOT NULL\r\nORDER BY time;", "refId": "A", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } } ], "title": "Consumo por intervalo", "type": "timeseries" }, { "datasource": { "type": "grafana-postgresql-datasource", "uid": "bfnbcasbm6hhca" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 0, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "insertNulls": false, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "auto", "showValues": false, "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": 0 }, { "color": "red", "value": 80 } ] }, "unit": "watt" }, "overrides": [] }, "gridPos": { "h": 7, "w": 8, "x": 0, "y": 851 }, "id": 40, "options": { "legend": { "calcs": [], "displayMode": "list", "placement": "bottom", "showLegend": true }, "tooltip": { "hideZeros": false, "mode": "single", "sort": "none" } }, "pluginVersion": "12.3.2", "targets": [ { "dataset": "mesavault_hot", "editorMode": "code", "format": "table", "rawQuery": true, "rawSql": "SELECT\r\n $__time(time),\r\n power_w AS \"Potencia W\"\r\nFROM mv_reports_ucepsa_demo.energy_power_timeseries\r\nWHERE $__timeFilter(time)\r\nORDER BY time;", "refId": "A", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } } ], "title": "Evolución de potencia", "type": "timeseries" } ], "title": "ENERGÍA CORTADORA 01", "type": "row" }, { "collapsed": true, "gridPos": { "h": 1, "w": 24, "x": 0, "y": 59 }, "id": 46, "panels": [ { "datasource": { "type": "grafana-postgresql-datasource", "uid": "bfnbcasbm6hhca" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisPlacement": "auto", "fillOpacity": 70, "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "insertNulls": false, "lineWidth": 0, "spanNulls": false }, "mappings": [ { "options": { "0": { "color": "purple", "index": 0, "text": "Sin telemetría" }, "1": { "color": "green", "index": 1, "text": "Recibiendo datos" } }, "type": "value" } ], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": 0 } ] } }, "overrides": [] }, "gridPos": { "h": 3, "w": 24, "x": 0, "y": 885 }, "id": 44, "options": { "alignValue": "left", "legend": { "displayMode": "list", "placement": "bottom", "showLegend": false }, "mergeValues": true, "rowHeight": 0.9, "showValue": "auto", "tooltip": { "hideZeros": false, "mode": "single", "sort": "none" } }, "pluginVersion": "12.3.2", "targets": [ { "dataset": "mesavault_hot", "editorMode": "code", "format": "time_series", "rawQuery": true, "rawSql": "WITH limits AS (\r\n SELECT\r\n $__timeFrom()::timestamptz AS t_from,\r\n LEAST($__timeTo()::timestamptz, now()) AS t_to,\r\n $__timeTo()::timestamptz AS grafana_to\r\n),\r\nbuckets AS (\r\n SELECT\r\n generate_series(\r\n t_from,\r\n t_to,\r\n interval '10 seconds'\r\n ) AS bucket\r\n FROM limits\r\n),\r\nstates AS (\r\n SELECT\r\n bucket AS \"time\",\r\n CASE\r\n WHEN EXISTS (\r\n SELECT 1\r\n FROM mv_reports_ucepsa_demo.live_telemetry r\r\n WHERE r.asset = 'revpi_oee_node_01'\r\n AND r.ingest_ts > bucket - interval '30 seconds'\r\n AND r.ingest_ts <= bucket + interval '1 second'\r\n )\r\n THEN 1\r\n ELSE 0\r\n END::int AS \"RevPi telemetría\"\r\n FROM buckets\r\n),\r\ncutoff AS (\r\n SELECT\r\n t_to + interval '1 second' AS \"time\",\r\n NULL::int AS \"RevPi telemetría\"\r\n FROM limits\r\n WHERE t_to < grafana_to\r\n)\r\nSELECT *\r\nFROM states\r\n\r\nUNION ALL\r\n\r\nSELECT *\r\nFROM cutoff\r\n\r\nORDER BY \"time\";", "refId": "A", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } } ], "title": "Estado telemetría RevPi", "type": "state-timeline" }, { "datasource": { "type": "grafana-postgresql-datasource", "uid": "bfnbcasbm6hhca" }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "custom": { "align": "auto", "cellOptions": { "type": "auto" }, "footer": { "reducers": [] }, "hideFrom": { "viz": false }, "inspect": false }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": 0 }, { "color": "red", "value": 80 } ] } }, "overrides": [] }, "gridPos": { "h": 9, "w": 24, "x": 0, "y": 888 }, "id": 45, "options": { "cellHeight": "sm", "showHeader": true }, "pluginVersion": "12.3.2", "targets": [ { "dataset": "mesavault_hot", "editorMode": "code", "format": "table", "rawQuery": true, "rawSql": "WITH latest AS (\r\n SELECT\r\n age_s,\r\n asset,\r\n power_total_kw,\r\n comm_ok,\r\n error_text\r\n FROM mv_reports_ucepsa_demo.energy_latest\r\n)\r\nSELECT\r\n 'Comunicación' AS \"Grupo\",\r\n 'Edad último dato' AS \"Parámetro\",\r\n age_s::numeric AS \"Valor\",\r\n 's' AS \"Unidad\",\r\n CASE\r\n WHEN comm_ok = false THEN 'Peligro'\r\n WHEN age_s > 120 THEN 'Peligro'\r\n WHEN age_s > 30 THEN 'Warning'\r\n ELSE 'OK'\r\n END AS \"Estado\",\r\n CASE\r\n WHEN comm_ok = false THEN COALESCE(error_text, 'Error de lectura del Eastron')\r\n WHEN age_s > 120 THEN 'No se reciben datos recientes'\r\n WHEN age_s > 30 THEN 'La lectura llega con retraso'\r\n ELSE 'Lectura reciente desde RevPi'\r\n END AS \"Qué está mal\",\r\n CASE\r\n WHEN comm_ok = false THEN 'La RevPi publica, pero la lectura Modbus no es válida'\r\n WHEN age_s > 120 THEN 'La máquina/nodo puede estar sin corriente o sin conexión'\r\n WHEN age_s > 30 THEN 'Puede haber latencia, reinicio o pérdida temporal de red'\r\n ELSE 'La captura industrial está viva'\r\n END AS \"Impacto probable\",\r\n CASE\r\n WHEN comm_ok = false THEN 'Revisar RS-485, SDM120-M, alimentación del contador y logs RevPi'\r\n WHEN age_s > 120 THEN 'Revisar alimentación de RevPi, red, MQTT, bridge y sink'\r\n WHEN age_s > 30 THEN 'Revisar estabilidad de red/MQTT'\r\n ELSE 'Sin acción'\r\n END AS \"Qué revisar / acción\"\r\nFROM latest\r\n\r\nUNION ALL\r\n\r\nSELECT\r\n 'Energía',\r\n 'Potencia total',\r\n power_total_kw,\r\n 'kW',\r\n CASE\r\n WHEN power_total_kw IS NULL THEN 'Warning'\r\n ELSE 'OK'\r\n END,\r\n CASE\r\n WHEN power_total_kw IS NULL THEN 'No hay potencia disponible'\r\n ELSE 'Potencia total leída correctamente'\r\n END,\r\n CASE\r\n WHEN power_total_kw IS NULL THEN 'No se puede validar carga eléctrica'\r\n ELSE 'Permite demostrar captura energética industrial'\r\n END,\r\n CASE\r\n WHEN power_total_kw IS NULL THEN 'Revisar lectura Modbus'\r\n ELSE 'Sin acción'\r\n END\r\nFROM latest;", "refId": "A", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } } ], "title": "Diagnóstico de captura", "type": "table" }, { "datasource": { "type": "grafana-postgresql-datasource", "uid": "bfnbcasbm6hhca" }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "custom": { "align": "auto", "cellOptions": { "type": "auto" }, "footer": { "reducers": [] }, "inspect": false }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": 0 }, { "color": "red", "value": 80 } ] } }, "overrides": [] }, "gridPos": { "h": 10, "w": 24, "x": 0, "y": 897 }, "id": 53, "options": { "cellHeight": "sm", "showHeader": true }, "pluginVersion": "12.3.2", "targets": [ { "dataset": "mesavault_hot", "editorMode": "code", "format": "table", "rawQuery": true, "rawSql": "SELECT\r\n event_ts AS \"Hora evento\",\r\n asset AS \"Nodo\",\r\n machine_id AS \"Máquina\",\r\n CASE\r\n WHEN event_name = 'machine_started' THEN 'Arranque'\r\n WHEN event_name = 'machine_stopped' THEN 'Paro'\r\n ELSE event_name\r\n END AS \"Evento\",\r\n previous_auto_signal AS \"Estado anterior\",\r\n new_auto_signal AS \"Estado nuevo\",\r\n machine_running AS \"Máquina en marcha\",\r\n reason_pending AS \"Causa pendiente\",\r\n cycle_pulse_count AS \"Pulsos acumulados\",\r\n cycle_rate_ppm AS \"Ciclos/min\"\r\nFROM mv_reports_ucepsa_demo.node_events_recent\r\nWHERE $__timeFilter(event_ts)\r\nORDER BY event_ts DESC\r\nLIMIT 50;", "refId": "A", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } } ], "title": "Eventos reales de máquina — RevPi", "type": "table" } ], "title": "RevPi", "type": "row" } ], "preload": false, "refresh": "10s", "schemaVersion": 42, "tags": [], "templating": { "list": [] }, "time": { "from": "now-1h", "to": "now" }, "timepicker": {}, "timezone": "browser", "title": "MESAVAULT Edge-OEE — UCEPSA local", "uid": "ucepsa-edge-oee-local", "version": 30, "weekStart": "monday" }