Skip to content

A 6‐channel full‐screen logic analyser

Greig Sheridan edited this page Oct 24, 2024 · 1 revision

A 6-channel full-screen logic analyser

image

  1. Import the below JSON into Grafana
  2. Customise your group addresses. (Replace all my dummy 'TODO' names with real GA's)
  3. Rename each trace for the legend. ("A" is the ALIAS in Query A, the rest are the ALIAS of their respective 'Add field from calculation' transformations)
{
  "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": 3,
  "links": [],
  "panels": [
    {
      "datasource": {
        "type": "influxdb",
        "uid": "PF8270FBC3295DC55"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "axisBorderShow": true,
            "axisCenteredZero": false,
            "axisColorMode": "text",
            "axisGridShow": true,
            "axisLabel": "",
            "axisPlacement": "left",
            "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",
            "spanNulls": false,
            "stacking": {
              "group": "A",
              "mode": "none"
            },
            "thresholdsStyle": {
              "mode": "off"
            }
          },
          "decimals": 1,
          "fieldMinMax": true,
          "mappings": [
            {
              "options": {
                "1": {
                  "index": 1,
                  "text": "On"
                },
                "2": {
                  "index": 3,
                  "text": "-"
                },
                "3": {
                  "index": 5,
                  "text": "Off"
                },
                "4": {
                  "index": 7,
                  "text": "On"
                },
                "5": {
                  "index": 9,
                  "text": "-"
                },
                "6": {
                  "index": 11,
                  "text": "Off"
                },
                "7": {
                  "index": 13,
                  "text": "On"
                },
                "8": {
                  "index": 15,
                  "text": "-"
                },
                "0.5": {
                  "index": 0,
                  "text": "-"
                },
                "1.5": {
                  "index": 2,
                  "text": "Off"
                },
                "2.5": {
                  "index": 4,
                  "text": "On"
                },
                "3.5": {
                  "index": 6,
                  "text": "-"
                },
                "4.5": {
                  "index": 8,
                  "text": "Off"
                },
                "5.5": {
                  "index": 10,
                  "text": "On"
                },
                "6.5": {
                  "index": 12,
                  "text": "-"
                },
                "7.5": {
                  "index": 14,
                  "text": "Off"
                },
                "8.5": {
                  "index": 16,
                  "text": "On"
                }
              },
              "type": "value"
            }
          ],
          "max": 8.5,
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          }
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "TraceB"
            },
            "properties": [
              {
                "id": "custom.hideFrom",
                "value": {
                  "legend": true,
                  "tooltip": true,
                  "viz": true
                }
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "TraceC"
            },
            "properties": [
              {
                "id": "custom.hideFrom",
                "value": {
                  "legend": true,
                  "tooltip": true,
                  "viz": true
                }
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "TraceD"
            },
            "properties": [
              {
                "id": "custom.hideFrom",
                "value": {
                  "legend": true,
                  "tooltip": true,
                  "viz": true
                }
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "TraceE"
            },
            "properties": [
              {
                "id": "custom.hideFrom",
                "value": {
                  "legend": true,
                  "tooltip": true,
                  "viz": true
                }
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "TraceF"
            },
            "properties": [
              {
                "id": "custom.hideFrom",
                "value": {
                  "legend": true,
                  "tooltip": true,
                  "viz": true
                }
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 24,
        "w": 24,
        "x": 0,
        "y": 0
      },
      "id": 1,
      "options": {
        "legend": {
          "calcs": [],
          "displayMode": "list",
          "placement": "bottom",
          "showLegend": true
        },
        "tooltip": {
          "mode": "single",
          "sort": "none"
        }
      },
      "pluginVersion": "11.3.0",
      "targets": [
        {
          "alias": "A",
          "datasource": {
            "type": "influxdb",
            "uid": "PF8270FBC3295DC55"
          },
          "groupBy": [
            {
              "params": [
                "$__interval"
              ],
              "type": "time"
            },
            {
              "params": [
                "previous"
              ],
              "type": "fill"
            }
          ],
          "measurement": "telegram",
          "orderByTime": "ASC",
          "policy": "default",
          "refId": "A",
          "resultFormat": "time_series",
          "select": [
            [
              {
                "params": [
                  "boolean"
                ],
                "type": "field"
              },
              {
                "params": [],
                "type": "last"
              }
            ]
          ],
          "tags": [
            {
              "key": "destination_name::tag",
              "operator": "=",
              "value": "TODO"
            }
          ]
        },
        {
          "alias": "TraceB",
          "datasource": {
            "type": "influxdb",
            "uid": "PF8270FBC3295DC55"
          },
          "groupBy": [
            {
              "params": [
                "$__interval"
              ],
              "type": "time"
            },
            {
              "params": [
                "previous"
              ],
              "type": "fill"
            }
          ],
          "hide": false,
          "measurement": "telegram",
          "orderByTime": "ASC",
          "policy": "default",
          "refId": "B",
          "resultFormat": "time_series",
          "select": [
            [
              {
                "params": [
                  "boolean"
                ],
                "type": "field"
              },
              {
                "params": [],
                "type": "last"
              }
            ]
          ],
          "tags": [
            {
              "key": "destination_name::tag",
              "operator": "=",
              "value": "TODO"
            }
          ]
        },
        {
          "alias": "TraceC",
          "datasource": {
            "type": "influxdb",
            "uid": "PF8270FBC3295DC55"
          },
          "groupBy": [
            {
              "params": [
                "$__interval"
              ],
              "type": "time"
            },
            {
              "params": [
                "previous"
              ],
              "type": "fill"
            }
          ],
          "hide": false,
          "measurement": "telegram",
          "orderByTime": "ASC",
          "policy": "default",
          "refId": "C",
          "resultFormat": "time_series",
          "select": [
            [
              {
                "params": [
                  "boolean"
                ],
                "type": "field"
              },
              {
                "params": [],
                "type": "last"
              }
            ]
          ],
          "tags": [
            {
              "key": "destination_name::tag",
              "operator": "=",
              "value": "TODO"
            }
          ]
        },
        {
          "alias": "TraceD",
          "datasource": {
            "type": "influxdb",
            "uid": "PF8270FBC3295DC55"
          },
          "groupBy": [
            {
              "params": [
                "$__interval"
              ],
              "type": "time"
            },
            {
              "params": [
                "previous"
              ],
              "type": "fill"
            }
          ],
          "hide": false,
          "measurement": "telegram",
          "orderByTime": "ASC",
          "policy": "default",
          "refId": "D",
          "resultFormat": "time_series",
          "select": [
            [
              {
                "params": [
                  "boolean"
                ],
                "type": "field"
              },
              {
                "params": [],
                "type": "last"
              }
            ]
          ],
          "tags": [
            {
              "key": "destination_name::tag",
              "operator": "=",
              "value": "TODO"
            }
          ]
        },
        {
          "alias": "TraceE",
          "datasource": {
            "type": "influxdb",
            "uid": "PF8270FBC3295DC55"
          },
          "groupBy": [
            {
              "params": [
                "$__interval"
              ],
              "type": "time"
            },
            {
              "params": [
                "previous"
              ],
              "type": "fill"
            }
          ],
          "hide": false,
          "measurement": "telegram",
          "orderByTime": "ASC",
          "policy": "default",
          "refId": "E",
          "resultFormat": "time_series",
          "select": [
            [
              {
                "params": [
                  "boolean"
                ],
                "type": "field"
              },
              {
                "params": [],
                "type": "last"
              }
            ]
          ],
          "tags": [
            {
              "key": "destination_name::tag",
              "operator": "=",
              "value": "TODO"
            }
          ]
        },
        {
          "alias": "TraceF",
          "datasource": {
            "type": "influxdb",
            "uid": "PF8270FBC3295DC55"
          },
          "groupBy": [
            {
              "params": [
                "$__interval"
              ],
              "type": "time"
            },
            {
              "params": [
                "previous"
              ],
              "type": "fill"
            }
          ],
          "hide": false,
          "measurement": "telegram",
          "orderByTime": "ASC",
          "policy": "default",
          "refId": "F",
          "resultFormat": "time_series",
          "select": [
            [
              {
                "params": [
                  "boolean"
                ],
                "type": "field"
              },
              {
                "params": [],
                "type": "last"
              }
            ]
          ],
          "tags": [
            {
              "key": "destination_name::tag",
              "operator": "=",
              "value": "TODO"
            }
          ]
        }
      ],
      "title": "Six-channel logic analyser - all DPT1.xxx",
      "transformations": [
        {
          "id": "convertFieldType",
          "options": {
            "conversions": [
              {
                "destinationType": "number",
                "targetField": "A"
              },
              {
                "destinationType": "number",
                "targetField": "TraceB"
              },
              {
                "destinationType": "number",
                "targetField": "TraceC"
              },
              {
                "destinationType": "number",
                "targetField": "TraceD"
              },
              {
                "destinationType": "number",
                "targetField": "TraceE"
              },
              {
                "destinationType": "number",
                "targetField": "TraceF"
              }
            ],
            "fields": {}
          }
        },
        {
          "id": "calculateField",
          "options": {
            "alias": "B",
            "binary": {
              "left": {
                "matcher": {
                  "id": "byName",
                  "options": "TraceB"
                }
              },
              "right": {
                "fixed": "1.5"
              }
            },
            "mode": "binary",
            "reduce": {
              "reducer": "sum"
            },
            "replaceFields": false
          }
        },
        {
          "id": "calculateField",
          "options": {
            "alias": "C",
            "binary": {
              "left": {
                "matcher": {
                  "id": "byName",
                  "options": "TraceC"
                }
              },
              "right": {
                "fixed": "3"
              }
            },
            "mode": "binary",
            "reduce": {
              "reducer": "sum"
            }
          }
        },
        {
          "id": "calculateField",
          "options": {
            "alias": "D",
            "binary": {
              "left": {
                "matcher": {
                  "id": "byName",
                  "options": "TraceD"
                }
              },
              "right": {
                "fixed": "4.5"
              }
            },
            "mode": "binary",
            "reduce": {
              "reducer": "sum"
            }
          }
        },
        {
          "id": "calculateField",
          "options": {
            "alias": "E",
            "binary": {
              "left": {
                "matcher": {
                  "id": "byName",
                  "options": "TraceE"
                }
              },
              "right": {
                "fixed": "6"
              }
            },
            "mode": "binary",
            "reduce": {
              "reducer": "sum"
            }
          }
        },
        {
          "id": "calculateField",
          "options": {
            "alias": "F",
            "binary": {
              "left": {
                "matcher": {
                  "id": "byName",
                  "options": "TraceF"
                }
              },
              "right": {
                "fixed": "7.5"
              }
            },
            "mode": "binary",
            "reduce": {
              "reducer": "sum"
            }
          }
        }
      ],
      "type": "timeseries"
    }
  ],
  "preload": false,
  "schemaVersion": 40,
  "tags": [],
  "templating": {
    "list": []
  },
  "time": {
    "from": "now-24h",
    "to": "now"
  },
  "timepicker": {},
  "timezone": "browser",
  "title": "Full-screen 6-channel logic analyser",
  "uid": "ae1vg6wgoc8w0b",
  "version": 8,
  "weekStart": ""
}

Author: @greiginsydney

Clone this wiki locally