1. Home
  2. Docs
  3. SmartConfig2.1
  4. 5. Sampler Modes
  5. 5.2 User defined/ Formula
  6. 5.2.1 Getting Started

5.2.1 Getting Started

Purpose:
Allows user-defined mathematical expressions to process incoming sensor data.

🔧 Syntax (in user defined code)

F14,<formula>,<A_pos>,<B_pos>,<C_pos>,<D_pos>

<formula>: A math expression using placeholders (ABCDRXYZ)

<A_pos> to <D_pos>: Indexes referring to the values in the sensorString, starting after the timestamp

Placeholders

PlaceholderDescription
ADValues from the sensorString
RResult from the previous F14 calculation
XZInternal counters (can be used or updated later)

The result of each calculation is stored in R, which can be used in subsequent formulas.

Example

Configuration line:

F14,A*1,2,0,0,0

Incoming sensor string:

2025/06/23 09:46:50,12453,0,22.3

After skipping the timestamp:

  • Index 0 → 12453
  • Index 1 → 0
  • Index 2 → 22.3

A = 22.3

Formula: A * 1

Result: R = 22.3

Notes

  • Comma-separated sensorString values are indexed starting at 0 (after timestamp).
  • Only available in User-Defined Mode
  • Avoid invalid math operations (e.g., division by zero).
  • Useful for scaling, offsetting, combining, or converting raw values on-device.

How can we help?