Datacake Docs
  • Welcome
  • Get Started
  • Changelog
  • Best practices
    • Best practices: Getting started
    • Best practices: Resolution (Timeframe)
    • Best practices: Dashboards
    • Best practices: Reports
    • Best practices: Grouping Devices
  • Datacake LNS
    • Getting Started
    • Gateways
      • Milesight LoRaWAN Gateway - UG6x
      • RAKwireless WisGate Edge Light 2
    • Devices
    • Add Devices without Gateway
  • Device
    • Product
    • Configuration
    • Claiming
    • Historical Data
    • Database
      • Configuration Fields
      • Fields
        • Manual input
        • Field Roles
        • Formulas
        • Mapping Fields
      • Data retention & Datapoints
      • Examples
        • Mapping 4-20mA Signals
        • Converting Units
  • Dashboards
    • Global Dashboards
      • Setting Homepage
    • Device Dashboards
    • Multi-Device Dashboards
    • Widgets
      • Value Widget
      • Chart Widget
      • Image Map
      • Map Widget
      • Text Widget
      • SOS Widget
      • Boolean Widget
      • iFrame Widget
      • Downlink Widget
      • Set Value Widget
      • Measurement List Widget
      • Heatmap Widget
      • Table Widget
      • Image Widget
  • Portal
    • Multi-Tenancy (Workspaces)
    • Reports
      • Energy Report
    • Administrators
    • Members
      • API Users
    • Security & Privacy
    • Billing
      • Support Packages
      • VAT Exemption / Tax ID
      • SMS Credits
      • Access Invoices
      • Unused time and Remaining time in Invoices (Prorations)
      • Codes
    • White Label
    • Rules
      • Legacy Rule Engine
        • Sending notifications via Telegram
      • New Rule Engine
        • Rule Engine Table Overview
        • Copy/Paste and Template Functionality
        • Advanced Rule Engine E-Mail and Webhook Templates
        • Time Restrictions
    • Zones
  • Cake Red
    • Get Started
    • Overview
  • LoRaWAN
    • Get Started
      • CSV Import
      • Custom LoRaWAN Device
    • Configuring LNS
      • The Things Stack (TTN / TTI) Automated Setup
      • The Things Stack (TTN / TTI) Manual Setup
      • Loriot
      • Kerlink Wanesy
      • Helium
      • ChirpStack
      • Tektelic
      • Actility ThingPark
      • Senet
      • Milesight Gateway
      • KPN
    • Downlinks (LoRaWAN)
      • Set Time Frame
    • Securing Webhooks
    • Payload Decoders
      • Location and GPS
      • Access Gateway Metadata
      • Access Measurements
      • Global Variables
    • Using Cayenne LPP
    • Converting Payload
  • Generic API Devices
    • HTTP Downlinks
  • Integrations
    • MQTT
    • Particle
      • Get Started
      • Adding Integrations
      • Decoding Payloads
      • Calling Functions
      • Templates
        • Particle Tracker One
    • Incoming Webhooks
    • Outgoing Webhooks
      • Securing Outgoing Webhooks in Datacake
    • Golioth
    • Blues Wireless Notecard
    • Sigfox
    • Swarm Asset Tracker
    • Grandcentrix Modbus Cloud Connect
    • YuDash LYNX IoT Gateway
    • Dragino NB-IoT
      • Changing NB-IoT Bands
    • Hardwario CHESTER
    • 1NCE OS
  • API
    • Exporting Data
    • Record Measurements via API
    • Node RED to Datacake
    • Generate Access Token
    • Internal MQTT
      • Get Started
      • MQTT Documentation
      • MQTT over WebSocket
      • Example Code
    • GraphQL API
      • Using GraphQL
      • Device Creation
      • Tutorials
        • Read Group via Tags
  • Guides
    • Python
    • Send Slack Notifications
    • Forward Data to Cake Red
    • Multiple Data Feeds
    • Automated Dynamic Downlinks
    • Ingesting JSON Data into Datacake API Devices
    • Working with Default HTTP Decoder on API Devices and Code Examples
    • Accessing Measurements in Decoders
    • Connecting Datacake to Notion Using Zapier
    • How to set up and use location on non-GPS devices
    • How to integrate with AWS IoT Core
    • How to Schedule Mass-Downlinks (Multicast) using Datacake Rule Engine
    • How to Map Sensor Values to Ranges or Booleans, Strings using Mapping Fields
    • Understanding Internal vs. External MQTT Brokers on Datacake
    • Sending UDP Messages between 1NCE OS and Datacake
    • Concepts of LoRaWAN Payload Decoders on Datacake
    • How to check if a value stays above or below limits for given time
