„Grafana/Nuki Smartlock + Bridge (Internals).json“ ändern

This commit is contained in:
Mario Voigt 2018-10-04 21:48:23 +02:00
parent 37dbf3829f
commit 21b4114c45

View File

@ -5,7 +5,7 @@
"type": "grafana", "type": "grafana",
"id": "grafana", "id": "grafana",
"name": "Grafana", "name": "Grafana",
"version": "5.2.2" "version": "5.2.4"
}, },
{ {
"type": "panel", "type": "panel",
@ -49,7 +49,7 @@
"gnetId": null, "gnetId": null,
"graphTooltip": 0, "graphTooltip": 0,
"id": null, "id": null,
"iteration": 1534935435602, "iteration": 1538682153418,
"links": [], "links": [],
"panels": [ "panels": [
{ {
@ -305,7 +305,7 @@
"id": 74, "id": 74,
"interval": null, "interval": null,
"links": [], "links": [],
"mappingType": 2, "mappingType": 1,
"mappingTypes": [ "mappingTypes": [
{ {
"name": "value to text", "name": "value to text",
@ -331,8 +331,18 @@
}, },
{ {
"from": "1", "from": "1",
"text": "Unbekannt", "text": "Nicht registriert",
"to": "255" "to": "255"
},
{
"from": "",
"text": "",
"to": ""
},
{
"from": "",
"text": "",
"to": ""
} }
], ],
"sparkline": { "sparkline": {
@ -354,7 +364,33 @@
"title": "Server Status", "title": "Server Status",
"type": "singlestat", "type": "singlestat",
"valueFontSize": "80%", "valueFontSize": "80%",
"valueMaps": [], "valueMaps": [
{
"op": "=",
"text": "Okay",
"value": "0"
},
{
"op": "=",
"text": "Nicht registriert",
"value": "1"
},
{
"op": "=",
"text": "Auth UUID ungültig",
"value": "2"
},
{
"op": "=",
"text": "Auth ungültig",
"value": "3"
},
{
"op": "=",
"text": "Offline",
"value": "4"
}
],
"valueName": "avg" "valueName": "avg"
}, },
{ {
@ -1013,12 +1049,12 @@
"hideEmpty": false, "hideEmpty": false,
"hideZero": false, "hideZero": false,
"id": 24, "id": 24,
"initialZoom": "0", "initialZoom": "12",
"links": [], "links": [],
"locationData": "table", "locationData": "table",
"mapCenter": "(0°, 0°)", "mapCenter": "custom",
"mapCenterLatitude": 0, "mapCenterLatitude": "0.0000",
"mapCenterLongitude": 0, "mapCenterLongitude": "0.0000",
"maxDataPoints": 1, "maxDataPoints": 1,
"mouseWheelZoom": true, "mouseWheelZoom": true,
"showLegend": false, "showLegend": false,
@ -1656,12 +1692,12 @@
"colorBackground": false, "colorBackground": false,
"colorValue": false, "colorValue": false,
"colors": [ "colors": [
"#d44a3a", "#299c46",
"#e24d42", "rgba(237, 129, 40, 0.89)",
"#629e51" "#d44a3a"
], ],
"datasource": "$Datasource", "datasource": "$Datasource",
"description": "Erlaube, neue Geräte direkt mit dem Smart Lock zu koppeln.", "description": "Erlaube Sperrvorgänge durch Drücken des Buttons am Smart Lock.",
"format": "none", "format": "none",
"gauge": { "gauge": {
"maxValue": 100, "maxValue": 100,
@ -1676,7 +1712,7 @@
"x": 15, "x": 15,
"y": 20 "y": 20
}, },
"id": 53, "id": 52,
"interval": null, "interval": null,
"links": [], "links": [],
"mappingType": 1, "mappingType": 1,
@ -1710,17 +1746,17 @@
"lineColor": "rgb(31, 120, 193)", "lineColor": "rgb(31, 120, 193)",
"show": false "show": false
}, },
"tableColumn": "pairingEnabled", "tableColumn": "buttonEnabled",
"targets": [ "targets": [
{ {
"alias": "", "alias": "",
"format": "table", "format": "table",
"rawSql": "SELECT \n s.pairingEnabled\nFROM Smartlock AS s\nWHERE s.name = \"$SmartlockName\"\n;", "rawSql": "SELECT \n s.buttonEnabled \nFROM Smartlock AS s\nWHERE s.name = \"$SmartlockName\"\n;",
"refId": "A" "refId": "A"
} }
], ],
"thresholds": "0,1", "thresholds": "",
"title": "Bluetooth Pairing", "title": "Sperren via Button erlauben",
"type": "singlestat", "type": "singlestat",
"valueFontSize": "80%", "valueFontSize": "80%",
"valueMaps": [ "valueMaps": [
@ -2316,7 +2352,7 @@
"#d44a3a" "#d44a3a"
], ],
"datasource": "$Datasource", "datasource": "$Datasource",
"description": "Erlaube Sperrvorgänge durch Drücken des Buttons am Smart Lock.", "description": "",
"format": "none", "format": "none",
"gauge": { "gauge": {
"maxValue": 100, "maxValue": 100,
@ -2331,7 +2367,7 @@
"x": 15, "x": 15,
"y": 22 "y": 22
}, },
"id": 52, "id": 49,
"interval": null, "interval": null,
"links": [], "links": [],
"mappingType": 1, "mappingType": 1,
@ -2349,7 +2385,7 @@
"nullPointMode": "connected", "nullPointMode": "connected",
"nullText": null, "nullText": null,
"postfix": "", "postfix": "",
"postfixFontSize": "80%", "postfixFontSize": "50%",
"prefix": "", "prefix": "",
"prefixFontSize": "50%", "prefixFontSize": "50%",
"rangeMaps": [ "rangeMaps": [
@ -2365,29 +2401,29 @@
"lineColor": "rgb(31, 120, 193)", "lineColor": "rgb(31, 120, 193)",
"show": false "show": false
}, },
"tableColumn": "buttonEnabled", "tableColumn": "autoUnlatch",
"targets": [ "targets": [
{ {
"alias": "", "alias": "",
"format": "table", "format": "table",
"rawSql": "SELECT \n s.buttonEnabled \nFROM Smartlock AS s\nWHERE s.name = \"$SmartlockName\"\n;", "rawSql": "/*Beim Öffnen wird solange gedreht, bis die Türfalle nach innen gezogen wird*/\nSELECT \n s.autoUnlatch \nFROM Smartlock AS s\nWHERE s.name = \"$SmartlockName\"\n;",
"refId": "A" "refId": "A"
} }
], ],
"thresholds": "", "thresholds": "",
"title": "Sperren via Button erlauben", "title": "Öffnen mitsamt Schlossfalle",
"type": "singlestat", "type": "singlestat",
"valueFontSize": "80%", "valueFontSize": "80%",
"valueMaps": [ "valueMaps": [
{ {
"op": "=", "op": "=",
"text": "Nein", "text": "Ja",
"value": "0" "value": "1"
}, },
{ {
"op": "=", "op": "=",
"text": "Ja", "text": "Nein",
"value": "1" "value": "0"
} }
], ],
"valueName": "avg" "valueName": "avg"
@ -2508,26 +2544,27 @@
"colorBackground": false, "colorBackground": false,
"colorValue": false, "colorValue": false,
"colors": [ "colors": [
"#299c46", "#d44a3a",
"#cca300", "#e24d42",
"#d44a3a" "#629e51"
], ],
"datasource": "$Datasource", "datasource": "$Datasource",
"description": "Erlaube, neue Geräte direkt mit dem Smart Lock zu koppeln.",
"format": "none", "format": "none",
"gauge": { "gauge": {
"maxValue": 730, "maxValue": 100,
"minValue": 0, "minValue": 0,
"show": true, "show": false,
"thresholdLabels": true, "thresholdLabels": false,
"thresholdMarkers": true "thresholdMarkers": true
}, },
"gridPos": { "gridPos": {
"h": 6, "h": 2,
"w": 3, "w": 3,
"x": 21, "x": 21,
"y": 22 "y": 22
}, },
"id": 9, "id": 53,
"interval": null, "interval": null,
"links": [], "links": [],
"mappingType": 1, "mappingType": 1,
@ -2544,9 +2581,9 @@
"maxDataPoints": 100, "maxDataPoints": 100,
"nullPointMode": "connected", "nullPointMode": "connected",
"nullText": null, "nullText": null,
"postfix": " Tagen", "postfix": "",
"postfixFontSize": "50%", "postfixFontSize": "80%",
"prefix": "vor ", "prefix": "",
"prefixFontSize": "50%", "prefixFontSize": "50%",
"rangeMaps": [ "rangeMaps": [
{ {
@ -2561,25 +2598,29 @@
"lineColor": "rgb(31, 120, 193)", "lineColor": "rgb(31, 120, 193)",
"show": false "show": false
}, },
"tableColumn": "TIMESTAMPDIFF(SECOND, NOW(), ADDTIME(n.date, SEC_TO_TIME(s.timezoneOffset*60))) / -86400", "tableColumn": "pairingEnabled",
"targets": [ "targets": [
{ {
"alias": "", "alias": "",
"format": "table", "format": "table",
"hide": false, "rawSql": "SELECT \n s.pairingEnabled\nFROM Smartlock AS s\nWHERE s.name = \"$SmartlockName\"\n;",
"rawSql": "/*Letzte Kalibrierung / Optimierung*/\nSELECT \n TIMESTAMPDIFF(SECOND, NOW(), ADDTIME(n.date, SEC_TO_TIME(s.timezoneOffset*60))) / -86400 /*Hole nur die letzte Zeile*/\nFROM \n SmartlockLog AS n, \n Smartlock AS s\nWHERE \n n.state = 8 AND \n s.name = \"$SmartlockName\"\nORDER BY n.date DESC /*ORDER BY ist wichtig, damit immer die letzte Zeile zur Berechnung verwendet wird!*/\nLIMIT 1\n;",
"refId": "A" "refId": "A"
} }
], ],
"thresholds": "180,365,730", "thresholds": "0,1",
"title": "Letzte Kalibrierung", "title": "Bluetooth Pairing",
"type": "singlestat", "type": "singlestat",
"valueFontSize": "50%", "valueFontSize": "80%",
"valueMaps": [ "valueMaps": [
{ {
"op": "=", "op": "=",
"text": "1", "text": "Nein",
"value": "0" "value": "0"
},
{
"op": "=",
"text": "Ja",
"value": "1"
} }
], ],
"valueName": "avg" "valueName": "avg"
@ -3006,7 +3047,7 @@
"x": 15, "x": 15,
"y": 24 "y": 24
}, },
"id": 49, "id": 76,
"interval": null, "interval": null,
"links": [], "links": [],
"mappingType": 1, "mappingType": 1,
@ -3024,7 +3065,7 @@
"nullPointMode": "connected", "nullPointMode": "connected",
"nullText": null, "nullText": null,
"postfix": "", "postfix": "",
"postfixFontSize": "50%", "postfixFontSize": "80%",
"prefix": "", "prefix": "",
"prefixFontSize": "50%", "prefixFontSize": "50%",
"rangeMaps": [ "rangeMaps": [
@ -3040,29 +3081,54 @@
"lineColor": "rgb(31, 120, 193)", "lineColor": "rgb(31, 120, 193)",
"show": false "show": false
}, },
"tableColumn": "autoUnlatch", "tableColumn": "singleButtonPressAction",
"targets": [ "targets": [
{ {
"alias": "", "alias": "",
"format": "table", "format": "table",
"rawSql": "/*Beim Öffnen wird solange gedreht, bis die Türfalle nach innen gezogen wird*/\nSELECT \n s.autoUnlatch \nFROM Smartlock AS s\nWHERE s.name = \"$SmartlockName\"\n;", "rawSql": "SELECT \n s.singleButtonPressAction \nFROM Smartlock AS s\nWHERE s.name = \"$SmartlockName\"\n;",
"refId": "A" "refId": "A"
} }
], ],
"thresholds": "", "thresholds": "",
"title": "Öffnen mitsamt Schlossfalle", "title": "Aktion bei 1x Knopfdrücken",
"type": "singlestat", "type": "singlestat",
"valueFontSize": "80%", "valueFontSize": "80%",
"valueMaps": [ "valueMaps": [
{ {
"op": "=", "op": "=",
"text": "Ja", "text": "Keine Aktion",
"value": "0"
},
{
"op": "=",
"text": "Intelligent",
"value": "1" "value": "1"
}, },
{ {
"op": "=", "op": "=",
"text": "Nein", "text": "Öffnen",
"value": "0" "value": "2"
},
{
"op": "=",
"text": "Schließen",
"value": "3"
},
{
"op": "=",
"text": "Falle öffnen",
"value": "4"
},
{
"op": "=",
"text": "Lock 'n' Go",
"value": "5"
},
{
"op": "=",
"text": "Status zeigen",
"value": "6"
} }
], ],
"valueName": "avg" "valueName": "avg"
@ -3178,6 +3244,88 @@
], ],
"valueName": "avg" "valueName": "avg"
}, },
{
"cacheTimeout": null,
"colorBackground": false,
"colorValue": false,
"colors": [
"#629e51",
"#cca300",
"#ba43a9"
],
"datasource": "$Datasource",
"description": "",
"format": "none",
"gauge": {
"maxValue": 100,
"minValue": 0,
"show": false,
"thresholdLabels": false,
"thresholdMarkers": true
},
"gridPos": {
"h": 2,
"w": 3,
"x": 21,
"y": 24
},
"id": 21,
"interval": null,
"links": [],
"mappingType": 1,
"mappingTypes": [
{
"name": "value to text",
"value": 1
},
{
"name": "range to text",
"value": 2
}
],
"maxDataPoints": 100,
"nullPointMode": "connected",
"nullText": null,
"postfix": "",
"postfixFontSize": "50%",
"prefix": "",
"prefixFontSize": "50%",
"rangeMaps": [
{
"from": "null",
"text": "N/A",
"to": "null"
}
],
"sparkline": {
"fillColor": "rgba(31, 118, 189, 0.18)",
"full": false,
"lineColor": "rgb(31, 120, 193)",
"show": false
},
"tableColumn": "firmwareVersion",
"targets": [
{
"alias": "",
"format": "table",
"hide": false,
"rawSql": "SELECT \n s.firmwareVersion \nFROM Smartlock AS s\nWHERE s.name = \"$SmartlockName\"\n;",
"refId": "A"
}
],
"thresholds": "",
"title": "Firmwareversion",
"type": "singlestat",
"valueFontSize": "80%",
"valueMaps": [
{
"op": "=",
"text": "N/A",
"value": "null"
}
],
"valueName": "avg"
},
{ {
"cacheTimeout": null, "cacheTimeout": null,
"colorBackground": false, "colorBackground": false,
@ -3606,7 +3754,7 @@
"x": 15, "x": 15,
"y": 26 "y": 26
}, },
"id": 76, "id": 65,
"interval": null, "interval": null,
"links": [], "links": [],
"mappingType": 1, "mappingType": 1,
@ -3640,17 +3788,17 @@
"lineColor": "rgb(31, 120, 193)", "lineColor": "rgb(31, 120, 193)",
"show": false "show": false
}, },
"tableColumn": "singleButtonPressAction", "tableColumn": "doubleButtonPressAction",
"targets": [ "targets": [
{ {
"alias": "", "alias": "",
"format": "table", "format": "table",
"rawSql": "SELECT \n s.singleButtonPressAction \nFROM Smartlock AS s\nWHERE s.name = \"$SmartlockName\"\n;", "rawSql": "SELECT \n s.doubleButtonPressAction \nFROM Smartlock AS s\nWHERE s.name = \"$SmartlockName\"\n;",
"refId": "A" "refId": "A"
} }
], ],
"thresholds": "", "thresholds": "",
"title": "Aktion bei 1x Knopfdrücken", "title": "Aktion bei 2x Knopfdrücken",
"type": "singlestat", "type": "singlestat",
"valueFontSize": "80%", "valueFontSize": "80%",
"valueMaps": [ "valueMaps": [
@ -3803,6 +3951,81 @@
], ],
"valueName": "avg" "valueName": "avg"
}, },
{
"cacheTimeout": null,
"colorBackground": false,
"colorValue": false,
"colors": [
"#299c46",
"rgba(237, 129, 40, 0.89)",
"#d44a3a"
],
"datasource": "$Datasource",
"description": "",
"format": "none",
"gauge": {
"maxValue": 100,
"minValue": 0,
"show": false,
"thresholdLabels": false,
"thresholdMarkers": true
},
"gridPos": {
"h": 2,
"w": 3,
"x": 21,
"y": 26
},
"id": 60,
"interval": null,
"links": [],
"mappingType": 1,
"mappingTypes": [
{
"name": "value to text",
"value": 1
},
{
"name": "range to text",
"value": 2
}
],
"maxDataPoints": 100,
"nullPointMode": "connected",
"nullText": null,
"postfix": "",
"postfixFontSize": "80%",
"prefix": "",
"prefixFontSize": "50%",
"rangeMaps": [
{
"from": "null",
"text": "N/A",
"to": "null"
}
],
"sparkline": {
"fillColor": "rgba(31, 118, 189, 0.18)",
"full": false,
"lineColor": "rgb(31, 120, 193)",
"show": false
},
"tableColumn": "accountId",
"targets": [
{
"alias": "",
"format": "table",
"rawSql": "SELECT \n s.accountId\nFROM Smartlock AS s\nWHERE s.name = \"$SmartlockName\"\n;",
"refId": "A"
}
],
"thresholds": "",
"title": "Account Id",
"type": "singlestat",
"valueFontSize": "80%",
"valueMaps": [],
"valueName": "avg"
},
{ {
"cacheTimeout": null, "cacheTimeout": null,
"colorBackground": false, "colorBackground": false,
@ -3823,7 +4046,7 @@
}, },
"gridPos": { "gridPos": {
"h": 2, "h": 2,
"w": 6, "w": 9,
"x": 0, "x": 0,
"y": 28 "y": 28
}, },
@ -3905,8 +4128,8 @@
}, },
"gridPos": { "gridPos": {
"h": 2, "h": 2,
"w": 3, "w": 9,
"x": 6, "x": 9,
"y": 28 "y": 28
}, },
"id": 17, "id": 17,
@ -3987,7 +4210,7 @@
"gridPos": { "gridPos": {
"h": 2, "h": 2,
"w": 6, "w": 6,
"x": 9, "x": 18,
"y": 28 "y": 28
}, },
"id": 11, "id": 11,
@ -4047,274 +4270,6 @@
], ],
"valueName": "avg" "valueName": "avg"
}, },
{
"cacheTimeout": null,
"colorBackground": false,
"colorValue": false,
"colors": [
"#299c46",
"rgba(237, 129, 40, 0.89)",
"#d44a3a"
],
"datasource": "$Datasource",
"description": "",
"format": "none",
"gauge": {
"maxValue": 100,
"minValue": 0,
"show": false,
"thresholdLabels": false,
"thresholdMarkers": true
},
"gridPos": {
"h": 2,
"w": 3,
"x": 15,
"y": 28
},
"id": 65,
"interval": null,
"links": [],
"mappingType": 1,
"mappingTypes": [
{
"name": "value to text",
"value": 1
},
{
"name": "range to text",
"value": 2
}
],
"maxDataPoints": 100,
"nullPointMode": "connected",
"nullText": null,
"postfix": "",
"postfixFontSize": "80%",
"prefix": "",
"prefixFontSize": "50%",
"rangeMaps": [
{
"from": "null",
"text": "N/A",
"to": "null"
}
],
"sparkline": {
"fillColor": "rgba(31, 118, 189, 0.18)",
"full": false,
"lineColor": "rgb(31, 120, 193)",
"show": false
},
"tableColumn": "doubleButtonPressAction",
"targets": [
{
"alias": "",
"format": "table",
"rawSql": "SELECT \n s.doubleButtonPressAction \nFROM Smartlock AS s\nWHERE s.name = \"$SmartlockName\"\n;",
"refId": "A"
}
],
"thresholds": "",
"title": "Aktion bei 2x Knopfdrücken",
"type": "singlestat",
"valueFontSize": "80%",
"valueMaps": [
{
"op": "=",
"text": "Keine Aktion",
"value": "0"
},
{
"op": "=",
"text": "Intelligent",
"value": "1"
},
{
"op": "=",
"text": "Öffnen",
"value": "2"
},
{
"op": "=",
"text": "Schließen",
"value": "3"
},
{
"op": "=",
"text": "Falle öffnen",
"value": "4"
},
{
"op": "=",
"text": "Lock 'n' Go",
"value": "5"
},
{
"op": "=",
"text": "Status zeigen",
"value": "6"
}
],
"valueName": "avg"
},
{
"cacheTimeout": null,
"colorBackground": false,
"colorValue": false,
"colors": [
"#299c46",
"rgba(237, 129, 40, 0.89)",
"#d44a3a"
],
"datasource": "$Datasource",
"description": "",
"format": "none",
"gauge": {
"maxValue": 100,
"minValue": 0,
"show": false,
"thresholdLabels": false,
"thresholdMarkers": true
},
"gridPos": {
"h": 2,
"w": 3,
"x": 18,
"y": 28
},
"id": 60,
"interval": null,
"links": [],
"mappingType": 1,
"mappingTypes": [
{
"name": "value to text",
"value": 1
},
{
"name": "range to text",
"value": 2
}
],
"maxDataPoints": 100,
"nullPointMode": "connected",
"nullText": null,
"postfix": "",
"postfixFontSize": "80%",
"prefix": "",
"prefixFontSize": "50%",
"rangeMaps": [
{
"from": "null",
"text": "N/A",
"to": "null"
}
],
"sparkline": {
"fillColor": "rgba(31, 118, 189, 0.18)",
"full": false,
"lineColor": "rgb(31, 120, 193)",
"show": false
},
"tableColumn": "accountId",
"targets": [
{
"alias": "",
"format": "table",
"rawSql": "SELECT \n s.accountId\nFROM Smartlock AS s\nWHERE s.name = \"$SmartlockName\"\n;",
"refId": "A"
}
],
"thresholds": "",
"title": "Account Id",
"type": "singlestat",
"valueFontSize": "80%",
"valueMaps": [],
"valueName": "avg"
},
{
"cacheTimeout": null,
"colorBackground": false,
"colorValue": false,
"colors": [
"#629e51",
"#cca300",
"#ba43a9"
],
"datasource": "$Datasource",
"description": "",
"format": "none",
"gauge": {
"maxValue": 100,
"minValue": 0,
"show": false,
"thresholdLabels": false,
"thresholdMarkers": true
},
"gridPos": {
"h": 2,
"w": 3,
"x": 21,
"y": 28
},
"id": 21,
"interval": null,
"links": [],
"mappingType": 1,
"mappingTypes": [
{
"name": "value to text",
"value": 1
},
{
"name": "range to text",
"value": 2
}
],
"maxDataPoints": 100,
"nullPointMode": "connected",
"nullText": null,
"postfix": "",
"postfixFontSize": "50%",
"prefix": "",
"prefixFontSize": "50%",
"rangeMaps": [
{
"from": "null",
"text": "N/A",
"to": "null"
}
],
"sparkline": {
"fillColor": "rgba(31, 118, 189, 0.18)",
"full": false,
"lineColor": "rgb(31, 120, 193)",
"show": false
},
"tableColumn": "firmwareVersion",
"targets": [
{
"alias": "",
"format": "table",
"hide": false,
"rawSql": "SELECT \n s.firmwareVersion \nFROM Smartlock AS s\nWHERE s.name = \"$SmartlockName\"\n;",
"refId": "A"
}
],
"thresholds": "",
"title": "Firmwareversion",
"type": "singlestat",
"valueFontSize": "80%",
"valueMaps": [
{
"op": "=",
"text": "N/A",
"value": "null"
}
],
"valueName": "avg"
},
{ {
"columns": [], "columns": [],
"datasource": "$Datasource", "datasource": "$Datasource",
@ -4331,33 +4286,10 @@
"scroll": true, "scroll": true,
"showHeader": true, "showHeader": true,
"sort": { "sort": {
"col": 0, "col": null,
"desc": true "desc": false
}, },
"styles": [ "styles": [],
{
"alias": "Time",
"dateFormat": "YYYY-MM-DD HH:mm:ss",
"pattern": "Time",
"type": "date"
},
{
"alias": "",
"colorMode": null,
"colors": [
"rgba(245, 54, 54, 0.9)",
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"dateFormat": "HH:mm:ss - DD.MM.YYYY",
"decimals": 2,
"mappingType": 1,
"pattern": "Datum",
"thresholds": [],
"type": "date",
"unit": "short"
}
],
"targets": [ "targets": [
{ {
"alias": "", "alias": "",
@ -4382,7 +4314,7 @@
"type": "count" "type": "count"
} }
], ],
"rawSql": "SELECT\n @row_number:=@row_number + 1 AS \"Nr.\",\n ADDTIME(n.date, SEC_TO_TIME(s.timezoneOffset*60)) AS \"Datum\", -- +2 Stunden Aufschlag, da Zeitzone anders\n CASE \n WHEN n.name = \"\" AND n.trigger = 1 THEN \"Manuell\"\n WHEN n.name = \"\" AND n.trigger = 2 THEN \"Manuell (Button)\"\n WHEN n.name = \"\" AND n.action = 127 THEN \"System\"\n ELSE n.name\n END \"Trigger\", \n CASE \n WHEN n.action = 1 THEN \"Aufgesperrt\"\n WHEN n.action = 2 THEN \"Zugesperrt\"\n WHEN n.action = 3 THEN \"Tür geöffnet\"\n WHEN n.action = 4 THEN \"Lock 'n' Go\"\n WHEN n.action = 5 THEN \"Lock 'n' Go + Tür geöffnet\"\n WHEN n.action = 127 THEN \"Positionserkennung\"\n ELSE CONCAT(\"[\",n.action,\"] - \", \" Undefiniert\")\n END AS \"Aktion\",\n CASE\n WHEN n.state = 0 THEN \"OK\"\n WHEN n.state = 1 THEN \"Motor blockiert\"\n WHEN n.state = 2 THEN \"Abgebrochen\"\n WHEN n.state = 8 THEN \"Kalibriert\"\n WHEN n.state = 127 THEN \"Unbekannter Fehler\"\n ELSE CONCAT(\"[\",n.state,\"] - \", \" Undefiniert\")\n END AS \"Status\"\n /*n.trigger AS \"Trigger\" */\n /*n.autoUnlock AS \"Auto-Unlock\" */\n /*n.smartLockId AS \"\" */\n /*n.authId */\n /*n.id */\nFROM \n SmartlockLog AS n, \n Smartlock AS s,\n (SELECT @row_number:=0) AS t\nWHERE s.name = \"$SmartlockName\" \nORDER BY n.date DESC\n;", "rawSql": "SELECT\n @row_number:=@row_number + 1 AS \"Nr.\",\n CONCAT(DATE_FORMAT(ADDTIME(n.date, SEC_TO_TIME(s.timezoneOffset*60)),'%d.%m.%Y %H:%i:%s'),' (',DAYNAME(ADDTIME(n.date, SEC_TO_TIME(s.timezoneOffset*60))),')') AS \"Datum\", -- +2 Stunden Aufschlag, da Zeitzone anders\n CASE \n WHEN n.trigger = 0 AND n.name != \"\" THEN CONCAT(n.name, \" (User)\")\n WHEN n.trigger = 0 AND n.name = \"\" THEN \"Positionserkennung (Smartlock)\"\n WHEN n.trigger = 1 THEN \"Manuell\"\n WHEN n.trigger = 2 THEN \"Manuell (Button)\"\n WHEN n.trigger = 3 THEN \"Automatisch\"\n WHEN n.trigger = 4 THEN \"Web\"\n WHEN n.trigger = 5 THEN \"App\" \n WHEN n.trigger = 6 THEN \"Auto Lock\"\n WHEN n.trigger = 255 THEN \"Keypad\"\n ELSE CONCAT(\"[\",n.trigger,\"] - \", \" Undefiniert\")\n END \"Trigger\", \n CASE \n WHEN n.action = 1 THEN \"Aufgesperrt\"\n WHEN n.action = 2 THEN \"Zugesperrt\"\n WHEN n.action = 3 THEN \"Tür geöffnet\"\n WHEN n.action = 4 THEN \"Lock 'n' Go\"\n WHEN n.action = 5 THEN \"Lock 'n' Go + Tür geöffnet\"\n WHEN n.action = 252 THEN \"Intialisiert\"\n WHEN n.action = 253 THEN \"Kalibriert\"\n WHEN n.action = 254 THEN \"Log aktiviert\"\n WHEN n.action = 255 THEN \"Log deaktiviert\"\n ELSE CONCAT(\"[\",n.action,\"] - \", \" Undefiniert\")\n END AS \"Aktion\",\n CASE\n WHEN n.state = 0 THEN \"OK\"\n WHEN n.state = 1 THEN \"Motor blockiert\"\n WHEN n.state = 2 THEN \"Abgebrochen\"\n WHEN n.state = 3 THEN \"Zu neu\"\n WHEN n.state = 4 THEN \"Beschäftigt\"\n WHEN n.state = 5 THEN \"Batterien zu schwach\"\n WHEN n.state = 6 THEN \"Kupplungsfehler\"\n WHEN n.state = 7 THEN \"Motorstromfehler\"\n WHEN n.state = 8 THEN \"Kalibriert\"\n WHEN n.state = 254 THEN \"Anderer Fehler\"\n WHEN n.state = 255 THEN \"Unbekannter Fehler\"\n ELSE CONCAT(\"[\",n.state,\"] - \", \" Undefiniert\")\n END AS \"Status\"\n /*n.trigger AS \"Trigger\" */\n /*n.autoUnlock AS \"Auto-Unlock\" */\n /*n.smartLockId AS \"\" */\n /*n.authId */\n /*n.id */\nFROM \n SmartlockLog AS n, \n Smartlock AS s,\n (SELECT @row_number:=0) AS t\nWHERE s.name = \"$SmartlockName\" \nORDER BY n.date DESC\n;",
"refId": "A", "refId": "A",
"timeField": "date" "timeField": "date"
} }
@ -5912,7 +5844,7 @@
"type": "table" "type": "table"
} }
], ],
"refresh": "10s", "refresh": "30s",
"schemaVersion": 16, "schemaVersion": 16,
"style": "dark", "style": "dark",
"tags": [], "tags": [],
@ -6047,5 +5979,5 @@
"timezone": "", "timezone": "",
"title": "Nuki Smartlock + Bridge (Internals)", "title": "Nuki Smartlock + Bridge (Internals)",
"uid": "yEqqGFggz", "uid": "yEqqGFggz",
"version": 161 "version": 168
} }