Heisenware Docs
Go to websiteGet a demo
  • đź‘‹Welcome
  • Getting started
  • Release Notes
    • v84 - Get in the flow
    • v83 - Beauty treatment
    • v82 — Fully distributed
    • v81 — Removing old cruft
    • v80 — Chicks on fire
    • v79 — Nothing is forever
    • v78 — Keep moving
    • v77 — More intelligence
    • v76 — Well cooked
  • Build & Deploy Apps
    • Overview
    • Flow Builder
      • Nodes (Functions)
        • Inputs
        • Trigger
        • Output
      • Function Extensions
        • Modifier
        • Filter
        • Error handler
        • Memorizer
      • Objects & Instances
      • Utilities
        • Basic Functions
        • PDF functions
        • Circular buffer
        • Timer
        • Counter
    • Integrations
      • Protocol Connectors
        • GraphQL
        • HTTP/REST
        • MQTT
        • OPC UA
          • Heidenhain PLCs with OPC UA
        • RS-232/485
        • Siemens S7
      • Data Connectors
        • File
        • Relational Database
        • Time Series Database (WIP)
      • API Connectors
        • OGC SensorThings API
        • Operating System
        • Zebra RFID IoT Connector
      • Agent / (Edge Connector)
      • Calling Custom Code
    • UI Builder
      • Input Widgets
        • Form
        • File Upload
        • Photo
        • Signature
        • Barcode / QR-Code (WIP)
        • Document Scan (WIP)
      • Display Widgets
        • Chart
        • Chat
        • Circular Gauge
        • Data Grid
        • Linear Gauge
        • Map
        • Media View
        • Progress Bar
        • Sparkline
        • Status Lamp
        • Toast
        • Value Box
        • Kanban Board
        • Data Tiles
        • Pie Chart
        • Sankey
      • Buttons
      • Text Box
      • Images
      • Icons
    • Communication Interfaces
      • Email Notifications
      • OPC UA Server
    • Data & File Storage
      • Internal InfluxDB
      • Internal PostgreSQL
      • File Server
    • App Appearance
      • Pages
      • In-App Navigation
      • Screens & Devices
      • Theming
    • Simulation & Testing
      • Simulating Events
      • Simulating Data
    • PDF Templates
    • RAG-based Chatbot
    • Deployment
  • Manage Apps
    • Overview
    • Manage Apps
      • General Settings
      • Users and Access
      • Distribution & Versioning
    • Manage Integrations
    • Manage Account
      • Account Structure
      • Members
      • Workspaces
  • TUTORIALS
    • Build Your First Heisenware App
  • Connect Heidenhain CNC with OPC UA Support
  • Related links
    • Website
    • Privacy policy
    • Imprint
Powered by GitBook
On this page
  • Recording data
  • Retention policy
  • Deleting recorder
  • Reading data
  • Read function
  • Query function
  1. Build & Deploy Apps
  2. Data & File Storage

Internal InfluxDB

Last updated 1 year ago

Heisenware incorporates a distinct InfluxDB time series database for each Workspace. This database is utilized to store time series data, enabling its future retrieval, processing, or visualization.

Given that each workspace has its own InfluxDB, various apps within the same Workspace can access data recorded by other apps. For this reason, the name of the InfluxDB contains the name of the Workspace, e.g., acme-influx.

If you have already set up your own InfluxDB or another time series database, consider using the . This will enable you to record and retrieve data to and from your database.

Recording data

To record time series data, you’ll need the recorder function extension. This can be attached to any function output or modifier. Here are the steps to record data:

  1. Click the + icon behind an output or modifier.

  2. Select Recorder.

  3. Add a name for the time series data measurement.

During runtime, either in test mode while in the App Builder, or after app deployment, the recording of the value begins. Each trigger of a function with recorder results in a data point. The configuration of the trigger determines the storage interval.

Retention policy

A retention policy specifies the duration after which data points are overwritten. This means that the oldest data point is always replaced with the most recent one. By default, the retention policy for a new measurement is set to forever, denoted by the letter F as part of the recorder.

You can select from various policies: hourly (H), daily (D), weekly (W), monthly (M), annually (A), and forever (F). With the forever policy, no data points are ever overwritten.

To modify the retention policy of a measurement, follow these steps:

  1. Right-click on the recorder.

  2. Select your preferred retention policy.

Deleting recorder

To delete a recorder:

  1. Right-click on the recorder.

  2. Select Delete.

If data has already been logged under a specific measurement, it will be preserved even if the recorder is deleted. If a new recorder is assigned the same measurement name, it will continue to write data to this existing series. This ensures that your data remains intact and accessible, regardless of changes to the recorder setup.

Reading data

Read function

To retrieve data from the InfluxDB, you’ll need a readfunction. This can be found in the functions panel under the path: Data Connectors -> Timeseries Database -> [workspace_name]-influx.

Input

The read function requires two inputs:

  • Bucket: This is the abbreviated name of the bucket to use, as defined in the recorder. It can be H, D, W, M, A, or F.

  • Measurement: This is the name of the measurement to read, as defined in the recorder.

Output

The read function outputs an array of objects, where date and value are keys within each object. This allows for easy access and manipulation of the retrieved data.

Filters and aggregators

Optional filters and aggregators for the third input:

  • tail: Number of latest values to read.

  • start: Earliest time for results, inclusive. Expects a string. Can be specified using an absolute timestamp, such as 2021-01-01T00:00:00Z, or using a relative timestamp, such as -1h or -15m.

  • stop: Latest time for results, exclusive. Expects a string. Defaults to now and can be specified as start using absolute or relative timestamps.

  • every: Aggregation window duration. Expects a string.

  • func: Aggregation function. Expects a string. Defaults to mean. Other options are median, min, max, or sum.

Recorder shortcut

A shortcut exists to add a pre-configured read function for a specific measurement. This shortcut can only be used if the original recorder is available in the same app. Click the database icon at the recorder’s right end to add a pre-configured read function with tail: 100, which is added directly below the data-recording function.

Query function

The query function provides raw access to InfluxDB, allowing queries using flux. This is an advanced feature; please consult the InfluxDB documentation for more information.

In the from statement (e.g., from(bucket: "example-bucket")), the bucket name corresponds to the retention policy, represented by either H, D, W, M, A, or F.

The data is stored as pairs of value and timestamp. The value can be anything, a single number (like a temperature value), an entire object, or even an array of arbitrary type. When data is queried, the associated timestamp appears in the , a simplified format based on , which is always 24 characters long (YYYY-MM-DDTHH:mm:ss.sssZ). The timezone is always UTC, as denoted by the suffix Z.

Before you can read data from the InfluxDB, ensure that data has been previously recorded. Useful visualization widgets for time series data that is read from the database are the , , and , which are all made for visualizing recorded, historic data.

date time string format
ISO 8601
data grid
chart
sparkline
time series database connector
Query InfluxDB with Flux | InfluxDB OSS v2 Documentation
Function with recorder and a measurement called “example”.
Read function returning an array of objects.
Read function shortcut by clicking recorder database icon.
Logo