Powered by GitBook
On this page
  • What is a Mapping Field?
  • Usage
  • Examples
  • Add a new Mapping Field
  • Field Configuration
  • Mapping Type and Settings
  • Linear Scale Mapping
  • Use Boundaries
  • Source
  • Target
  • Visual check
  • Limitation of types
  • Lookup Table Mapping
  • Factor Mapping
  • Limitation of types
  • Save and Create

Was this helpful?

  1. Device
  2. Database
  3. Fields

Mapping Fields

Last updated 11 months ago

Was this helpful?

What is a Mapping Field?

Any mapping fields can be added to any field in the database. These calculate the content of the original field into a desired target value using various functions. The conversion is performed each time a new measurement value is written to the base field.

Mapping fields also store their contents in the database.

Usage

Mapping Fields can be used for the most diverse tasks. Some of these are, for example:

  • Simple scaling of a measured value using a factor

  • Mapping of a value range to the value range of a sensor

  • Conversion of numeric value to a string (for status messages based on a number) via Look-Up-Table

Examples

Under the following links you will find some best practices and examples for different tasks.

Add a new Mapping Field

Mapping fields can be created by adding them to a base field. To do this, open the drop-down menu of a field and click on "Add Mapping Field".

After you have clicked the button, the following modal appears:

The modal itself is divided into three different areas:

  • Field Configuration (RED)

  • Mapping Type (GREEN)

  • Mapping Settings (BLUE)

Field Configuration

Mapping Type and Settings

The tab bar (Green) must be used to define the type of conversion. A checkmark behind the active element indicates which type of conversion is active.

The settings for the respective conversions are described in the following sections. They are located in the area (Blue) below the tab bar (Green).

Linear Scale Mapping

Use this option to convert a value range to a target value range.

In linear scaling, the measured value is converted based on a scale. You must enter two base (Source) and target (Target) values here.

Use Boundaries

If you activate this option, the value resulting from the conversion remains within the scale (Target).

If the option is deactivated, negative values or values that lie outside the specified scale (Target) can result, but still be scaled based on the entered values (Target).

If you need a simple conversion based on a factor, use the option "Factor".

Source

This is the base-scale with which you specify the value range that is to be scaled to a new value range.

The two input fields below each other can be understood as "From" and "To" and describe the original value range.

Target

This describes the target value range.

Again, both input fields can be understood as "From" and "To". Enter the value range into which the original value range should be converted.

Offset

The offset can be used to achieve a static change of +/- the value specified in the text input field. It's added to the resulting value after the conversion has taken place.

To subtract an offset, enter a negative value in the Text Input field.

Visual check

To the settings you will find a graph that visually represents the conversion of the value range. Here you can visually check your input again.

Limitation of types

Even if the choice of type is not limited. The "Linear Scale" option works only with the following types:

  • Integer

  • Float

  • Counter

Lookup Table Mapping

Boolean

You can map a field to a Boolean value using a Lookup table. You need to enter the exact value that will be then converted to "True" or "False". The Fallback is the "else", which means it will be the other value(s). The switch ON means "True", the switch OFF means "False".

Factor Mapping

The "Factor" option allows you to convert the output value using a factor. The output value is multiplied here by the specified factor.

Limitation of types

Even if the choice of type is not limited. The "Factor" option only works with the following types:

  • Integer

  • Float

  • Counter

Save and Create

To create the mapping field, confirm your entries with the "Save" button. Only after you do this the field is created.

If this step was successful, the newly created mapping field is displayed as a subordinate field of the original field.

This area is identical to the field configuration of a basic field. Here you determine name, identifier, type and unit. Read more about this in the .

previous section